最近用了交叉欄目
發現
當為手動指定交叉欄目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 始終為空