帝国cms无限极栏目导航函数调用的方法介绍,是教大家如何使用函数调用无限极栏目导航的教程。
<?php require('../class/connect.php'); require('../class/db_sql.php'); require("../class/q_functions.php"); require('../data/dbcache/class.php'); $link=db_connect(); $empire=new mysqlquery(); //获取网站栏目------2014/7/2---by liangguanyu------------------ function user_ListCats($bclassid) { global $empire, $dbtbpre,$class_r; $sql=$empire->query("select classid, classname, bclassid, islast, classpath, classurl,tbname,sonclass,classimg from {$dbtbpre}enewsclass where bclassid='$bclassid' and wburl='' order by myorder,classid"); $num=$empire->num1($sql); if ($num == 0 && $bclassid == 0)//无记录 { echo $GLOBALS['notrecordword']; return ""; } if ($num == 0) { return ''; } $i = 1; while ($r=$empire->fetch($sql)) { // 如果不是终极栏目,显示其子目录 if($_GET['toHtml']){ $url=$_GET['root'].$r['classpath']; }else{ $url=$_GET['root'].'listInfo.php?classid='.$r['classid']; } $select = $_GET['classid']==$r['classid']?'class="mm-selected"':''; if(empty($r[islast]) ) { echo '<li '.$select.'><a href="' .$url. '"><i class="iconfont icon-'.($r['classimg']?$r['classimg']:$r['tbname']).'"></i> ' . $r[classname] . '</a>'; if($r[sonclass]){ echo '<ul>'."rn"; user_ListCats($r[classid], $showMore); echo '</ul>'."rn"; } echo '</li>'; } else { echo '<li '.$select.'><a href="' . $url . '"><i class="iconfont icon-'.($r['classimg']?$r['classimg']:$r['tbname']).'"></i> ' . $r[classname] . '</a></li>'; } $i += 1; } } echo @user_ListCats(); db_close(); $empire=null; ?>
以上是无限极栏目导航函数调用的教程。
|