下面是代码:
<?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)){
$classurl=sys_ReturnBqClassname($s,9);
$tclass="";
$fr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fr[1]?$fr[1]:$GLOBALS[navclassid];
if($topbclassid==$s[classid]){
$tclass='current-menu-item';
}
?>
<li class="<?=$tclass?>" ><a href="<?=$classurl?>"><?=$s[classname]?></a>
<?php if($s[islast]==0){ ?>
<ul class="sub-menu">
<?php
$sql2=$empire->query("select classid,classname from {$dbtbpre}enewsclass where bclassid=$s[classid] and showclass=0 order by myorder,myorder asc");while($s2=$empire->fetch($sql2)){$classurl2=sys_ReturnBqClassname($s2,9); ?>
<li><a href="<?=$classurl2?>"><?=$s2[classname]?></a></li>
<?php } ?>
</ul>
<?php } ?>
</li>
<?php } ?>
以上就是帝国cms用PHP调用栏目导航标签并高亮简单版的代码及使用方法了,其中高亮代码CSS定义是current-menu-item。
本文摘自网络,不代表短经典网立场 https://www.duanjingdian.com/671.html