方法1、
調用所有(循環導航)
- [e:loop={"select classpath,classname,classid,bclassid from [!db.pre!]enewsclass where bclassid='0' order by myorder ASC",100,24,0}]
- <div class="sitemap">
- <h3><a href='<?=$public_r['newsurl'].$bqr['classpath']?>'><?=$bqsr[classname]?></a></h3>
- <ul>
- <?php
- $dh=$empire->query("select classpath,classname from {$dbtbpre}enewsclass where bclassid='".$bqr['classid']."' order by myorder ASC");
- while($dhr=$empire->fetch($dh)) {
- ?>
- <li><a href='<?=$public_r['newsurl'].$dhr['classpath']?>'><?=$dhr[classname]?></a></li>
- <?php
- }
- ?>
- </ul></div>
- [/e:loop]
方法2、
調用所有(循環導航)
- [e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid asc",0,24,0}]
- <?php
- $classurl=sys_ReturnBqClassname($bqr,9);//取得欄目地址
- $style="";
- if($GLOBALS[navclassid])
- {
- $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
- $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得當前欄目的一級欄目ID
- if($bqr[classid]==$topbclassid)
- {
- $style="current-menu-item";
- }
- }
- ?>
- <li class="<?=$style?>"><a href="<?=$classurl?>"><?=$bqr[classname]?></a>
- <ul><li class='litop'></li>
- <?php
- //取得欄目下的子欄目
- $newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid asc limit 11");
- while($classr=$empire->fetch($newsclass))
- {
- $classrurl=sys_ReturnBqClassname($classr,9); //取得子欄目地址
- ?>
- <li><a href="<?=$classrurl?>"><?=$classr[classname]?></a></li>
- <?php
- }
- ?>
- </ul>
- </li>
- [/e:loop]
注釋:
1、bclassid='0' 0為所有欄目
2、調用指定欄目 修改上面的bclassid='0'為指定欄目的ID(如:bclassid='2' 新聞欄目ID=2),這樣時只顯示一級欄目下的所有子欄目(不顯示一級欄目)