织梦文章添加字段填栏目id,内容页调用字段里的栏目文章

2022-08-18

在织梦模型里增加个字段,然后在添加文章的时候,在字段里填了栏目id进去
在前台的内容页,调用这个字段栏目的多个文章出来   
{dede:field.field1 runphp=yes}
global $dsql;
$sql = "select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,
tp.defaultname,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath
from `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id where tp.id in (@me) LIMIT 10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';
while($row = $dsql->GetArray('t'))
{
$arcurl=GetOneArchive($row['id']);
$pubdate = MyDate('Y-m-d H:i:s',$row['pubdate']);
$result .= "
  • {$pubdate}{$row['title']}
  • ";
    }
    @me = $result;
    {/dede:field.field1}
    field1 为字段名称

    非凡技术导航 优秀网址导航免费网站收录 网站地图

    本站收录的网站若侵害到您的利益,请联系我们删除处理

    Copyright ©2020 Guojiz V 5.5All Rights Reserved.

    备案号 )| 1735737677|