帝国CMS导航高亮和二级导航调用(同时实现高亮和二级导航) 话不多说,直接附实例,大家自行套用测试即可: <?
$ishome==0;
if($ishome==1){
$homestyle='active';
}
?>
<li id="nvabar" class="<?=$homestyle?>"><a href="[!--news.url--]">首页</a></li>
<?php
$sql=$empire->query("select classid,classname,islast 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])&&($ishome==0)){
$tclass='active';
}
$classurl=sys_ReturnBqClassname($s,9);
echo '<li id="navbar-category-'.$s[classid].'" class="submenu li-cate-'.$s[classid].' '.$tclass.'"><a href="'.$classurl.'">'.$s[classname].'</a>';
if(!$s[islast]){
$sql2=$empire->query("select classid,classname from {$dbtbpre}enewsclass where bclassid=$s[classid] and showclass=0 order by myorder,myorder asc");
$str="";
while($s2=$empire->fetch($sql2)){
$classurl2=sys_ReturnBqClassname($s2,9);
$str.='<li id="navbar-category-'.$s[classid].'" class="li-cate-'.$s[classid].'"><a href="'.$classurl2.'">'.$s2[classname].'</a></li>';
}
echo '<ul class="sub-menu">'.$str.'</ul>';
}
echo '</li>';
}
?>
|