帝国cms默认调用子栏目:
[e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid asc",0,24,0}]
<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
$style="";
if($GLOBALS[navclassid])
{
$fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID
if($bqr[classid]==$topbclassid)
{
$style="current-menu-item";
}
}
?>
<li class="<?=$style?>"><a href="<?=$classurl?>"><?=$bqr[classname]?></a>
<ul><li class='litop'></li>
<?php
//取得栏目下的子栏目
$newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid asc limit 11");
while($classr=$empire->fetch($newsclass))
{
$classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址
?>
<li><a href="<?=$classrurl?>"><?=$classr[classname]?></a></li>
<?php
}
?>
</ul>
</li>
[/e:loop]
仅调用一级栏目:vulsee.com
[e:loop={"select classid,classname,classpath from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid asc",0,24,0}]
<li id="menu-item-8089" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-8089">
<a href="<?=$bqr[classpath]?>"><i class="<?=$bqr[classid]?>"></i><span class="font-text"><?=$bqr[classname]?></span></a></li>
[/e:loop] </ul>