帝国CMS灵动标签循环子栏目导航的方法
效果:代码:[e:loop={"select classid,classname,islast from {$dbtbpre}enewsclass where bclassid='0' and showclass=0 order by myorder,classid ASC limit 11",0,24,0}]
<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
?>
<li><a href="<?=$classurl?>" target="_blank" class="a"><span><?=$bqr[classname]?></span></a>
<?php
if(!$bqr[islast]) //判断是否终极栏目
{
?>
<ul>
<?php
//取得栏目下的子栏目
$newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid desc limit 11");
while($classr=$empire->fetch($newsclass))
{
$classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址
?>
<li class="b"><a href="<?=$classrurl?>"><?=$classr[classname]?></a></li>
<?php
}
?>
</ul>
<?php
}
?>
</li>
[/e:loop]