复制以下函数放到 e/class/userfun.php 文件中
在需要调用的地方调用了,调用方法
- function dp_classmenu($bclassid,$i=0,$m=0){
- global $empire,$dbtbpre,$public_r;
- $bclassid=(int)$bclassid;
- $i=(int)$i;
- if(!$i){$i=1;}
- $d=$i;
- if($d>2){$d=2;}
- $st='';
- if($d>1&&$m==1){
- $st=' start';
- }
- $returnstr='';
- $i+=1;
- $m=0;
- $sql=$empire->query("select classid,classname,bclassid,islast,classpath from {$dbtbpre}enewsclass where bclassid='$bclassid' and wburl='' order by myorder,classid");
- while($r=$empire->fetch($sql)){
- $returnstr.='<li class="tm'.$d.$st.'">';
- $classurl=$public_r['newsurl'].$r['classpath'].'/';
- $m+=1;
- if($r['islast']){
- $qstr='<span class="facefont wj">&C</span>';
- $lian='';
- $hstr='';
- }else{
- $qstr='<span class="facefont wjj">&D</span>';
- $lian='class="lian"';
- $hstr='<span class="facefont hao">-</span>';
- }
- $returnstr.=$qstr.'<a href="'.$classurl.'" '.$lian.'>'.$exp.$r['classname'].'</a>'.$hstr;
- if(empty($r['islast']))
- {
- $moreclassstr=dp_classmenu($r['classid'],$i,$m);
- $returnstr.='<ul class="tmu2" style="display:none">'.$moreclassstr.'</ul>';
- }
- $returnstr.="</li>";
- }
- return $returnstr;
- }
- <?=dp_classmenu(0)?>