Dedecms   发布时间:2022-05-06  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了修改dede源码,让dede:channelartlist排除指定typeid大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

找到 \include\taglib\chAnnelartlist.lib.php, 查找$attlist 将 $attlist = typEID|0,row|20,cachEID|; 修改为: $attlist = typEID|0,row|20,cachEID|,notypEID|0; [此处添加了一个所要排除typEID的参数---notypEID] 查找: $dsql-SetQuery(SELEct id,typen

找到 \include\taglib\chAnnelartlist.lib.PHP,  查找 $attlist

将 
$attlist = 'typEID|0,row|20,cachEID|';
修改为:
$attlist = 'typEID|0,cachEID|,notypeid|0';   [此处添加一个所要排除typEID的参数---notypeid]

查找:  
$dsql->SetQuery("SELEct id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath   from `dede_arctype` where $tpsql order by sortrank asc limit $@R_767_10586@lnum");

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

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

模板调用:
{dede:chAnnelartlist typEID ='114' notypeid='123,124,125,126,127,128'}
其中notypeid='123,128' 中的 123,128 为114的子栏目
 

修改后的chAnnelartlist.lib.PHP
 

<>PHP
 
if(!defined('DEDEINC')) @H_772_61@exit('request Error!');
require_once(DEDEINC.'/arc.partview.class.PHP');
 
function lib_chAnnelartlist(&$ctag,&$refObj)
{
    global $dsqlPHP plain" style="font-family: Consolas,$envs$_sys_globals;
 
    //处理标记属性、innertext
    $attlist = 'typEID|0,notypeid|0';
    FillAttsDefault(->CAttribute->Items,0) !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; Box-sizing: content-Box !important; font-size: 1em !important; @R_197_11442@kground: none !important;">$attlist);
extract(PHP variable" style="font-family: Consolas,EXTR_SKIP);
$innertext = trim(->GetInnerText());
$artlist '';
//读取固定的缓存块
$cacheid $cacheid);
(!=) {
        = GetCacheBlock();
        $artlist) return ;
}
    
(empty$typeid))
{
$typeid = ( !->TypeLink->TypeInfos['id']) ?  ] : 0 );
}
    
$innertext==) = GetSystemplets('part_chAnnelartlist.htm');
$@R_767_10586@lnum = $row;
$@R_767_10586@lnum)) = 20;
 
//获得类别ID总数的信息
$typEIDs = array();
==0 || 'top') {
$tpsql " rEID=0 And ispart<>2 and=""><>1 and="" channeltype>0="">;
}
@H_197_178@else
{
(!ereg',')) {
            " rEID='$typEID' And ispart<>2 and=""><>1>;
else {
" id in($typEID) And ispart<>2 and=""><>1>;
}
}
    
//否定指定ID
$tpsql."and not(id in($notypeid)) ";
}
    
->SetQuery("SELEct id,sitepath
                                            from `dede_arctype` where order by sortrank asc limit ");
->Execute();
while$row ->GetArray()) {
$typEIDs[] = ;
}
 
(!isset([0])) return ;
 
$GLOBALS['itemindex'] = 0;
'itemparity'] = 1;
for$i=0;isset([]);++)
{
]++;
$pv new PartView(][]);
$pv->Fields['typeurl'] = GetOneTypeUrlA(]);
->SetTemplet(php variable" style="font-family: Consolas,'String');
.= ->GetResult();
] = (]==1 ? 2 : 1);
}
//注销环境变量,以防止后续调用中被使用
'envs''typEID'] = ];
'rEID'] = ;
) {
WriteCacheBlock();
}
;
}
?>
?
 

大佬总结

以上是大佬教程为你收集整理的修改dede源码,让dede:channelartlist排除指定typeid全部内容,希望文章能够帮你解决修改dede源码,让dede:channelartlist排除指定typeid所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。