• 懒鸟飞:帝国cms模板专业分享平台,新域名:lanniaofei.com

帝国CMS无限级栏目导航实用教程-帝国三级导航使用方法

制作导航或侧边栏子栏目导航时,有时候会需要生成三级、四级导航,甚至更多,下面的代码,就是生成多级导航。

<?php
$ecms_bq_sql=sys_ReturnEcmsLoopBq("select * from [!db.pre!]enewsclass where  bclassid=2 order by myorder limit 7",14,24,0);
$bqno=0;
while($bqr=$empire->fetch($ecms_bq_sql))
{
        $bqsr=sys_ReturnEcmsLoopStext($bqr);
        $bqno++;
        ?>   
    <div class="bar"><h2><?=sub($bqr[classname],0,54,false)?></h2></div>
<?php
        $ecms_bq_sql2=sys_ReturnEcmsLoopBq("select * from [!db.pre!]enewsclass where bclassid=$bqr[classid] order by myorder limit 8",14,24,0);
        $bqno2=0;
        while($bqr2=$empire->fetch($ecms_bq_sql2))
        {
                $bqsr2=sys_ReturnEcmsLoopStext($bqr2);
                $bqno2++;
                ?>
<ul>
<li class="f"><h3><a href="<?=$public_r[newsurl]?><?=$bqr2[classpath]?>/" target="_blank"><?=sub($bqr2[classname],0,54,false)?></a></h3></li>
<li>
<?php
        $ecms_bq_sql3=sys_ReturnEcmsLoopBq("select classid,classname,classpath from [!db.pre!]enewsclass where bclassid = $bqr2[classid] order by classid limit 100",0,24,0);
        $bqno3=0;
        while($bqr3=$empire->fetch($ecms_bq_sql3))
        {
                $bqsr3=sys_ReturnEcmsLoopStext($bqr3);
                $bqno3++;
                ?>
<a href="<?=$public_r[newsurl]?><?=$bqr3[classpath]?>/" target="_blank"><?=sub($bqr3[classname],0,54,false)?></a>
        <?php
        }
        ?>

</li>
</ul>
                <?php
        }
        ?>
        
<?php
}
?>
 
QQ在线咨询
QQ客服
淘宝官网