VIP福利
主页 > 建站问题 > 织梦技巧 > dedecms织梦dede:channel里面调用文章列表

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

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 ) […]



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}
 


共有 条评论