織夢dedecms 用交叉欄目時arclist標簽調用不出內容文章的問題


最近用了交叉欄目
發現
當為手動指定交叉欄目ID時用arclist標簽不能調出相關文章
最后發現是
arclist標簽有問題
要修改的地方是:
include/taglib/arclist.lib.php
第167行

if($ctag->GetAtt('cross')=='1')

改為

if($ctag->GetAtt('cross')!='0')

 

再修改第184行

if($arr['crossid']!='') $selquery = "Select id,topid From `#@__arctype` where id in('{$arr['crossid']}') And id<>'{$typeid}' And topid<>'{$typeid}'  ";

 

改為:

if($arr['crossid']!='') $selquery = "Select id,topid From `#@__arctype` where id in({$arr['crossid']}) And id<>'{$typeid}' And topid<>'{$typeid}'  ";

(這一行只去了一對單引號,應該是程序員手誤多出來了)
就可以了

分析:
從數據庫可以看出
當欄目為不交叉時cross的值為0
當欄目為自動獲取同名欄目時cross的值為1
當欄目為手動指定ID時cross的值為2
顯然

if($ctag->GetAtt('cross')=='1')

 

是錯的,在手動指定ID時$CrossID 始終為空


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM