使用帝国cms做网站的站长朋友应该都需要这段代码,
帝国cms调用一二级栏目做导航,因为这样调用很方便,还可以指定是否显示对应的栏目到导航,前提是做好了CSS布局样式,需要的站长复制粘贴吧!
<?php
$ecms_bq_sql=sys_ReturnEcmsLoopBq("select * from [!db.pre!]enewsclass where bclassid=0 and showclass=0 order by myorder limit 7",14,24,0);
$bqno=0;
while($bqr=$empire->fetch($ecms_bq_sql))
{
$bqsr=sys_ReturnEcmsLoopStext($bqr);
$bqno++;
?><li class="menu"><a href="[!--news.url--]<?=$bqr[classpath]?>/"><?=sub($bqr[classname],0,54,false)?></a>
<ul class="sub">
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq("select * from [!db.pre!]enewsclass where bclassid=$bqr[classid] and showclass=0 order by myorder limit 12",14,24,0);
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?><li><a href="[!--news.url--]<?=$bqr2[classpath]?>/"><?=sub($bqr2[classname],0,54,false)?></a></li>
<?php
}
?></ul><span></span></li>
<?php
}
?>