dedecms织梦自定义递归函数调用所有栏目效果如下:
在织梦include/extend.func.php这个文件后面添加如下代码:
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 `blog_arctype` WHERe reid='$channel' And ishidden<>1 order by sortrank asc limit 0, $line "); $dsql->Execute($channel); if($dsql->GetTotalRow($channel)>0) { $result .= "
- rn";
while($row = $dsql->GetArray($channel))
{
$id = $row['id'];
$typename = $row['typename'];
$typelink = GetoneTypeUrlA($row);
$result .= "
- rn"; $result .= " {$typename}rn"; getalltype($id,$line); $result .= " rn"; } $result .= "
在需要的位置用{dede:global.getalltype function='getalltype()'/}这个标签来调用
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)