最新下载
热门教程
- 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 的子栏目即生效。
相关文章
- 蓝色星原旅谣二测时间是什么时候 05-04
- 绝区零2.5版本菲林有多少 05-04
- 棱镜2033高难度副本通关攻略 棱镜2033团队副本全流程打法与BOSS机制详解 05-04
- 阴阳师残局得胜引酩酊怎么打一览 05-04
- 王者荣姜子牙弘道录皮肤价格一览 05-04
- 绝区零2.8前瞻兑换码汇总详情 05-04