导航首页 » 网站优化

dedecms织梦dede:channel里面调用文章列表

2023/03/11 12:24    魔司收录网    已浏览143次

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