• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    dedecms专题不能选取一级栏目的解决方法
    POST TIME:2021-05-23 02:06

    关于dedecms5.5/5.6 专题不能选取一级栏目的解决方法

    打开\dede\inc\inc_catalog_options.php,将以下代码完全替换,即可。

    烈火提示:

    上面加粗的dede为后台目录,请注意自己的后台是否修改了。另外,使用以下代码前,请注意备份。

    Copy to ClipboardLiehuo.Net Codes引用的内容:[www.dede58.com]
    <?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>\r\n"; 
    else $OptionArrayList .= "<option value='".$row['id']."' selected='selected'>".$row['typename']."</option>\r\n"; 
    } 
    
    //是否限定用户管理的栏目 
    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>\r\n"; 
    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>\r\n"; 
    else $OptionArrayList .= "<option value='".$row->id."' class='option3'>".$row->typename."</option>\r\n"; 
    LogicGetOptionArray($row->id,"─",$channeltype,$dsql); 
    } 
    
    // liehuo.net
    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>\r\n"; 
    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>\r\n"; 
    LogicGetOptionArray($row->id,$step."─",$channeltype,$dsql); 
    } 
    } 
    ?>

    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!