本帖最后由 otherbank 于 2013-6-25 22:25 编辑
有些站长在使用过程中,根据需要屏蔽一个版块或者一部分帖子的相关帖子,这个功能在纵横搜索后台无法设置,可以通过修改几行代码来实现。
找到文件"\source\plugin\cloudsearch\search.class.php"大约72行的函数viewthread_postbottom_output,源代码如下:- public function viewthread_postbottom_output() {
- global $_G;
- if($this->allow && $GLOBALS['page'] == 1 && $_G['forum_firstpid'] && $GLOBALS['postlist'][$_G['forum_firstpid']]['invisible'] == 0) {
- return (array)tpl_cloudsearch_viewthread_postbottom_output();
- }
- }
复制代码 如果需要屏蔽一个版块或者多个版块的帖子显示“相关帖子”,只需这样修改函数:- public function viewthread_postbottom_output() {
- global $_G;
- if($this->allow && $GLOBALS['page'] == 1 && $_G['forum_firstpid'] && $GLOBALS['postlist'][$_G['forum_firstpid']]['invisible'] == 0 ) {
- if(!in_array($_G[tid],array(108,109))){
- return (array)tpl_cloudsearch_viewthread_postbottom_output();
- }
- }
- }
复制代码 其中 “ array(108,109) ” 这个为你要屏蔽的版块的fid的数组
如果你需要屏蔽某一部分帖子的“相关帖子”,只需这样修改函数:- public function viewthread_postbottom_output() {
- global $_G;
- if($this->allow && $GLOBALS['page'] == 1 && $_G['forum_firstpid'] && $GLOBALS['postlist'][$_G['forum_firstpid']]['invisible'] == 0 ) {
- if(!in_array($_G[tid],array(431,109))){
- return (array)tpl_cloudsearch_viewthread_postbottom_output();
- }
- }
- }
复制代码 其中 “ array(108,109) ” 这个为你要屏蔽的帖子的tid的数组
|