|
From: Paul S. O. <ps...@us...> - 2001-11-29 13:05:06
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv18568
Modified Files:
search.php
Log Message:
Fix for 'bug' #484650
Index: search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/search.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** search.php 2001/11/24 17:17:04 1.39
--- search.php 2001/11/29 13:05:03 1.40
***************
*** 35,42 ****
--- 35,51 ----
$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 = str_replace("+", " and ", $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);
***************
*** 316,321 ****
FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
WHERE w.word_text LIKE '$match_word'
! AND m.word_id = w.word_id
! ORDER BY m.post_id";
$result = $db->sql_query($sql);
if( !$result )
--- 325,329 ----
FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
WHERE w.word_text LIKE '$match_word'
! AND m.word_id = w.word_id";
$result = $db->sql_query($sql);
if( !$result )
***************
*** 531,536 ****
$searchset = $db->sql_fetchrowset($result);
- $db->sql_freeresult($result);
-
//
// Clean up search results table
--- 539,542 ----
***************
*** 1079,1091 ****
$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
-
- $s_forums = "<option value=\"all\">" . $lang['All'] . "</option>";
while($row = $db->sql_fetchrow($result))
{
! if($is_auth_ary[$row['forum_id']]['auth_read'])
{
$s_forums .= "<option value=\"" . $row['forum_id'] . "\">" . $row['forum_name'] . "</option>";
! if(empty($list_cat[$row['cat_id']]))
{
$list_cat[$row['cat_id']] = $row['cat_title'];
--- 1085,1096 ----
$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
+ $s_forums = "";
while($row = $db->sql_fetchrow($result))
{
! if( $is_auth_ary[$row['forum_id']]['auth_read'] )
{
$s_forums .= "<option value=\"" . $row['forum_id'] . "\">" . $row['forum_name'] . "</option>";
! if( empty($list_cat[$row['cat_id']]) )
{
$list_cat[$row['cat_id']] = $row['cat_title'];
***************
*** 1094,1104 ****
}
! //
! // 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>";
}
--- 1099,1118 ----
}
! if( $s_forums != "" )
! {
! $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']);
}
***************
*** 1106,1110 ****
// Number of chars returned
//
! $s_characters = "<option value=\"all\">" . $lang['All'] . "</option>";
$s_characters .= "<option value=\"0\">0</option>";
$s_characters .= "<option value=\"25\">25</option>";
--- 1120,1124 ----
// Number of chars returned
//
! $s_characters = "<option value=\"all\">" . $lang['All_available'] . "</option>";
$s_characters .= "<option value=\"0\">0</option>";
$s_characters .= "<option value=\"25\">25</option>";
|