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

字號:


    最近用了交叉欄目,發(fā)現(xiàn)當為手動指定交叉欄目ID時用arclist標簽不能調出相關文章
    最后發(fā)現(xiàn)是
    arclist標簽有問題
    要修改的地方是:
    include/taglib/arclist.lib.php
    找到如下:
    if($ctag->GetAtt('cross')=='1')
    改為
    if($ctag->GetAtt('cross')!='0')
    再找:
    if($arr['crossid']!='') $selquery = "Select id,topid ` where id in('{$arr['crossid']}') Andid<>'{$typeid}' Andtopid<>'{$typeid}' ";
    改為:
    if($arr['crossid']!='') $selquery = "Select id,topid ` where id in({$arr['crossid']}) Andid<>'{$typeid}' Andtopid<>'{$typeid}' ";
    (這一行只去了一對單引號,應該是程序員手誤多出來了)
    就可以了
    分析:
    從數(shù)據(jù)庫可以看出
    當欄目為不交叉時cross的值為0
    當欄目為自動獲取同名欄目時cross的值為1
    當欄目為手動指定ID時cross的值為2
    顯然if($ctag->GetAtt('cross')=='1')是錯的,在手動指定ID時$CrossID始終為空