您的位置:首页 > 帝国cms教程

帝国cms比较高效的首页高亮和栏目高亮的方法

2023-11-24 16:58:27 帝国cms教程 171

1.首页模板顶部加上<? $ishome=1; ?>

2,在公共模板变量头部模板这样写:

<? $ishome==0; if($ishome==1){ $home='liSelect'; } ?>
<li><a href="/" class="<?=$home?>">首页</a></li>
 [e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid asc limit 10",0,24,0}] 
  	<?php 
$classurl=sys_ReturnBqClassname($bqr,9);
$class="";
if($GLOBALS[navclassid]){
$fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];
if(($bqr[classid]==$topbclassid)&&($ishome==0))
{ $class="liSelect"; } 
} ?>
<li><a href="<?=$bqsr[classurl]?>" class='<?=$class?>'><?=$bqr[classname]?></a></li>
				 [/e:loop]

相关推荐