mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
- Lesson learned: If you rename something rename it in all places and not just in a few :)
(min_search_chars/max_search_chars/load_search_upd now prefixed with fulltext_phpbb) - search_indexing_state should not be dynamic - a topic link should link to a topic ;-) git-svn-id: file:///svn/phpbb/trunk@5652 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
d9c48b494c
commit
9f7bc93125
6 changed files with 18 additions and 8 deletions
|
@ -467,7 +467,7 @@ class acp_search
|
||||||
|
|
||||||
ksort($this->state);
|
ksort($this->state);
|
||||||
|
|
||||||
set_config('search_indexing_state', implode(',', $this->state), true);
|
set_config('search_indexing_state', implode(',', $this->state));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -281,7 +281,7 @@ class mcp_reports
|
||||||
|
|
||||||
$template->assign_block_vars('postrow', array(
|
$template->assign_block_vars('postrow', array(
|
||||||
'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'],
|
'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'],
|
||||||
'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id'],
|
'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&t=' . $row['topic_id'],
|
||||||
'U_VIEW_DETAILS' => "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&start=$start&mode=report_details&f={$forum_id}&p={$row['post_id']}",
|
'U_VIEW_DETAILS' => "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&start=$start&mode=report_details&f={$forum_id}&p={$row['post_id']}",
|
||||||
'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '',
|
'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '',
|
||||||
'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['reporter_id']}" : '',
|
'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['reporter_id']}" : '',
|
||||||
|
|
|
@ -21,9 +21,14 @@ include_once($phpbb_root_path . 'includes/search/search.' . $phpEx);
|
||||||
class fulltext_mysql extends search_backend
|
class fulltext_mysql extends search_backend
|
||||||
{
|
{
|
||||||
var $stats;
|
var $stats;
|
||||||
|
var $word_length;
|
||||||
|
|
||||||
function fulltext_mysql(&$error)
|
function fulltext_mysql(&$error)
|
||||||
{
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']);
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,14 @@ include_once($phpbb_root_path . 'includes/search/search.' . $phpEx);
|
||||||
class fulltext_phpbb extends search_backend
|
class fulltext_phpbb extends search_backend
|
||||||
{
|
{
|
||||||
var $stats;
|
var $stats;
|
||||||
|
var $word_length;
|
||||||
|
|
||||||
function fulltext_phpbb(&$error)
|
function fulltext_phpbb(&$error)
|
||||||
{
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$this->word_length = array('min' => $config['fulltext_phpbb_min_search_chars'], 'max' => $config['fulltext_phpbb_max_search_chars']);
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +94,7 @@ class fulltext_phpbb extends search_backend
|
||||||
|
|
||||||
// check word length
|
// check word length
|
||||||
$clean_len = strlen(str_replace('*', '', $word));
|
$clean_len = strlen(str_replace('*', '', $word));
|
||||||
if (($clean_len < $config['min_search_chars']) || ($clean_len > $config['max_search_chars']))
|
if (($clean_len < $config['fulltext_phpbb_min_search_chars']) || ($clean_len > $config['fulltext_phpbb_max_search_chars']))
|
||||||
{
|
{
|
||||||
if ($prefixed)
|
if ($prefixed)
|
||||||
{
|
{
|
||||||
|
@ -194,7 +199,7 @@ class fulltext_phpbb extends search_backend
|
||||||
for ($i = 0, $n = sizeof($text); $i < $n; $i++)
|
for ($i = 0, $n = sizeof($text); $i < $n; $i++)
|
||||||
{
|
{
|
||||||
$text[$i] = trim($text[$i]);
|
$text[$i] = trim($text[$i]);
|
||||||
if (strlen($text[$i]) < $config['min_search_chars'] || strlen($text[$i]) > $config['max_search_chars'])
|
if (strlen($text[$i]) < $config['fulltext_phpbb_min_search_chars'] || strlen($text[$i]) > $config['fulltext_phpbb_max_search_chars'])
|
||||||
{
|
{
|
||||||
unset($text[$i]);
|
unset($text[$i]);
|
||||||
}
|
}
|
||||||
|
@ -712,7 +717,7 @@ class fulltext_phpbb extends search_backend
|
||||||
|
|
||||||
// Is the fulltext indexer disabled? If yes then we need not
|
// Is the fulltext indexer disabled? If yes then we need not
|
||||||
// carry on ... it's okay ... I know when I'm not wanted boo hoo
|
// carry on ... it's okay ... I know when I'm not wanted boo hoo
|
||||||
if (!$config['load_search_upd'])
|
if (!$config['fulltext_phpbb_load_search_upd'])
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -882,7 +887,7 @@ class fulltext_phpbb extends search_backend
|
||||||
|
|
||||||
// Is the fulltext indexer disabled? If yes then we need not
|
// Is the fulltext indexer disabled? If yes then we need not
|
||||||
// carry on ... it's okay ... I know when I'm not wanted boo hoo
|
// carry on ... it's okay ... I know when I'm not wanted boo hoo
|
||||||
if (!$config['load_search_upd'])
|
if (!$config['fulltext_phpbb_load_search_upd'])
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,6 +166,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('save_passwd', '3');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('save_passwd', '3');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size', '250');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size', '250');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200');
|
||||||
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_indexing_state', '');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', 'fulltext_phpbb');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', 'fulltext_phpbb');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800');
|
||||||
|
@ -206,7 +207,6 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_to
|
||||||
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_users', '1', 1);
|
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_users', '1', 1);
|
||||||
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1);
|
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1);
|
||||||
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1);
|
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1);
|
||||||
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_indexing_state', '', 1);
|
|
||||||
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_last_gc', '0', 1);
|
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_last_gc', '0', 1);
|
||||||
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('session_last_gc', '0', 1);
|
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('session_last_gc', '0', 1);
|
||||||
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('upload_dir_size', '0', 1);
|
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('upload_dir_size', '0', 1);
|
||||||
|
|
|
@ -223,7 +223,7 @@ if ($keywords || $author || $search_id)
|
||||||
$search->split_keywords($keywords, $search_terms);
|
$search->split_keywords($keywords, $search_terms);
|
||||||
if (!sizeof($search->split_words) && !sizeof($author_id_ary) && !$search_id)
|
if (!sizeof($search->split_words) && !sizeof($author_id_ary) && !$search_id)
|
||||||
{
|
{
|
||||||
trigger_error(sprintf($user->lang['NO_KEYWORDS'], $config['min_search_chars'], $config['max_search_chars']));
|
trigger_error(sprintf($user->lang['NO_KEYWORDS'], $search->word_length['min'], $search->word_length['max']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue