帝国cms灵动标签循环调用指定栏目文章(可用于首页)
<div class="newsbox">
[e:loop={"select * from [!db.pre!]enewsclass where classid in (34,35,36) order by myorder asc ",0,24,0}]
<?php
$classURL=sys_ReturnBqClassname($bqr,9);//取得栏目地址
?>
<section>
<div class="news">
<h2 class="newstitle"><span><a href="<?=$classurl?>" target="_blank">更多</a></span><b><?=$bqr[classname]?></b></h2>
<ul>
<?php
//取得该分类下的最新数据
$newbook=$empire->query("select * from {$dbtbpre}eCMS_news where classid =".$bqr[classid]." and ispic=1 order by newstime desc limit 1");
while($r=$empire->fetch($newbook)) {
?>
<li><a href="<?=sys_ReturnBqTitleLink($r)?>" target="_blank"><span><img width="70" height="78" src="<?=$r[titlepic]?>" /></span><?=DoTitleFont($r[titlefont],$r[title])?></a> </li>
<?php
}
?>
</ul>
<ul>
<?php
//取得该分类下的最新数据
$newbook=$empire->query("select * from {$dbtbpre}eCMS_news where classid =".$bqr[classid]." order by newstime desc limit 8");
while($r=$empire->fetch($newbook)) {
?>
<li><a href="<?=sys_ReturnBqTitleLink($r)?>" target="_blank"><?=DoTitleFont($r[titlefont],$r[title])?></a> </li>
<?php
}
?>
</ul>
</div>
</section>
[/e:loop]
</div>
效果图:
原文:http://www.fangzhan.org/207.html