效果展示
1)增加自定义函数
在/e/class/userfun.php中添加下面的函数。
- function currentPage($classid,$thisid){
- global $class_r;
- $fr=explode('|',$class_r[$classid][featherclass]);
- $topbclassid=$fr[1]?$fr[1]:$classid;
- if ($topbclassid==$thisid) {
- echo "current";
- }
- }
- function OnePage($classid,$thisid){
- global $class_r;
- $fr=explode('|',$class_r[$bclassid][featherclass]);
- $topbclassid=$fr[1]?$fr[1]:$classid;
- if ($topbclassid==$thisid) {
- echo "one";
- }
- }
2)父栏目调用
- [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]
3)子栏目调用
- [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]
css样式自定义即可。