最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
织梦DEDECMS的dede:channelartlist语句排除指定typeid(可行)
时间:2022-06-25 19:23:36 编辑:袖梨 来源:一聚教程网
首先找到 includetaglibchannelartlist.lib.php,出于安全考虑先备份这个文件。打开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 `#@__arctype` where $tpsql order by sortrank asc limit $totalnum");
在其前面添加(注意是在前面添加):
//否定指定ID if($notypeid!=0) { $tpsql = $tpsql."and not(id in($notypeid)) "; }
保存文件后,再模板调用时:
{dede:channelartlist typeid ='7' notypeid='8'}
其中notypeid=’8′ 中的 8 为 7 的子栏目即生效。
相关文章
- 空洞骑士丝之歌织光仪怎么获得 织光仪获取攻略 09-19
- 无限暖暖技巧之外琴弦之上任务怎么做 技巧之外琴弦之上任务流程攻略 09-19
- 大侠立志传不老泉怎么触发-不老泉触发方法 09-19
- 无限暖暖音乐季任务暖意于风中传递怎么做 音乐季任务暖意于风中传递攻略 09-19
- 无限暖暖神秘作者任务怎么做 神秘作者任务流程攻略 09-18
- 如鸢董奉怎么玩 董奉玩法攻略 09-18