用织梦建站时,有时候指定栏目文章不需要在某处显示,或者不参与排序和推荐时,只用typeid过滤很麻烦,并且维护起来也很不爽,下面分享给大家怎么解决全站文章列表排除指定栏目的方法。
织梦arclist支持flag和noflag,但是在栏目ID上只支持typeid,所以我们要加一个notypeid。
方法很简单,几步就可以。
第一步:
找到并打开/include/taglib/arclist.lib.php文件,在约129行的位置找到这段代码
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 );
在$isweight后面加上下面的代码
,$ctag->GetAtt('notypeid')
第二步:
在约168行找到这段代码
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')
在$isweight='N'后面加上下面的代码
,$notypeid=0
第三步:
在约323行找到这段代码
$orwheres[] = ' arc.arcrank > -1 ';
在这段代码前面加上下面的代码
if(!empty($notypeid)){ $orwheres[] = " and arc.typeid NOT IN (".GetSonIds($notypeid).")"; }
OK了,保存一下,现在arclist就多了一个notypeid的属性了。
使用Deom:
{dede:arclist row='10' notypeid='28'}