精華 帝國PHP系統系統用PHP調用欄目導航并實現高亮
<p>下面是代碼:</p>
<?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="http://www.viagraonlinego.com/<?=$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="http://www.viagraonlinego.com/<?=$classurl2?>"><?=$s2[classname]?></a></li>
<?php } ?>
</ul>
<?php } ?>
</li>
<?php } ?>
以上就是帝國php系統用PHP調用欄目導航標簽并高亮簡單版的代碼及使用方法了,其中高亮代碼CSS定義是current-menu-item。