加入收藏 | 设为首页 | 会员中心 | 我要投稿 平顶山站长网 (https://www.0375zz.cn/)- 分布式云、数据处理、媒体处理、图像分析、基础存储!
当前位置: 首页 > 服务器 > 系统 > 正文

织梦DedeCms channelartlist调用排除特定typeid栏目数据

发布时间:2021-11-18 09:53:47 所属栏目:系统 来源:互联网
导读:织梦DedeCms channelartlist调用排除指定typeid栏目数据,找到 includetaglibchannelartlist.lib.php,查找$attlist 将$attlist = typeid|0,row|20,cacheid|; 修改为: $attlist = typeid|0,row|20,cacheid|,notypeid|0; //此处添加了一个所要排除typeid的

织梦DedeCms channelartlist调用排除指定typeid栏目数据,找到 includetaglibchannelartlist.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 `zmb_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的子栏目。

(编辑:平顶山站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读