织梦article标签增加notypeid属性,实现多栏目调用时排除不需要的栏目

怎么修改使织梦article标签增加notypeid属性,实现在多栏目调用的时候排除不需要的栏目。

打开/include/taglib/文件,找这段代码(大概在130行):
1

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 );

在最后括号最后加上(注意前面的逗号):
1

,$ctag->GetAtt('notypeid')

然后再找到这一段代码(大概在168行):
1

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)

在括号的最后加上(注意前面的逗号):
1

,$notypeid=0

最后再找到这一句:
1

$orwheres[] = ' arc.arcrank > -1 ';

在其前面增加以下代码:
1
2
3

if(!empty($notypeid)) {
$orwheres[] = " and arc.typeid NOT IN (".GetSonIds($notypeid).")";
}

这样,代码就修改完毕了。保存之后就在arclist标签里试试看notypeid属性吧。对于网站栏目多,内容显示时又错综复杂的情况,这样的属性还是蛮实用的。

THE END