栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > dedecms

DEDECMS专题不能选取一级栏目的解决方案

dedecms 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

DEDECMS专题不能选取一级栏目的解决方案

今天一位朋友说他建立的织梦dedecms 专题不能选取一级栏目,很是烦恼!向我寻求帮助,其实我也没花什么功夫研究,只是在网上搜索了一些教程,然后测试下,现在将我测试的教程发出来,供大家研究。 打开dedeincinc_catalog_options.php,将以下代码完全替换,即可。 友情提示:上面红色的dede为后台目录,请注意自己的后台是否修改了。另外,使用以下代码前,请注意备份。 SetQuery("Select id,typename From `dede_channeltype` ");  $dsql->Execute();  $channels = Array();  while($row = $dsql->GetObject()) $channels[$row->id] = $row->typename; $OptionArrayList = ""; //当前选中的栏目  if($selid > 0)  {  $row = $dsql->GetOne("Select id,typename,ispart,channeltype From `dede_arctype` where id='$selid'");  if($row['ispart']==1) $OptionArrayList .= "rn";  else $OptionArrayList .= "rn";  } //是否限定用户管理的栏目  if($userCatalog>0)  { $query = "Select id,typename,ispart,channeltype From `dede_arctype` where ispart<>2 And id='$userCatalog' "; }  else  { $query = "Select id,typename,ispart,channeltype From `dede_arctype` where ispart<>2 And reid=0 order by sortrank asc "; } $dsql->SetQuery($query);  $dsql->Execute(); while($row=$dsql->GetObject())  {  if($row->ispart==1) $OptionArrayList .= "rn";  else if($row->ispart==2) $OptionArrayList .="";  else if($row->channeltype!=$channeltype && $channeltype!=0) $OptionArrayList .= "rn";  else $OptionArrayList .= "rn";  LogicGetOptionArray($row->id,"─",$channeltype,$dsql);  } //  return $OptionArrayList;  }  function LogicGetOptionArray($id,$step,$channeltype,&$dsql)  {  global $OptionArrayList,$channels;  $dsql->SetQuery("Select id,typename,ispart,channeltype From `dede_arctype` where reid='".$id."' And ispart<>2 order by sortrank asc");  $dsql->Execute($id);  while($row=$dsql->GetObject($id))  {  if($row->ispart==1) $OptionArrayList .= "rn";  else if($row->ispart==2) $OptionArrayList .="";  else if($row->channeltype!=$channeltype && $channeltype!=0) $OptionArrayList .='';  else $OptionArrayList .= "rn";  LogicGetOptionArray($row->id,$step."─",$channeltype,$dsql);  }  }  ?>

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/4377.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号