封面模板 可以实现循环子栏目以及头条调用,但是头条的图片和标题只能用一条,只有使用灵动标签。
实现效果如图:
<?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}] <div class="fengm"> <h3><span><a href="<?=$public_r[newsurl].$bqr[classpath]?>" target="_blank">更多+</a></span><?=$bqr[classname]?></h3> <div class="fpicbox"> <ul> <?php //这里是取得该分类下的有图片的最新数据 $commbook=$empire->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)) { ?> <li class="fpic"><a href="<?=sys_ReturnBqTitleLink($r)?>"><img src="<?=$r[titlepic]?>" ><i><?=$r[title]?></i></a></li> <?php } ?> </ul> </div> <ul class="fmnews"> <?php //取得该分类下的最新数据 $newbook=$empire->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)) { ?> <li><span><?=date('Y-m-d',$r[newstime])?></span><a href="<?=sys_ReturnBqTitleLink($r)?>" title="<?=$r[title]?>"><?=$r[title]?></a></li> <?php } //显示5条 ?> </ul> </div> [/e:loop]
当前仅支持登录后发布评论