DEDECMS專題不能選取一級欄目的解決方案,DEDE技術
導讀:DEDE技術DEDE技術今天一位朋友說他建立的織夢專題不能選取一級欄目,很是煩惱!向我尋求幫助,其實我也沒花什么功夫研究,只是在網上搜索了一些教程,然后測試下,現在將我測試的教程發出來dede免費模板dede5.7模板。
今天一位朋友說他建立的織夢專題不能選取一級欄目,很是煩惱!向我尋求幫助,其實我也沒花什么功夫研究,只是在網上搜索了一些教程,然后測試下,現在將我測試的教程發出來,供大家研究。
打開\dede\inc\inc_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>\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='$userCa手機模板dedetalog' "; } 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); }
// 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."dede后臺模板;</option>\r\n"; LogicGetOptionArray($row->id,$step."─",$channeltype,$dsql); } } ?>
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-21 ,文章DEDECMS專題不能選取一級欄目的解決方案,DEDE技術主要講述解決方案,標簽,CMS網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_32961.html
為你推薦與DEDECMS專題不能選取一級欄目的解決方案,DEDE技術相關的文章
