欢迎来到润旭源码网
帮助中心

润旭源码网

热门搜索: 企业源码    免费源码   

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

  • 时间:2020-07-24 10:59 编辑: 来源: 阅读:156
  • 扫一扫,手机访问
摘要:今天一位朋友说他建立的织梦dedecms 专题不能选取一级栏目,很是烦恼!向我寻求帮助,其实我也没花什么功夫研究,只是在网上搜索了一些教程,然后测试下,现在将我测试的教程发出来,供大家研究。打开dedeincinc_catalog_options.php,将以下代码完全替换,即可。友情提示:上面红色的dede为后台目录,请注意自己的后台是否修改了。另外,使用以下代码前,请注意备份。<?phpfunction GetOptio

今天一位朋友说他建立的织梦dedecms 专题不能选取一级栏目,很是烦恼!向我寻求帮助,其实我也没花什么功夫研究,只是在网上搜索了一些教程,然后测试下,现在将我测试的教程发出来,供大家研究。

打开dedeincinc_catalog_options.php,将以下代码完全替换,即可。

友情提示:上面红色的dede为后台目录,请注意自己的后台是否修改了。另外,使用以下代码前,请注意备份。

<?php

function GetOptionList($selid=0,$userCatalog=0,$channeltype=0) 

global $OptionArrayList,$channels,$dsql;

$dsql->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 .= "<option value='".$row['id']."' class='option1' selected='selected'>".$row['typename']."(封面频道)</option> "; 

else $OptionArrayList .= "<option value='".$row['id']."' selected='selected'>".$row['typename']."</option> "; 

}

//是否限定用户管理的栏目 

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 .= "<option value='".$row->id."' class='option1'>".$row->typename."(封面频道)</option> "; 

else if($row->ispart==2) $OptionArrayList .=""; 

else if($row->channeltype!=$channeltype && $channeltype!=0) $OptionArrayList .= "<option value='".$row->id."' class='option2'>".$row->typename."(".$channels[$row->channeltype].")</option> "; 

else $OptionArrayList .= "<option value='".$row->id."' class='option3'>".$row->typename."</option> "; 

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 .= "<option value='".$row->id."' class='option1'>$step".$row->typename."(封面频道)</option> "; 

else if($row->ispart==2) $OptionArrayList .=""; 

else if($row->channeltype!=$channeltype && $channeltype!=0) $OptionArrayList .=''; 

else $OptionArrayList .= "<option value='".$row->id."' class='option3'>$step".$row->typename."</option> "; 

LogicGetOptionArray($row->id,$step."─",$channeltype,$dsql); 

?>

 


  • 全部评论(0)
资讯详情页最新发布上方横幅
联系我们

QQ:888477 {点击直接联系}

邮箱:runxu123@qq.com

时间:周1——周6 【9:00-23:00

联系客服
购买源码 源码咨询 投诉建议 联系客服
0373-6621888
手机版

扫一扫进手机版
返回顶部