效果图:
代码:
<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>
演示站地址:http://mwpz2.cncobo.com
<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>
© 版权声明
THE END
暂无评论内容