网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   DedeCMS (https://www.0058.net/forumdisplay.php?f=71)
-   -   织梦DedeCms channelartlist调用排除指定typeid栏目数据 (https://www.0058.net/showthread.php?t=4658)

topvip 2014-03-14 12:16 AM

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

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

修改为:
Code:

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

$dsql->SetQuery("Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath  from `zmb_arctype` where $tpsql order by sortrank asc limit $totalnum");
在其前面添加(注意是在前面添加):

Code:

//否定指定ID

if($notypeid!=0) {

    $tpsql = $tpsql."and not(id in($notypeid)) ";

}

模板调用:
Code:

{dede:channelartlist typeid ='114' notypeid='123,124,122,127'}
其中notypeid='123,124,122,127'中的123,124,122,127为114的子栏目。


All times are GMT +8. The time now is 03:16 AM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.