帝国cms导航显示顶级一级栏目/分类带高亮样式

使用教程 42
<li><ahref="[!--news.url--]"class="<?=$GLOBALS...
<li><a href="[!--news.url--]" class="<?=$GLOBALS[navclassid]?"":"active"?>"> 首页 <span class="sr-only">(current)</span></a></li>
<?php
$sql=$empire->query("select classid,sonclass,classname,islast,islist from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder,myorder asc");
while($s=$empire->fetch($sql)){
$tclass="";
$fr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fr[1]?$fr[1]:$GLOBALS[navclassid];
if($topbclassid==$s[classid]){
$tclass='active';
}
$classurl=sys_ReturnBqClassname($s,9);
echo '<li><a class="'.$tclass.'" href="'.$classurl.'">'.$s[classname].'</a></li>';

}
?>
扫码二维码