From 12a888cbf01500372dfa9d20f5ed4307fc224bd1 Mon Sep 17 00:00:00 2001 From: nanosimbiot Date: Mon, 5 Sep 2011 10:07:00 +0000 Subject: [PATCH] r285 git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@285 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/includes/functions.php | 10 +++------- upload/search.php | 4 ++-- upload/tracker.php | 3 +-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 1bb6e8861..97f87770c 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2611,12 +2611,11 @@ function log_sphinx_error ($err_type, $err_msg, $query = '') } } -function get_title_match_topics ($title_match_sql, $limit = 500, $forum_ids = array()) +function get_title_match_topics ($title_match_sql, $forum_ids = array()) { global $bb_cfg, $sphinx, $userdata, $title_match; $where_ids = array(); - $limit = (int) $limit; if($forum_ids) $forum_ids = array_diff($forum_ids, array(0 => 0)); $title_match_sql = encode_text_match($title_match_sql); @@ -2627,7 +2626,6 @@ function get_title_match_topics ($title_match_sql, $limit = 500, $forum_ids = ar $where = ($title_match) ? 'topics' : 'posts'; $sphinx->SetServer($bb_cfg['sphinx_topic_titles_host'], $bb_cfg['sphinx_topic_titles_port']); - $sphinx->SetLimits(0, $limit, $limit, $limit); if ($forum_ids) { $sphinx->SetFilter('forum_id', $forum_ids, false); @@ -2666,8 +2664,7 @@ function get_title_match_topics ($title_match_sql, $limit = 500, $forum_ids = ar $where_id = 'topic_id'; $sql = "SELECT topic_id FROM ". BB_TOPICS ." WHERE MATCH (topic_title) AGAINST ('$title_match_sql'$search_bool_mode) - $where_forum - LIMIT $limit"; + $where_forum"; } else { @@ -2675,8 +2672,7 @@ function get_title_match_topics ($title_match_sql, $limit = 500, $forum_ids = ar $sql = "SELECT p.post_id FROM ". BB_POSTS ." p, ". BB_POSTS_SEARCH ." ps WHERE ps.post_id = p.post_id AND MATCH (ps.search_words) AGAINST ('$title_match_sql'$search_bool_mode) - $where_forum - LIMIT $limit"; + $where_forum"; } foreach (DB()->fetch_rowset($sql) as $row) diff --git a/upload/search.php b/upload/search.php index a7b9e6866..cc2122aa1 100644 --- a/upload/search.php +++ b/upload/search.php @@ -452,7 +452,7 @@ if ($post_mode) if ($text_match_sql) { $search_match_topics_csv = ''; - $title_match_topics = get_title_match_topics($text_match_sql, 500, $forum_selected); + $title_match_topics = get_title_match_topics($text_match_sql, $forum_selected); if (!$search_match_topics_csv = join(',', $title_match_topics)) { @@ -623,7 +623,7 @@ else if ($text_match_sql) { $search_match_topics_csv = ''; - $title_match_topics = get_title_match_topics($text_match_sql, 500, $forum_selected); + $title_match_topics = get_title_match_topics($text_match_sql, $forum_selected); if (!$search_match_topics_csv = join(',', $title_match_topics)) { diff --git a/upload/tracker.php b/upload/tracker.php index 338703dc1..d9836d254 100644 --- a/upload/tracker.php +++ b/upload/tracker.php @@ -17,7 +17,6 @@ $page_cfg['load_tpl_vars'] = array( $user->session_start(array('req_login' => $bb_cfg['bt_tor_browse_only_reg'])); $tor_search_limit = (IS_AM) ? 2000 : 500; -$title_match_limit = 700; // больше $tor_search_limit т.к. ищет по всем темам, а не только по раздачам $forum_select_size = (UA_OPERA) ? 21 : 24; // forum select box max rows $max_forum_name_len = 60; // inside forum select box $max_forums_selected = 50; @@ -504,7 +503,7 @@ if ($allowed_forums) if ($title_match) { - $title_match_topics = get_title_match_topics($title_match_sql, $title_match_limit, $search_in_forums_ary); + $title_match_topics = get_title_match_topics($title_match_sql, $search_in_forums_ary); if (!$search_match_topics_csv = join(',', $title_match_topics)) {