dedecms织梦artlist标签实现notypeid属性

本文档介绍了如何在DedeCMS中修改`arclist.lib.php`文件,添加`notypeid`参数,以排除指定类型ID的内容,并在模板中正确调用该功能。首先找到并编辑相关函数,添加`notypeid`参数,然后在查询条件中加入判断,排除指定类型。最后展示了一个模板调用的例子,用于显示指定频道ID且不包含特定类型ID的图文列表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

打开/include/taglib/arclist.lib.php文件:
找到

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(&$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).")"; 
}

模板调用:

{dede:arclist row=6 orderby=pubdate type='image.' imgwidth='108' imgheight='150' channelid='1' notypeid='9'}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值