zblogPHP 首页过滤指定分类文章并重建分页
- 知识探索
- 2022-02-01
- 5544
简介//首页过滤指定分类文章并重建分页;//挂接口:Add_Filter_Plugin('Filter_Plugin_Vie...
//首页过滤指定分类文章并重建分页;
//挂接口: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;
}
}
发表评论