首先在/e/class/userfun.php这个文件里面加上下面代码.上面父栏目的,下面子栏目的.红色代表css样式.自定义吧
function currentPage($classid,$thisid){
global $class_r;
$fr=explode('|',$class_r[$classid][featherclass]);
$topbclassid=$fr[1]?$fr[1]:$classid;
if ($topbclassid==$thisid) {
echo "current";
}
else {
}
}
function OnePage($classid,$thisid){
global $class_r;
$fr=explode('|',$class_r[$bclassid][featherclass]);
$topbclassid=$fr[1]?$fr[1]:$classid;
if ($topbclassid==$thisid) {
echo "one";
}
else {
}
}
模板中,上面父栏目,下面子栏目
[e:loop={'select classid,classname,classpath from [!db.pre!]enewsclass where bclassid=0 order by classid',0,24,0}]
<li class="<?=currentPage($GLOBALS[navclassid],$bqr[classid])?>"><a href="<?=$public_r[newsurl]?><?=$bqr[classpath]?>" rel="dropmenu3" ><?=$bqr[classname]?></a></li>
[/e:loop] [e:loop={"select classid,classname,classpath from [!db.pre!]enewsclass where bclassid='".$class_r[$GLOBALS[navclassid]][bclassid]."' order by classid ",0,24,0}]
<li><a href="<?=$public_r[newsurl]?><?=$bqr[classpath]?>" class="<?=OnePage($GLOBALS[navclassid],$bqr[classid])?>" ><span class='l'></span><span><?=$bqr[classname]?></span><span class="r"></span></a></li>
[/e:loop]
最终效果如下: