3.1lit最新版當(dāng)一級(jí)欄目為最終列表欄目時(shí),使列表顯示其下級(jí)欄目的文章的修改 (方法借鑒)
include/inc_arclist_view.php
80行:
$addSql .= " And (typeid='".$this->TypeID."' or typeid2='".$this->TypeID."') ";
更改為:
//增加的,用來(lái)解決上級(jí)列表調(diào)用不出下級(jí)列表的問(wèn)題
$ssid = TypeGetSunID($this->TypeID,$this->dsql);
$ssid2 = str_replace('typeid','typeid2',$ssid);
//結(jié)束增加的
$addSql .= " And (typeid='".$this->TypeID."' or ".$ssid." or typeid2='".$this->TypeID."' or ".$ssid2.") ";//本句也已修改
上面這部分用來(lái)解決分頁(yè)問(wèn)題
include/inc/inc_fun_SpGetArcList.php
70行開(kāi)始:
if($ridnum>1){
$tpsql = "";
for($i=0;$i<$ridnum;$i ){
if($tpsql=="") $tpsql .= " And (".TypeGetSunID($reids[$i],$dsql,'arc');
else $tpsql .= " Or ".TypeGetSunID($reids[$i],$dsql,'arc');
}
$tpsql .= ") ";
$orwhere .= $tpsql;
unset($tpsql);
}
else{
$orwhere .= " And ".TypeGetSunID($typeid,$dsql,'arc');
}
更改為:
if($ridnum>1){
$tpsql = "";
for($i=0;$i<$ridnum;$i ){
if($tpsql=="") {
//開(kāi)始修改文章第二欄目調(diào)用問(wèn)題
$ssid = TypeGetSunID($reids[$i],$dsql,'arc');
$ssid2 = str_replace('typeid','typeid2',$ssid);
$tpsql .= " And (".$ssid." or ".$ssid2;}
else {
$tpsql .= " Or ".TypeGetSunID($reids[$i],$dsql,'arc');
$tpsql .= str_replace('typeid','typeid2',$tpsql);}
}
$tpsql .= ") ";
$orwhere .= $tpsql;
unset($tpsql);
}
else{
$ssid = TypeGetSunID($typeid,$dsql,'arc');
$ssid2 = str_replace('typeid','typeid2',$ssid);
$orwhere .= " And (".$ssid." or ".$ssid2.") ";//結(jié)束修改文章第二欄目調(diào)用問(wèn)題
}
此部分用來(lái)解決調(diào)用下級(jí)欄目文章列表問(wèn)題
替換的代碼我寫(xiě)的很粗糙,可以暫時(shí)先用著,等官方的解決方案出來(lái)后再替換
在 include/inc_arclist_view.php還要改一處:
//獲得一個(gè)單列的文檔列表
下
//類(lèi)別ID的條件
$orwhere .= " And (dede_archives.typeid='".$this->TypeID."' or dede_archives.typeid2='".$this->TypeID."') ";
改為:
//類(lèi)別ID的條件
$ssid = TypeGetSunID($this->TypeID,$this->dsql);
$orwhere .= " And (dede_archives.typeid='".$this->TypeID."' or ".$ssid." or dede_archives.typeid2='".$this->TypeID."') ";
否則有頁(yè)面沒(méi)有列表內(nèi)容,因?yàn)?0行是Select count(*).....
新聞熱點(diǎn)
疑難解答
圖片精選