mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Autocorrect layout
Опциональная корректировка раскладки клаваатуры в поиске. По умолчанию включено.
This commit is contained in:
parent
800111c899
commit
16de03b214
3 changed files with 24 additions and 9 deletions
|
@ -485,6 +485,7 @@ $bb_cfg['search_min_word_len'] = 3;
|
|||
$bb_cfg['search_max_word_len'] = 35;
|
||||
$bb_cfg['limit_max_search_results'] = false;
|
||||
$bb_cfg['spam_filter_file_path'] = ''; // BB_PATH .'/misc/spam_filter_words.txt';
|
||||
$bb_cfg['autocorrect_wkl'] = true; // autocorrect wrong keyboard layout
|
||||
|
||||
// Posting
|
||||
$bb_cfg['prevent_multiposting'] = true; // replace "reply" with "edit last msg" if user (not admin or mod) is last topic poster
|
||||
|
|
|
@ -430,11 +430,18 @@ if (!$items_found)
|
|||
// Search words
|
||||
if ($var =& $_REQUEST[$text_match_key])
|
||||
{
|
||||
if ($tmp = substr(trim($var), 0, $text_match_max_len))
|
||||
if ($tmp = mb_substr(trim($var), 0, $text_match_max_len))
|
||||
{
|
||||
if ($bb_cfg['autocorrect_wkl'])
|
||||
{
|
||||
// Autocorrect wrong keyboard layout
|
||||
$tlc = new Text_LangCorrect();
|
||||
$title_match_val = $tlc->parse($tlc->parse($tmp, 1), 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$title_match_val = $tmp;
|
||||
}
|
||||
$text_match_sql = clean_text_match($title_match_val, $all_words_val, false, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -460,10 +460,17 @@ if (!$set_default)
|
|||
if ($tm =& $_REQUEST[$title_match_key] AND is_string($tm))
|
||||
{
|
||||
if ($tmp = mb_substr(trim($tm), 0, $title_match_max_len))
|
||||
{
|
||||
if ($bb_cfg['autocorrect_wkl'])
|
||||
{
|
||||
// Autocorrect wrong keyboard layout
|
||||
$tlc = new Text_LangCorrect();
|
||||
$title_match_val = $tlc->parse($tlc->parse($tmp, 1), 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$title_match_val = $tmp;
|
||||
}
|
||||
$title_match_sql = clean_text_match($title_match_val, true, false, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue