本文主要是介绍phpcms后台修复“快速进入”快速搜索栏目名称时显示无权限栏目并可点击进入发布文章的BUG,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
文件位置:phpcms\modules\admin\category.php
修改public_ajax_search方法:
/*** 快速进入搜索*/public function public_ajax_search() {if($_GET['catname']) {if(preg_match('/([a-z]+)/i',$_GET['catname'])) {$field = 'letter';$catname = strtolower(trim($_GET['catname']));} else {$field = 'catname';$catname = trim($_GET['catname']);if (CHARSET == 'gbk') $catname = iconv('utf-8','gbk',$catname);}//WY UPDATE AT 2024-06-06 修复“快速进入”功能显示无权限栏目并进入发布文章的BUG
$category_priv_db = pc_base::load_model('category_priv_model');
$priv_result = $category_priv_db->select(array('action'=>'init','roleid'=>$_SESSION['roleid'],'siteid'=>$this->siteid,'is_admin'=>1));
$priv_catids = array();
foreach($priv_result as $_v) {$priv_catids[] = $_v['catid'];
}
if(empty($priv_catids)){$result = array();
}else{$catids = implode(",",$priv_catids);$result = $this->db->select("$field LIKE('$catname%') AND siteid='$this->siteid' AND child=0 AND catid in ($catids)",'catid,type,catname,letter',10);
}//$result = $this->db->select("$field LIKE('$catname%') AND siteid='$this->siteid' AND child=0",'catid,type,catname,letter',10);if (CHARSET == 'gbk') {$result = array_iconv($result, 'gbk', 'utf-8');}echo json_encode($result);}}
这篇关于phpcms后台修复“快速进入”快速搜索栏目名称时显示无权限栏目并可点击进入发布文章的BUG的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!