找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 146|回复: 0

[cms教程] DEDECMS专题不能选取一级栏目的解决方案

[复制链接]

该用户从未签到

发表于 2020-6-1 08:57:07 | 显示全部楼层 |阅读模式

您需要 登录 才可以下载或查看,没有账号?立即注册

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

使用道具 举报

网站地图|页面地图|文字地图|Archiver|手机版|小黑屋|找资源 |网站地图

GMT+8, 2024-10-7 14:31

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表