首先在/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]