帝国CMS教程

帝国cms灵动标签实现循环子栏目数据

2016-10-24

<?php $bclassid=$GLOBALS[navclassid];//取得本栏目id //取得本栏目下的子栏目 ?> [e:loop={"selectclassid,classname,classpathfrom`[!db.pre!]enewsclass`wherebclassid='$bclassid'orderby`classid`desc",7,24,0}] <dlclass="lbox"> <?php //这里是取得该分类下的有图片的最新数据 $commbook=$empire->fetch1("selecttitle,titlepic,smalltext,titleurl,keyboard,groupid,classid,newspath,filename,idfrom{$dbtbpre}ecms_newswhereclassid=".$bqr[classid]."andtitlepic!=''orderbynewstimedesclimit1"); $commbookurl=sys_ReturnBqTitleLink($commbook); ?> <dt> <h5><ahref="<?=$public_r[newsurl].$bqr[classpath]?>"><?=$bqr[classname]?></a></h5> <spanclass="more"><ahref="<?=$public_r[newsurl].$bqr[classpath]?>">更多</a></span></dt> <dd> <ulclass="list"> <liclass="p1"><ahref="<?=$commbookurl?>"target="_blank"><imgsrc="<?=$commbook[titlepic]?>"></a><ahref="<?=$commbookurl?>"target="_blank"><?=esub($commbook[title],28)?></a> <p><?=esub($commbook[smalltext],64)?>...</p> </li> <?php //取得该分类下的最新数据 $newbook=$empire->query("selecttitle,titlepic,smalltext,titleurl,keyboard,newstime,groupid,classid,newspath,filename,idfrom{$dbtbpre}ecms_newswhereclassid=".$bqr[classid]."orderbynewstimedesclimit5"); while($r=$empire->fetch($newbook)){ ?> <li><ahref="<?=sys_ReturnBqTitleLink($r)?>"title="<?=$r[title]?>"><?=$r[title]?></a><span><?=date('Y-m-d',$r[newstime])?></span></li> <?php } //显示5条 ?> </ul> </dd> </dl> [/e:loop]

电话 短信 电脑 客服