帝国cms7.5封面页循环调用子栏目信息以及头条图片
封面页循环栏目信息及头条图片
实现效果如图:
封面页 实现代码如下;
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` desc ",7,24,0}]
<a href="" target="_blank">更多+
query("select * from [!db.pre!]ecms_news where classid = ".$bqr[classid]." and titlepic!=' ' order by newstime desc limit 3");
$commbookurl=sys_ReturnBqTitleLink($commbook);
while($r=$empire->fetch($commbook)) {
?>
- <a href=""><img src="" >
query("select title,titlepic,smalltext,titleurl,keyboard,newstime,groupid,classid,newspath,filename,id from [!db.pre!]ecms_news where classid =".$bqr[classid]." order by newstime desc limit 5");
while($r=$empire->fetch($newbook)) {
?>
-
<a href="" title="">
[/e:loop]
如果需要在首页中显示,可以通过自定义扩展变量来获取栏目ID,
操作如下图所示:
![封面页循环栏目信息及头条图片 封面页循环栏目信息及头条图片](/wp-content/uploads/202206/7a1905fcc3c102a64ed03e84cf75d580.jpg)
实现代码如下:
[e:loop={"select classid, classname, classpath from [!db.pre!]enewsclass where classid in $bclassid order by myorder asc ",0,24,0}]
-
-
[/e:loop]
[e:loop={"select classid, classname, classpath from [!db.pre!]enewsclass where classid in $bclassid order by myorder asc ",0,24,0}]
query("select * from jxhx_ecms_news where classid = ".$bqr[classid]." and titlepic!=' ' and isgood=1 order by newstime desc limit 2");
$commbookurl=sys_ReturnBqTitleLink($commbook);
while($r=$empire->fetch($commbook)) {
?>
- <a href=""><img src="">
query("select * from jxhx_ecms_news where classid =".$bqr[classid]." order by newstime desc limit 5");
while($r=$empire->fetch($newbook)) {
?>
- <a href="" title="">
[/e:loop]
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。