帝国cms头部模板导航栏目显示代码,显示二级栏目下拉菜单带样式判断

代码:

<nav>
<ul id="starlist">
<li><a href="[!--news.url--]" class="<?=$GLOBALS[navclassid]?"":"hover"?>">首页</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='hover';
}
$classurl=sys_ReturnBqClassname($s,9);
echo '<li class="menu"><a href="'.$classurl.'" class='.$tclass.'>'.$s[classname].'</a>';
if(($s[islast]==0)&&($s[islist]==1)){
$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><a href="'.$classurl2.'">'.$s2[classname].'</a></li>';
}
echo '<ul class="sub">'.$str.'</ul>';
}
echo '</li>';
}
?>
</ul>
</nav>

 

<ul>
<li><a href="[!--news.url--]" class="<?=$GLOBALS[navclassid]?"":"hover"?>">首页</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='hover';
}
$classurl=sys_ReturnBqClassname($s,9);
echo '<li class="menu"><a href="'.$classurl.'" class='.$tclass.'>'.$s[classname].'</a>';   //一级分类开始样式
if(($s[islast]==0)&&($s[islist]==1)){
$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><a href="'.$classurl2.'">'.$s2[classname].'</a></li>';   //二级分类下拉样式
}
echo '<ul class="sub">'.$str.'</ul>'; //二级总分类样式
}
echo '</li>';//一级分类结束样式
}
?>
        
    </ul>

 

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注