dedecms 栏目树形无限级菜单实现办法
发布时间:2021-12-16 10:30 所属栏目:19 来源:互联网
导读:在includechannelunit.func.php文件底部添加如下代码: ----------------------------------------------------- /*树形栏目补充,获取二级,san级,四级栏目列表/ function getproducttree($typeid) { $linklist = ; $dsql = new dedesql(false); $dsql-setqu
在includechannelunit.func.php文件底部添加如下代码: ----------------------------------------------------- /*树形栏目补充,获取二级,san级,四级栏目列表/ function getproducttree($typeid) { $linklist = ""; $dsql = new dedesql(false); $dsql->setquery("select id,typedir,typename,isdefault from dede_arctype where reid = '$typeid' order by sortrank"); $dsql->execute(); while($row=$dsql->getobject()) { $typelink = gettypeurl($row->id,mftypedir($row->typedir),$row->isdefault,$row->defaultname,$row->ispart,$row->namerule2,$row->moresite,$row->siteurl,$row->sitepath); $linklist .= "n<div class="firsttype"><a href="$typelink"><b>".$row->typename."</b></a></div>nn"; $linklist .= getsonclass($row->id); } $dsql->close(); return $linklist; } $typelink = gettypeurl($row->id,mftypedir($row->typedir),$row->isdefault,$row->defaultname,$row->ispart,$row->namerule2,$row->moresite,$row->siteurl,$row->sitepath); $linklist .= "<li class="thirdtype"><a href="$typelink">".$row->typename."</a></li>n"; $linklist .= getsonclass3($row->id); } return $linklist; } function getsonclass3($parentid) { $linklist = ""; $dsql = new dedesql(false); $dsql->setquery("select id,typedir,typename,isdefault from dede_arctype where reid='$parentid' order by sortrank"); $dsql->execute($parentid); while($row=$dsql->getobject($parentid)) { //开源软件:Cuoxin.com $typelink = gettypeurl($row->id,mftypedir($row->typedir),$row->isdefault,$row->defaultname,$row->ispart,$row->namerule2,$row->moresite,$row->siteurl,$row->sitepath); $linklist .= "<li class="fourthtype"><a href="$typelink">".$row->typename."</a></li>n"; } return $linklist; } /*树形栏目补充*/ (编辑:ASP站长网) |
相关内容
网友评论
推荐文章
热点阅读