您的位置:老铁SEO > 站长新闻 > 网站技术 >

怎么做伪原创文稿 怎样让织梦DEDECMS的dede:channelartlist语句解除指定typeid

文章来源:http://www.6cu.com

作者:文章伪原创软件

人气:17

2021-05-13 21:10:06

建造dedecms/jiaocheng/2896.html">织梦的模板时,在行使 dede:channelartlist 自动挪用栏目内容时,常常会碰着某些栏目不必要挪用,好比“关于我们”、“接洽地点”等无一连更新的栏目。要想在dede:channelartlist挪用时倾轧某些栏目,这必要修改dede源码,让dede:channelartlist解除指定typeid。

起首找到 \include\taglib\channelartlist.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 `idea_arctype` where $tpsql order by sortrank asc limit $totalnum");

在其前面添加(留意是在前面添加):


//否认指定ID
if($notypeid!=0) {
     $tpsql = $tpsql."and not(id in($notypeid)) ";
}

生涯文件后,再模板挪用时:

{dede:channelartlist typeid ='1' notypeid='2,3,4,5'}

个中notypeid=’2,3,4,5′ 中的 2,3,4,5 为 1 的子栏目即见效。

     
相关文章

在线客服

外链咨询

扫码加我微信

微信:juxia_com

返回顶部