推荐设备MORE

教你零基础建站—绍兴公司办

教你零基础建站—绍兴公司办

行业知识

dedecms织梦cms启用三级四级无尽级频道实例教程

日期:2021-02-18
我要分享
dedecms织梦调用三级四级无限级栏目教程

第一种自定涵数递归法

可用于前端开发简易款式客户,在 include/extend.func.php 最下边加上


* @return string * 启用{dede:global.getalltype function= getalltype() /} function getalltype($channel=0,$line=10) $line = empty($line) ? 10 : $line; global $dsql,$result; $dsql- SetQuery( SELECT id,typename,typenamedir,typelitpic,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid= $channel And ishidden 1 order by sortrank asc limit 0, $line $dsql- Execute($channel); if($dsql- GetTotalRow($channel) 0) $result .= ul while($row = $dsql- GetArray($channel)) $id = $row[ id $typename = $row[ typename $typelink = GetOneTypeUrlA($row); $result .= li $result .= a href= {$typelink} target= _blank {$typename} /a getalltype($id,$line); $result .= /li $result .= /ul return $result; }
global $dsql; $sql = Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid=@me And ishidden 1 order by sortrank asc limit 0,10 $dsql- SetQuery($sql); $dsql- Execute( t $result = while($row = $dsql- GetArray( t )) $typename = $row[ typename $typeurl = GetOneTypeUrlA($row); $result .= TPL li a href= {$typeurl} {$typename} /a /li TPL; @me = $result; [/field:id] /ul /li {/dede:channel} /ul /li {/dede:channelartlist} /ul
global $dsql; $sql = Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid=@me And ishidden 1 order by sortrank asc limit 0,10 $dsql- SetQuery($sql); $dsql- Execute( t $result = while($row = $dsql- GetArray( t )) $row[ typeurl ] = GetOneTypeUrlA($row); $result .= a href= {$row[typeurl]} {$row[typename]} /a //四级 $nsql = Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid=$row[id] And ishidden 1 order by sortrank asc limit 0,10 $dsql- SetQuery($nsql); $dsql- Execute( n while($nrow = $dsql- GetArray( n )) $nrow[ typeurl ] = GetOneTypeUrlA($nrow); $result .= a href= {$nrow[typeurl]} {$nrow[typename]} /a @me = $result; [/field:id]