dedecms织梦模板dede:channel里面调用文章列表的方法

01
{dede:channel type='son' noself='yes'}
[field:id runphp=yes]
global $dsql;
$sql = "SELECT arc.* FROM `mydiy_archives` arc where arc.arcrank>-1 AND arc.typeid = @me ORDER BY arc.id desc limit 10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';
while($row = $dsql->GetArray('t'))
{
$arcurl = GetOneArchive($row['id']);
$pubdate = MyDate('m-d',$row['pubdate']);
$result .= <<< TPL
<dt><a href="{$arcurl['arcurl']}"><span class="aa2">{$row['title']}</span><span class="aa3">{$pubdate}</span></a></dt>
TPL;
}
@me = $result;
[/field:id]
{/dede:channel}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/58bd5db5471e31d907ccce884bca051d.html