首页 > CMS > 织梦DEDE > 正文

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

2024-07-12 09:01:47
字体:
来源:转载
供稿:网友

dedecms织梦dede:channel标签里面调用文章列表实现代码如下所示:

{dede:channel type='son' noself='yes'}[field:id runphp=yes]global $dsql;$sql = "SELECT arc.* FROM `dede_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>{$row['title']}</span><span>{$pubdate}</span></a></dt>TPL;}@me = $result;[/field:id]{/dede:channel}

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表