首页 > cms建站系统 > 帝国cms

帝国CMS调用父栏目下所有子栏目(排除当前栏目)

发布时间:2016-5-19 22:51

给一客户制作仿京东商城的商品分类菜单,本来这种菜单形式也很常见的,但京东商城的比较变态,就是当前栏目展示并且在保在最上面。如下图。

 

如是就想到一个思路:

先调用当前栏目的子栏目,然后再调用父栏目下所有子栏目(排除当前栏目)。

代码如下:

<?php//List all brother class exp self//trylife.$tl_thisclassid=$GLOBALS[navclassid];$tl_bclassid=$class_r[$tl_thisclassid][bclassid];$tl_class_sql=$empire->query("select classid,classname from {$dbtbpre}enewsclass where bclassid='".$tl_bclassid."'  and showclass=0 order by myorder,classid desc");while($tl_class_r=$empire->fetch($tl_class_sql)){if($tl_class_r[classid]==$tl_thisclassid)    {continue;    }?>        <li><a href="<?=sys_ReturnBqClassname($tl_class_r,9)?>"><?=$tl_class_r[classname]?></a></li>   <?}?>

 

 

标签:[!--infotagslink--]

您可能感兴趣的文章: