1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 15:16:16 +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:
Nils Adermann 2006-07-12 23:21:57 +00:00
parent 44b78d7c8d
commit 5bf6bc1880
6 changed files with 1601 additions and 7 deletions

View File

@ -524,6 +524,12 @@ class acp_search
include_once("{$phpbb_root_path}includes/search/$type.$phpEx");
if (!class_exists($type))
{
$error = $user->lang['NO_SUCH_SEARCH_MODULE'];
return $error;
}
$error = false;
$search = new $type($error);

View File

@ -491,7 +491,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$filelist = $filelist_cats = array();
// 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_file = request_var('template_file', '');
@ -736,7 +736,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'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');
foreach ($conf as $ini_var)
@ -824,7 +824,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$this->page_title = 'EDIT_THEME';
// 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'];

View File

@ -286,7 +286,17 @@ class dbal
$table_array = array();
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));

File diff suppressed because it is too large Load Diff

View File

@ -48,6 +48,8 @@ $lang = array_merge($lang, array(
'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.',
'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.',
'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',

View File

@ -89,14 +89,14 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// 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))));
$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
FROM ' . FORUMS_TABLE . ' f
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_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'] . ')
ORDER BY f.left_id';
$not_in_fid
ORDER BY f.left_id";
$result = $db->sql_query($sql);
$right_id = 0;