校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 網站建設 > 建站知識 > 讓織夢arclist支持notypeid屬性的方法

讓織夢arclist支持notypeid屬性的方法

POST TIME:2017-11-13 00:02

織夢默認的arclist標簽支持typeid的調用,也就是給文章列表指定來源欄目,有時候欄目過多,一個一個寫就很復雜,所以用排除的方法寫更方便,以此引入notypeid屬性。

主要修改文件是/include/taglib/下的arclist.lib.php文件,首先搜索:

return lib_arclistDone

在函數末尾加上:,$ctag->GetAtt('notypeid'),原來的代碼變成如下的樣子:

return lib_arclistDone

(

$refObj, $ctag, $typeid, $ctag->GetAtt('row'), $ctag->GetAtt('col'), $titlelen, $infolen,

$ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), $listtype, $orderby,

$ctag->GetAtt('keyword'), $innertext, $envs['aid'], $ctag->GetAtt('idlist'), $channelid,

$ctag->GetAtt('limit'), $flag,$ctag->GetAtt('orderway'), $ctag->GetAtt('subday'), $ctag->GetAtt('noflag'),

$tagid,$pagesize,$isweight,

$ctag->GetAtt('notypeid')

);

然后再搜索function lib_arclistDone,同樣在這個函數的后面加上一句代碼:,$notypeid=0,修改后的函數變成下面的樣子:

function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160,

$imgwidth=120, $imgheight=90, $listtype='all', $orderby='default', $keyword='',

$innertext='', $arcid=0, $idlist='', $channelid=0, $limit='', $att='', $order='desc', $subday=0, $noflag='',$tagid='', $pagesize=0, $isweight='N',$notypeid=0)

最后,搜索以下代碼:$orwheres[] = ' arc.arcrank > -1 ';,在這個代碼的前面加入如下代碼:

if(!empty($notypeid))

{

$orwheres[] = " and arc.typeid NOT IN (".GetSonIds($notypeid).")";

}

上傳覆蓋之后即可使用arclist的notypeid屬性,使用方法如下:

{dede:arclist row=6 orderby=pubdate notypeid='7,8,9'}

意思是按更新時間,調用除了欄目id是7,8,9的其余欄目中的6條數據。



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 伊川县| 察哈| 和田市| 喀喇沁旗| 黑龙江省| 贵阳市| 蒲城县| 广饶县| 武宣县| 湘乡市| 灵寿县| 连平县| 陈巴尔虎旗| 卢氏县| 靖江市| 牡丹江市| 秭归县| 定陶县| 淳化县| 赤水市| 滨州市| 伊春市| 临沧市| 石门县| 怀仁县| 南雄市| 灌云县| 克什克腾旗| 泸溪县| 长宁区| 桦川县| 罗城| 洞口县| 聊城市| 会同县| 华蓥市| 陇南市| 卫辉市| 务川| 西乌珠穆沁旗| 大宁县|