channelartlist

织梦DedeCms调用channelartlist排除指定typeid栏目数据的方法

织梦DedeCms调用channelartlist排除指定typeid栏目数据的方法

温馨提示:DedeCMS用户请及时前往织梦官网处理官方版权事宜。
织梦DedeCms调用channelartlist排除指定typeid栏目数据的方法

织梦DedeCms channelartlist调用排除指定typeid栏目数据,找到 \include\taglib\channelartlist.lib.php,查找$attlist

$attlist = 'typeid|0,row|20,cacheid|';

修改为:

$attlist = 'typeid|0,row|20,cacheid|,notypeid|0';  //此处添加了一个所要排除typeid的参数---notypeid

查找:

$dsql->SetQuery("Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath   from `dede_arctype` where $tpsql order by sortrank asc limit $totalnum");

在其前面添加(注意是在前面添加):

//否定指定ID
if($notypeid!=0) {
     $tpsql = $tpsql."and not(id in($notypeid)) ";
}

模板调用:

{dede:channelartlist typeid ='114' notypeid='123,124,122,127'}

其中notypeid='123,124,122,127'中的123,124,122,127为114的子栏目。

本文属原创,转载请注明原文:http://www.zhimatong.com/jiaocheng/202.html

为保证教程的实用性及扩大知识面覆盖,如果您有相似问题而未解决,可联系在线客服免费技术支持。

内容有用

联系
顾问

在线
客服
购物车
账号登录

没有账号?立即注册

忘记密码

登录即同意用户协议没有账号? 立即注册
账号注册
我已阅读并同意用户协议
立即注册
注册即同意用户协议已有账号? 立即登录
找回密码

操作步骤:邮箱验证->设置新密码

注册即同意用户协议已有账号? 立即登录