你知道帝国cms灵动标签如何实现循环子栏目数据吗?其实代码很简单,下面小编就来介绍一下。
<?php
$bclassid=$GLOBALS[navclassid];//取得本栏目id
//取得本栏目下的子栏目
?>
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` desc ",7,24,0}]
<a href="https://www.admin5.com/article/20201029/">
<a href="https://www.admin5.com/article/20201029/">更多
- <a href="https://www.admin5.com/article/20201029/" target="_blank"><img src="https://www.admin5.com/article/20201029/"><a href="https://www.admin5.com/article/20201029/" target="_blank">
...
- <a href="https://www.admin5.com/article/20201029/" title="">
<?php
//取得该分类下的最新数据
$newbook=$empire->query("select title,titlepic,smalltext,titleurl,keyboard,newstime,groupid,classid,newspath,filename,id from {$dbtbpre}ecms_news where classid =".$bqr[classid]." order by newstime desc limit 5");
while($r=$empire->fetch($newbook)) {
?>
<?php
}
//显示5条
?>
- <a href="https://www.admin5.com/article/20201029/" target="_blank"><img src="https://www.admin5.com/article/20201029/"><a href="https://www.admin5.com/article/20201029/" target="_blank">
<?php
//这里是取得该分类下的有图片的最新数据
$commbook=$empire->fetch1("select title,titlepic,smalltext,titleurl,keyboard,groupid,classid,newspath,filename,id from {$dbtbpre}ecms_news where classid = ".$bqr[classid]." and titlepic!='' order by newstime desc limit 1");
$commbookurl=sys_ReturnBqTitleLink($commbook);
?>
[/e:loop]
文章转自:黎青松SEO博客
来源地址:http://www.alitaohuo.com/CMSjiaocheng/diguojiaocheng/1855.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:SEO优化专员,转转请注明出处:https://www.chuangxiangniao.com/p/900570.html