帝国cms无限极栏目导航函数
2019-07-26 站长 站长日志
帝国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; ?>
来源:http://www.520am.com/forum/thread-16-64-0-0.html
下一篇:基于帝国CMS的建站日志