mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Fix for 'bug' #484650
git-svn-id: file:///svn/phpbb/trunk@1479 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9f26525a76
commit
c45feb1347
2 changed files with 31 additions and 16 deletions
|
@ -671,7 +671,8 @@ $lang['Sort_Author'] = "Author";
|
||||||
$lang['Sort_Forum'] = "Forum";
|
$lang['Sort_Forum'] = "Forum";
|
||||||
|
|
||||||
$lang['Display_results'] = "Display results as";
|
$lang['Display_results'] = "Display results as";
|
||||||
$lang['All'] = "All";
|
$lang['All_available'] = "All available";
|
||||||
|
$lang['No_searchable_forums'] = "You do not have permissions to search any forum on this site";
|
||||||
|
|
||||||
$lang['No_search_match'] = "No topics or posts met your search criteria";
|
$lang['No_search_match'] = "No topics or posts met your search criteria";
|
||||||
$lang['Found_search_match'] = "Search found %d match"; // eg. Search found 1 match
|
$lang['Found_search_match'] = "Search found %d match"; // eg. Search found 1 match
|
||||||
|
|
|
@ -34,10 +34,19 @@ function clean_words_search($entry)
|
||||||
$char_match = array("^", "$", "&", "(", ")", "<", ">", "`", "'", "|", ",", "@", "_", "?", "%", "~", ".", "[", "]", "{", "}", ":", "\\", "/", "=", "#", "\"", ";", "!");
|
$char_match = array("^", "$", "&", "(", ")", "<", ">", "`", "'", "|", ",", "@", "_", "?", "%", "~", ".", "[", "]", "{", "}", ":", "\\", "/", "=", "#", "\"", ";", "!");
|
||||||
$char_replace = array(" ", " ", " ", " ", " ", " ", " ", " ", "", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ");
|
$char_replace = array(" ", " ", " ", " ", " ", " ", " ", " ", "", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ");
|
||||||
|
|
||||||
|
$sgml_match = array(" ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ");
|
||||||
|
$sgml_replace = array(" ", "s", "a", "a", "a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", "o", "n", "o", "o", "o", "o", "o", "o", "u", "u", "u", "u", "y", "t", "y");
|
||||||
|
|
||||||
|
$accent_match = array("ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ");
|
||||||
|
$accent_replace = array("s", "a", "a", "a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", "o", "n", "o", "o", "o", "o", "o", "o", "u", "u", "u", "u", "y", "t", "y");
|
||||||
|
|
||||||
$entry = " " . strip_tags(strtolower($entry)) . " ";
|
$entry = " " . strip_tags(strtolower($entry)) . " ";
|
||||||
|
|
||||||
$entry = str_replace("+", " and ", $entry);
|
$entry = str_replace("+", " and ", $entry);
|
||||||
$entry = str_replace("-", " not ", $entry);
|
$entry = str_replace("-", " not ", $entry);
|
||||||
|
|
||||||
|
$entry = str_replace($sgml_match, $sgml_match, $entry);
|
||||||
|
$entry = str_replace($accent_match, $accent_replace, $entry);
|
||||||
$entry = str_replace($char_match, $char_replace, $entry);
|
$entry = str_replace($char_match, $char_replace, $entry);
|
||||||
|
|
||||||
$entry = preg_replace("/\b[0-9]+\b/", " ", $entry);
|
$entry = preg_replace("/\b[0-9]+\b/", " ", $entry);
|
||||||
|
@ -315,8 +324,7 @@ else if( $query_keywords != "" || $query_author != "" || $search_id )
|
||||||
$sql = "SELECT m.post_id
|
$sql = "SELECT m.post_id
|
||||||
FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
|
FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
|
||||||
WHERE w.word_text LIKE '$match_word'
|
WHERE w.word_text LIKE '$match_word'
|
||||||
AND m.word_id = w.word_id
|
AND m.word_id = w.word_id";
|
||||||
ORDER BY m.post_id";
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
if( !$result )
|
if( !$result )
|
||||||
{
|
{
|
||||||
|
@ -530,8 +538,6 @@ else if( $query_keywords != "" || $query_author != "" || $search_id )
|
||||||
|
|
||||||
$searchset = $db->sql_fetchrowset($result);
|
$searchset = $db->sql_fetchrowset($result);
|
||||||
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Clean up search results table
|
// Clean up search results table
|
||||||
//
|
//
|
||||||
|
@ -1079,33 +1085,41 @@ if(!$result)
|
||||||
|
|
||||||
$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
|
$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
|
||||||
|
|
||||||
$s_forums = "<option value=\"all\">" . $lang['All'] . "</option>";
|
$s_forums = "";
|
||||||
|
|
||||||
while($row = $db->sql_fetchrow($result))
|
while($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
if($is_auth_ary[$row['forum_id']]['auth_read'])
|
if( $is_auth_ary[$row['forum_id']]['auth_read'] )
|
||||||
{
|
{
|
||||||
$s_forums .= "<option value=\"" . $row['forum_id'] . "\">" . $row['forum_name'] . "</option>";
|
$s_forums .= "<option value=\"" . $row['forum_id'] . "\">" . $row['forum_name'] . "</option>";
|
||||||
if(empty($list_cat[$row['cat_id']]))
|
if( empty($list_cat[$row['cat_id']]) )
|
||||||
{
|
{
|
||||||
$list_cat[$row['cat_id']] = $row['cat_title'];
|
$list_cat[$row['cat_id']] = $row['cat_title'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
if( $s_forums != "" )
|
||||||
// Category to search
|
|
||||||
//
|
|
||||||
$s_categories = "<option value=\"all\">" . $lang['All'] . "</option>";
|
|
||||||
while( list($cat_id, $cat_title) = each($list_cat))
|
|
||||||
{
|
{
|
||||||
$s_categories .= "<option value=\"$cat_id\">$cat_title</option>";
|
$s_forums = "<option value=\"all\">" . $lang['All_available'] . "</option>" . $s_forums;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Category to search
|
||||||
|
//
|
||||||
|
$s_categories = "<option value=\"all\">" . $lang['All_available'] . "</option>";
|
||||||
|
while( list($cat_id, $cat_title) = @each($list_cat))
|
||||||
|
{
|
||||||
|
$s_categories .= "<option value=\"$cat_id\">$cat_title</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message_die(GENERAL_MESSAGE, $lang['No_searchable_forums']);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Number of chars returned
|
// Number of chars returned
|
||||||
//
|
//
|
||||||
$s_characters = "<option value=\"all\">" . $lang['All'] . "</option>";
|
$s_characters = "<option value=\"all\">" . $lang['All_available'] . "</option>";
|
||||||
$s_characters .= "<option value=\"0\">0</option>";
|
$s_characters .= "<option value=\"0\">0</option>";
|
||||||
$s_characters .= "<option value=\"25\">25</option>";
|
$s_characters .= "<option value=\"25\">25</option>";
|
||||||
$s_characters .= "<option value=\"50\">50</option>";
|
$s_characters .= "<option value=\"50\">50</option>";
|
||||||
|
|
Loading…
Add table
Reference in a new issue