帝国cms首页php判断高亮和栏目判断高亮

帝国cms首页php判断高亮和栏目判断高亮,一个不错的判断技巧。判断首页高亮
  1. <li><a href="/" target="_self" class="channel-item <?php  if(empty($GLOBALS[navclassid])){echo "active";} ?>"><span>首页</span></a></li>
复制代码


判断栏目高亮:

  1. [e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid asc limit 8",5,24,0,0,0}]
  2. <?php
  3. $classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
  4. $class="";
  5. if($GLOBALS[navclassid])
  6. {
  7. $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
  8. $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID
  9. if($bqr[classid]==$topbclassid)
  10. {
  11. $class=" active";
  12. }
  13. }
  14. ?>
  15. <li><a href="<?=$classurl?>" target="_self" class="channel-item<?=$class?>"><span><?=$bqr[classname]?></span></a></li>[/e:loop]
复制代码






上一篇:帝国cms任何模板显示几年前、几天前、几小时前等代码
下一篇:帝国cms标题的css样式不一样如何写模板
如无回复请发邮件