Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: functions_search.php 4554 2009-11-29 00:23:57Z RyanGordon $
| * $Id: functions_search.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
/**
| */
/**
|
Zeile 238 | Zeile 238 |
---|
$keywords = preg_replace("#\s+#s", " ", $keywords);
// Search for "and" or "or" and remove if it's at the beginning
|
$keywords = preg_replace("#\s+#s", " ", $keywords);
// Search for "and" or "or" and remove if it's at the beginning
|
| $keywords = trim($keywords);
|
if(my_strpos($keywords, "or") !== false && my_strpos($keywords, "or") == 0) { $keywords = substr_replace($keywords, "", 0, 2);
| if(my_strpos($keywords, "or") !== false && my_strpos($keywords, "or") == 0) { $keywords = substr_replace($keywords, "", 0, 2);
|
Zeile 247 | Zeile 248 |
---|
$keywords = substr_replace($keywords, "", 0, 3); }
|
$keywords = substr_replace($keywords, "", 0, 3); }
|
return trim($keywords);
| return $keywords;
|
}
/**
| }
/**
|
Zeile 271 | Zeile 272 |
---|
$words = array(); if(my_strpos($keywords, "\"") !== false)
|
$words = array(); if(my_strpos($keywords, "\"") !== false)
|
{
| {
|
$inquote = false; $keywords = explode("\"", $keywords); foreach($keywords as $phrase)
| $inquote = false; $keywords = explode("\"", $keywords); foreach($keywords as $phrase)
|
Zeile 286 | Zeile 287 |
---|
{ $split_words = preg_split("#\s{1,}#", $phrase, -1); if(!is_array($split_words))
|
{ $split_words = preg_split("#\s{1,}#", $phrase, -1); if(!is_array($split_words))
|
{
| {
|
continue; } foreach($split_words as $word) { if(!$word)
|
continue; } foreach($split_words as $word) { if(!$word)
|
{ continue; }
| { continue; }
|
$words[] = trim($word); } } } $inquote = !$inquote;
|
$words[] = trim($word); } } } $inquote = !$inquote;
|
}
| }
|
} else { $split_words = preg_split("#\s{1,}#", $keywords, -1); if(!is_array($split_words))
|
} else { $split_words = preg_split("#\s{1,}#", $keywords, -1); if(!is_array($split_words))
|
{
| {
|
continue; } foreach($split_words as $word)
| continue; } foreach($split_words as $word)
|
Zeile 316 | Zeile 317 |
---|
continue; } $words[] = trim($word);
|
continue; } $words[] = trim($word);
|
}
}
| }
}
|
$keywords = ''; foreach($words as $word) {
| $keywords = ''; foreach($words as $word) {
|
Zeile 436 | Zeile 437 |
---|
$message_lookin .= " $boolean LOWER(p.message) LIKE '%{$phrase}%'"; } }
|
$message_lookin .= " $boolean LOWER(p.message) LIKE '%{$phrase}%'"; } }
|
| if($subject_lookin == " AND (") { // There are no search keywords to look for $lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']); error($lang->error_minsearchlength); }
|
$inquote = !$inquote; } $subject_lookin .= ")";
| $inquote = !$inquote; } $subject_lookin .= ")";
|