mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Autocorrect layout
Опциональная корректировка раскладки клаваатуры в поиске. По умолчанию включено.
This commit is contained in:
parent
800111c899
commit
16de03b214
3 changed files with 24 additions and 9 deletions
|
@ -484,7 +484,8 @@ $bb_cfg['max_search_words_per_post'] = 200;
|
|||
$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['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))
|
||||
{
|
||||
// Autocorrect wrong keyboard layout
|
||||
$tlc = new Text_LangCorrect();
|
||||
$title_match_val = $tlc->parse($tlc->parse($tmp, 1), 2);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -571,7 +578,7 @@ if ($post_mode)
|
|||
{
|
||||
if (empty($tmp[$post_id]))
|
||||
{
|
||||
continue; // if post was deleted but still remain in search results
|
||||
continue; // if post was deleted but still remain in search results
|
||||
}
|
||||
$topic_id = $tmp[$post_id]['topic_id'];
|
||||
$sorted_rows[$topic_id][] = $tmp[$post_id];
|
||||
|
|
|
@ -461,9 +461,16 @@ if (!$set_default)
|
|||
{
|
||||
if ($tmp = mb_substr(trim($tm), 0, $title_match_max_len))
|
||||
{
|
||||
// Autocorrect wrong keyboard layout
|
||||
$tlc = new Text_LangCorrect();
|
||||
$title_match_val = $tlc->parse($tlc->parse($tmp, 1), 2);
|
||||
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