帝国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,
操作如下图所示:
封面页循环栏目信息及头条图片
实现代码如下:



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

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注