帝国cms:父栏目和子栏目都能在当前栏目高亮
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]