父栏目和子栏目都能在当前栏目高亮
首先在/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]
本文地址:https://www.17mb.com/study/ecms/68.html
附件下载
猜你喜欢
文章评论
用不了了(2019-12-02 18:22:54)