濮阳杆衣贸易有限公司

主頁(yè) > 網(wǎng)站建設(shè) > 建站知識(shí) > DEDECMS專(zhuān)題不能選取一級(jí)欄目的解決方案

DEDECMS專(zhuān)題不能選取一級(jí)欄目的解決方案

POST TIME:2020-03-28 17:55

今天一位朋友說(shuō)他建立的織夢(mèng)專(zhuān)題不能選取一級(jí)欄目,很是煩惱!向我尋求幫助,其實(shí)我也沒(méi)花什么功夫研究,只是在網(wǎng)上搜索了一些教程,然后測(cè)試下,現(xiàn)在將我測(cè)試的教程發(fā)出來(lái),供大家研究。

打開(kāi)dedeincinc_catalog_options.php,將以下代碼完全替換,即可。

友情提示:上面紅色的dede為后臺(tái)目錄,請(qǐng)注意自己的后臺(tái)是否修改了。另外,使用以下代碼前,請(qǐng)注意備份。

<?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 = "";

//當(dāng)前選中的欄目
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> ";
}

//是否限定用戶(hù)管理的欄目
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);
}
}
?>



收縮
  • 微信客服
  • 微信二維碼
  • 電話(huà)咨詢(xún)

  • 400-1100-266
绥德县| 克山县| 孟津县| 南溪县| 鱼台县| 长沙县| 平南县| 仁化县| 灌南县| 乌兰浩特市| 台州市| 平陆县| 吴川市| 鸡泽县| 高密市| 精河县| 顺义区| 大庆市| 富顺县| 岳普湖县| 嵊州市| 全椒县| 庆云县| 长沙县| 泰安市| 仙游县| 怀宁县| 诸暨市| 张家口市| 青岛市| 武邑县| 尼勒克县| 克拉玛依市| 南华县| 宁乡县| 云和县| 志丹县| 应用必备| 鄂托克前旗| 吉隆县| 玉树县|