織夢(dede)arclist標(biāo)簽調(diào)用交叉欄目時調(diào)不出來

字號:


    最近用了交叉欄目,發(fā)現(xiàn)當(dāng)為手動指定交叉欄目ID時用arclist標(biāo)簽不能調(diào)出相關(guān)文章
    最后發(fā)現(xiàn)是
    arclist標(biāo)簽有問題
    要修改的地方是:
    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}' ";
    (這一行只去了一對單引號,應(yīng)該是程序員手誤多出來了)
    就可以了
    分析:
    從數(shù)據(jù)庫可以看出
    當(dāng)欄目為不交叉時cross的值為0
    當(dāng)欄目為自動獲取同名欄目時cross的值為1
    當(dāng)欄目為手動指定ID時cross的值為2
    顯然if($ctag->GetAtt('cross')=='1')是錯的,在手動指定ID時$CrossID始終為空