mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 23:55:26 +02:00
- it's \r\n not \n\r [Bug #3121]
- a few little search bugfixes - drop in the improved version of the native search based on UTF-8 (still needs some work before it can replace the current native search) Thanks Ashe :) git-svn-id: file:///svn/phpbb/trunk@6175 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
44b78d7c8d
commit
5bf6bc1880
@ -524,6 +524,12 @@ class acp_search
|
|||||||
|
|
||||||
include_once("{$phpbb_root_path}includes/search/$type.$phpEx");
|
include_once("{$phpbb_root_path}includes/search/$type.$phpEx");
|
||||||
|
|
||||||
|
if (!class_exists($type))
|
||||||
|
{
|
||||||
|
$error = $user->lang['NO_SUCH_SEARCH_MODULE'];
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
$search = new $type($error);
|
$search = new $type($error);
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
|
|||||||
$filelist = $filelist_cats = array();
|
$filelist = $filelist_cats = array();
|
||||||
|
|
||||||
// we want newlines no carriage returns!
|
// we want newlines no carriage returns!
|
||||||
$_POST['template_data'] = (isset($_POST['template_data']) && !empty($_POST['template_data'])) ? str_replace(array("\n\r", "\r"), array("\n", "\n"), $_POST['template_data']) : '';
|
$_POST['template_data'] = (isset($_POST['template_data']) && !empty($_POST['template_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['template_data']) : '';
|
||||||
|
|
||||||
$template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data'];
|
$template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data'];
|
||||||
$template_file = request_var('template_file', '');
|
$template_file = request_var('template_file', '');
|
||||||
@ -736,7 +736,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
|
|||||||
'FILENAME' => str_replace('.', '/', $source) . '.html')
|
'FILENAME' => str_replace('.', '/', $source) . '.html')
|
||||||
);
|
);
|
||||||
|
|
||||||
$code = str_replace(array("\n\r", "\r"), array("\n", "\n"), file_get_contents("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"));
|
$code = str_replace(array("\r\n", "\r"), array("\n", "\n"), file_get_contents("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"));
|
||||||
|
|
||||||
$conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string');
|
$conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string');
|
||||||
foreach ($conf as $ini_var)
|
foreach ($conf as $ini_var)
|
||||||
@ -824,7 +824,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
|
|||||||
$this->page_title = 'EDIT_THEME';
|
$this->page_title = 'EDIT_THEME';
|
||||||
|
|
||||||
// we want newlines no carriage returns!
|
// we want newlines no carriage returns!
|
||||||
$_POST['css_data'] = (isset($_POST['css_data']) && !empty($_POST['css_data'])) ? str_replace(array("\n\r", "\r"), array("\n", "\n"), $_POST['css_data']) : '';
|
$_POST['css_data'] = (isset($_POST['css_data']) && !empty($_POST['css_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['css_data']) : '';
|
||||||
|
|
||||||
$template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data'];
|
$template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data'];
|
||||||
|
|
||||||
|
@ -286,7 +286,17 @@ class dbal
|
|||||||
$table_array = array();
|
$table_array = array();
|
||||||
foreach ($array['FROM'] as $table_name => $alias)
|
foreach ($array['FROM'] as $table_name => $alias)
|
||||||
{
|
{
|
||||||
$table_array[] = $table_name . ' ' . $alias;
|
if (is_array($alias))
|
||||||
|
{
|
||||||
|
foreach ($alias as $multi_alias)
|
||||||
|
{
|
||||||
|
$table_array[] = $table_name . ' ' . $multi_alias;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$table_array[] = $table_name . ' ' . $alias;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= $this->_sql_custom_build('FROM', implode(', ', $table_array));
|
$sql .= $this->_sql_custom_build('FROM', implode(', ', $table_array));
|
||||||
|
1576
phpBB/includes/search/fulltext_native_improved.php
Normal file
1576
phpBB/includes/search/fulltext_native_improved.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -48,6 +48,8 @@ $lang = array_merge($lang, array(
|
|||||||
'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.',
|
'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.',
|
||||||
'NO_SEARCH_RESULTS' => 'No suitable matches were found.',
|
'NO_SEARCH_RESULTS' => 'No suitable matches were found.',
|
||||||
'NO_SEARCH_TIME' => 'Sorry but you cannot use search at this time. Please try again in a few minutes.',
|
'NO_SEARCH_TIME' => 'Sorry but you cannot use search at this time. Please try again in a few minutes.',
|
||||||
|
'WORD_IN_NO_POST' => 'No posts were found because the word %s is not contained in any post.',
|
||||||
|
'WORDS_IN_NO_POST' => 'No posts were found because the words %s are not contained in any post.',
|
||||||
|
|
||||||
'POST_CHARACTERS' => 'characters of posts',
|
'POST_CHARACTERS' => 'characters of posts',
|
||||||
|
|
||||||
|
@ -89,14 +89,14 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
|||||||
// Which forums should not be searched?
|
// Which forums should not be searched?
|
||||||
$ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
|
$ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
|
||||||
|
|
||||||
$not_in_fid = (sizeof($ex_fid_ary)) ? 'f.forum_id NOT IN (' . implode(', ', $ex_fid_ary) . ') OR ' : '';
|
$not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE f.forum_id NOT IN (' . implode(', ', $ex_fid_ary) . ") OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : "";
|
||||||
|
|
||||||
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
|
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
|
||||||
FROM ' . FORUMS_TABLE . ' f
|
FROM ' . FORUMS_TABLE . ' f
|
||||||
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
|
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
|
||||||
AND fa.session_id = '" . $db->sql_escape($user->session_id) . "')
|
AND fa.session_id = '" . $db->sql_escape($user->session_id) . "')
|
||||||
WHERE $not_in_fid(f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')
|
$not_in_fid
|
||||||
ORDER BY f.left_id';
|
ORDER BY f.left_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$right_id = 0;
|
$right_id = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user