修改dede源码,让dede:channelartlist排除指定typeid
找到 includetaglibchannelartlist.lib.php,? 查找?$attlist
将?
查找: ? 在其前面添加(注意是在前面添加):
//否定指定ID
修改后的channelartlist.lib.php
?
if (!defined( 'DEDEINC' )) exit ( 'Request Error!' );
require_once (DEDEINC. '/arc.partview.class.php' );
?
function lib_channelartlist(& $ctag ,& $refObj )
{
???? global $dsql $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; background: none !important;">$attlist );
extract(
$innertext = trim( ->GetInnerText());
$artlist
'' ;
//读取固定的缓存块
$cacheid
$cacheid );
(
!= ) {
????????
= GetCacheBlock( );
????????
$artlist ) return ;
}
????
(
empty $typeid ))
{
$typeid
= ( ! ->TypeLink->TypeInfos[ 'id' ]) ?? ] : 0 );
}
????
$innertext
== ) = GetSysTemplets( 'part_channelartlist.htm' );
$totalnum
= $row ;
$totalnum
)) = 20;
?
//获得类别ID总数的信息
$typeids
= array ();
==0 ||
'top' ) {
$tpsql
" reid=0 And ispart<>2 And ishidden<>1 And channeltype>0 " ;
}
else
{
(!
ereg ',' )) {
????????????
" reid='$typeid' And ispart<>2 And ishidden<>1 " ;
????????
}
else
{
" id in($typeid) And ispart<>2 And ishidden<>1 "
;
}
}
????
//否定指定ID
$notypeid
!=0) {
$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(
'string' );
.=
->GetResult();
] = (
]==1 ? 2 : 1);
}
//注销环境变量,以防止后续调用中被使用
'envs'
'typeid' ] = ];
'reid'
] = ;
) {
WriteCacheBlock(
);
}
;
}
?>
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |