zblogPHP 首页过滤指定分类文章并重建分页
//首页过滤指定分类文章并重建分页;
//挂接口:Add_Filter_Plugin('Filter_Plugin_ViewList_Core', 'zbpPlus_Exclude_Category');
function zbpPlus_Exclude_Category(&$type,&$page,&$category,&$author,&$datetime,&$tag,&$w,&$pagebar){
global $zbp;
if ($type == 'index' && $filter = '3|5|6') {
//$w[]=array('<>','log_CateID',27);
$w[] = array('NOT IN', 'log_CateID', explode('|',$filter));
//以下是为了重建分页,过滤了分类,数量会发生变化
$pagebar = new Pagebar($zbp->option['ZC_INDEX_REGEX'], true, true);
$pagebar->PageCount = $zbp->displaycount;
$pagebar->PageNow = $page;
$pagebar->PageBarCount = $zbp->pagebarcount;
//$pagebar->Count = null;
}
}
本文创建于:2021年05月29日,最后更新于:2022年02月01日,已超过 114 天没更新!内容可能已失效,请自行测试,失效请评论区反馈,谢谢啦~
THE END