mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
r285
git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@285 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
0840e91cb7
commit
12a888cbf0
3 changed files with 6 additions and 11 deletions
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue