最新下载
热门教程
- 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 的子栏目即生效。
相关文章
- 《职场浮生记》卡牌模组推荐 06-15
- 《纸嫁衣4红丝缠》全章节图文攻略 06-15
- 《这城有良田》奖率三军课业加点攻略 06-15
- 《纸嫁衣2奘铃村》全章节攻略汇总 06-15
- 《王者荣耀》夺宝保底次数介绍 06-15
- 《向僵尸开炮》百分比宝石选择推荐 06-15