織夢(dede)arclist標籤調用交叉欄目時調不出來

最近用了交叉欄目,發現當爲手動指定交叉欄目ID時用arclist標籤不能調出相關文章
最後發現是
arclist標籤有問題
要修改的地方是:
include/taglib/arclist.lib.php
找到如下:
if($ctag->GetAtt('cross')=='1')
改爲
if($ctag->GetAtt('cross')!='0')
在找:
if($arr['crossid']!='') $selquery = "Select id,topid From`#@__arctype` where id in('{$arr['crossid']}') Andid<>'{$typeid}' Andtopid<>'{$typeid}' ";
改爲:
if($arr['crossid']!='') $selquery = "Select id,topid From`#@__arctype` where id in({$arr['crossid']}) Andid<>'{$typeid}' Andtopid<>'{$typeid}' ";
(這一行只去了一對單引號,應該是程序員手誤多出來了)
就可以了

分析:
從數據庫可以看出
當欄目爲不交叉時cross的值爲0
當欄目爲自動獲取同名欄目時cross的值爲1
當欄目爲手動指定ID時cross的值爲2
顯然if($ctag->GetAtt('cross')=='1')是錯的,在手動指定ID時$CrossID始終爲空
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章