|
From: Paul S. O. <ps...@us...> - 2001-11-20 23:45:30
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv13885
Modified Files:
posting.php search.php
Log Message:
Various core updates for searching
Index: posting.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/posting.php,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -r1.101 -r1.102
*** posting.php 2001/11/19 23:56:00 1.101
--- posting.php 2001/11/20 23:45:26 1.102
***************
*** 32,40 ****
function clean_words($entry, &$stopword_list, &$synonym_list)
{
! $init_match = array("^", "$", "&", "(", ")", "<", ">", "`", "'", "|", ",", "@", "_", "?", "%");
! $init_replace = array(" ", " ", " ", " ", " ", " ", " ", " ", "", " ", " ", " ", " ", " ", " ");
! $later_match = array("-", "~", "+", ".", "[", "]", "{", "}", ":", "\\", "/", "=", "#", "\"", ";", "*", "!");
! $later_replace = array(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ");
$entry = " " . stripslashes(strip_tags(strtolower($entry))) . " ";
--- 32,40 ----
function clean_words($entry, &$stopword_list, &$synonym_list)
{
! static $init_match = array('^', '$', '&', '(', ')', '<', '>', '`', "'", '|', ',', '@', '_', '?', '%');
! static $init_replace = array(" ", " ", " ", " ", " ", " ", " ", " ", "", " ", " ", " ", " ", " ", " ");
! static $later_match = array("-", "~", "+", ".", "[", "]", "{", "}", ":", "\\", "/", "=", "#", "\"", ";", "*", "!");
! static $later_replace = array(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ");
$entry = " " . stripslashes(strip_tags(strtolower($entry))) . " ";
***************
*** 85,95 ****
}
! function remove_old( $post_id )
{
global $db;
if( count($word_id_list) )
{
- $word_id_sql = "";
for($i = 0; $i < count($word_id_list); $i++ )
{
--- 85,95 ----
}
! function remove_common($percent, $word_id_list = array())
{
global $db;
+ $word_id_sql = "";
if( count($word_id_list) )
{
for($i = 0; $i < count($word_id_list); $i++ )
{
***************
*** 100,190 ****
$word_id_sql .= $word_id_list[$i]['word_id'];
}
! $word_id_sql = " AND sl.word_id IN ($word_id_sql)";
}
! else
{
! $word_id_sql = "";
}
! }
! function remove_common($percent, $word_id_list = array())
! {
! global $db;
! if( count($word_id_list) )
{
! $word_id_sql = "";
! for($i = 0; $i < count($word_id_list); $i++ )
! {
! if( $word_id_sql != "" )
! {
! $word_id_sql .= ", ";
! }
! $word_id_sql .= $word_id_list[$i]['word_id'];
! }
! $word_id_sql = " AND w.word_id IN ($word_id_sql)";
! $sql = "SELECT w.word_id, SUM(m.word_count) AS post_occur_count
! FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
! WHERE w.word_id = m.word_id
! $word_id_sql
! GROUP BY w.word_id
! ORDER BY post_occur_count DESC";
! if( !$result = $db->sql_query($sql) )
{
! message_die(GENERAL_ERROR, "Couldn't obtain search word sums", "", __LINE__, __FILE__, $sql);
}
! if( $post_count = $db->sql_numrows($result) )
{
! $rowset = $db->sql_fetchrowset($result);
! $sql = "SELECT COUNT(post_id) AS total_posts
! FROM " . POSTS_TABLE;
!
$result = $db->sql_query($sql);
if( !$result )
{
! message_die(GENERAL_ERROR, "Couldn't obtain post count", "", __LINE__, __FILE__, $sql);
}
! $row = $db->sql_fetchrow($result);
!
! $words_removed = 0;
! $word_id_sql = "";
! for($i = 0; $i < $post_count; $i++)
! {
! if( ( $rowset[$i]['post_occur_count'] / $row['total_posts'] ) >= $percent )
! {
! if( $word_id_sql != "" )
! {
! $word_id_sql .= ", ";
! }
! $word_id_sql .= $rowset[$i]['word_id'];
!
! $words_removed++;
! }
! }
!
! if( $word_id_sql != "" )
{
! $sql = "DELETE FROM " . SEARCH_WORD_TABLE . "
! WHERE word_id IN ($word_id_sql)";
! $result = $db->sql_query($sql);
! if( !$result )
! {
! message_die(GENERAL_ERROR, "Couldn't delete word list entry", "", __LINE__, __FILE__, $sql);
! }
!
! $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . "
! WHERE word_id IN ($word_id_sql)";
! $result = $db->sql_query($sql);
! if( !$result )
! {
! message_die(GENERAL_ERROR, "Couldn't delete word match entry", "", __LINE__, __FILE__, $sql);
! }
}
}
}
--- 100,164 ----
$word_id_sql .= $word_id_list[$i]['word_id'];
}
! $word_id_sql = "WHERE word_id IN ($word_id_sql) ";
}
!
! $sql = "SELECT SUM(forum_posts) AS total_posts
! FROM " . FORUMS_TABLE ;
! $result = $db->sql_query($sql);
! if( !$result )
{
! message_die(GENERAL_ERROR, "Couldn't obtain post count", "", __LINE__, __FILE__, $sql);
}
! $row = $db->sql_fetchrow($result);
! $common_threshold = floor($row['total_posts'] * $percent);
! $sql = "SELECT word_id
! FROM " . SEARCH_MATCH_TABLE . "
! $word_id_sql
! GROUP BY word_id
! HAVING COUNT(word_id) > $common_threshold";
! $result = $db->sql_query($sql);
! if( !$result )
{
! message_die(GENERAL_ERROR, "Couldn't obtain common word list", "", __LINE__, __FILE__, $sql);
! }
! if( $post_count = $db->sql_numrows($result) )
! {
! $common_word_id_list = array();
! while( $row = $db->sql_fetchrow($result) )
{
! $common_word_id_list[] = $row['word_id'];
}
! $db->sql_freeresult($result);
!
! if(count($common_word_ids) != 0)
{
! $common_word_id_list = implode(", ", $common_word_id_list);
! $sql = "UPDATE " . SEARCH_WORD_TABLE . "
! SET word_common = 1
! WHERE word_id IN ($common_word_id_list)";
$result = $db->sql_query($sql);
if( !$result )
{
! message_die(GENERAL_ERROR, "Couldn't delete word list entry", "", __LINE__, __FILE__, $sql);
}
! $sql = "DELETE FROM " . SEARCH_WORD_MATCH . "
! WHERE word_id IN ($common_word_id_list)";
! $result = $db->sql_query($sql);
! if( !$result )
{
! message_die(GENERAL_ERROR, "Couldn't delete word match entry", "", __LINE__, __FILE__, $sql);
}
}
+ else
+ {
+ return 0;
+ }
}
***************
*** 275,283 ****
$word_id_sql .= $check_words[$i]['word_id'];
}
- $word_id_sql = "word_id IN ($word_id_sql)";
$sql = "SELECT word_id, COUNT(post_id) AS post_occur_count
FROM " . SEARCH_MATCH_TABLE . "
! WHERE $word_id_sql
GROUP BY word_id
ORDER BY post_occur_count DESC";
--- 249,256 ----
$word_id_sql .= $check_words[$i]['word_id'];
}
$sql = "SELECT word_id, COUNT(post_id) AS post_occur_count
FROM " . SEARCH_MATCH_TABLE . "
! WHERE word_id IN ($word_id_sql)
GROUP BY word_id
ORDER BY post_occur_count DESC";
***************
*** 334,338 ****
}
! function add_search_words($post_id, $text)
{
global $db, $phpbb_root_path, $board_config, $lang;
--- 307,311 ----
}
! function add_search_words($post_id, $post_text, $post_title = "")
{
global $db, $phpbb_root_path, $board_config, $lang;
***************
*** 341,345 ****
$synonym_array = @file($phpbb_root_path . "language/lang_" . $board_config['default_lang'] . "/search_synonyms.txt");
! $search_text = clean_words($text, $stopword_array, $synonym_array);
$search_matches = split_words($search_text);
--- 314,320 ----
$synonym_array = @file($phpbb_root_path . "language/lang_" . $board_config['default_lang'] . "/search_synonyms.txt");
! $search_text = clean_words($post_text, $stopword_array, $synonym_array);
! // $search_title = clean_words($post_title, $stopword_array, $synonym_array);
!
$search_matches = split_words($search_text);
***************
*** 347,370 ****
{
$word = array();
- $word_count = array();
- $phrase_string = $text;
- $sql_in = "";
for ($j = 0; $j < count($search_matches); $j++)
{
$this_word = strtolower(trim($search_matches[$j]));
- if( empty($word_count[$this_word]) )
- {
- $word_count[$this_word] = 1;
- }
-
$new_word = true;
for($k = 0; $k < count($word); $k++)
{
! if( $this_word == $word[$k] )
{
$new_word = false;
- $word_count[$this_word]++;
}
}
--- 322,336 ----
{
$word = array();
for ($j = 0; $j < count($search_matches); $j++)
{
$this_word = strtolower(trim($search_matches[$j]));
$new_word = true;
for($k = 0; $k < count($word); $k++)
{
! if( $this_word == $word[$k] || $this_word == "" )
{
$new_word = false;
}
}
***************
*** 376,394 ****
}
! for($j = 0; $j < count($word); $j++)
! {
! if( $word[$j] )
{
! if( $sql_in != "" )
! {
! $sql_in .= ", ";
! }
! $sql_in .= "'" . $word[$j] . "'";
}
}
! $sql = "SELECT word_id, word_text
FROM " . SEARCH_WORD_TABLE . "
! WHERE word_text IN ($sql_in)";
$result = $db->sql_query($sql);
if( !$result )
--- 342,358 ----
}
! $word_sql_in = "";
! for ($j = 0; $j < count($word); $j++)
! {
! if( $word_sql_in != "" )
{
! $word_sql_in .= ", ";
}
+ $word_sql_in .= "'" . $word[$j] . "'";
}
! $sql = "SELECT word_id, word_text, word_common
FROM " . SEARCH_WORD_TABLE . "
! WHERE word_text IN ($word_sql_in)";
$result = $db->sql_query($sql);
if( !$result )
***************
*** 402,405 ****
--- 366,370 ----
}
+ $match_word = array();
for ($j = 0; $j < count($word); $j++)
{
***************
*** 407,410 ****
--- 372,376 ----
{
$new_match = true;
+ $word_common = false;
if( $word_check_count )
***************
*** 414,423 ****
if( $word[$j] == $check_words[$k]['word_text'] )
{
$new_match = false;
- $word_id = $check_words[$k]['word_id'];
}
}
}
if( $new_match )
{
--- 380,399 ----
if( $word[$j] == $check_words[$k]['word_text'] )
{
+ if( $check_words[$k]['word_common'] )
+ {
+ $word_common = true;
+ }
+
$new_match = false;
}
+
}
}
+ if( !$word_common )
+ {
+ $match_word[] = "'" . $word[$j] . "'";
+ }
+
if( $new_match )
{
***************
*** 429,448 ****
message_die(GENERAL_ERROR, "Couldn't insert new word", "", __LINE__, __FILE__, $sql);
}
-
- $word_id = $db->sql_nextid();
- }
-
- $sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, word_count, title_match)
- VALUES ($post_id, $word_id, " . $word_count[$word[$j]] . ", 0)";
- $result = $db->sql_query($sql);
- if( !$result )
- {
- message_die(GENERAL_ERROR, "Couldn't insert new word match", "", __LINE__, __FILE__, $sql);
}
}
}
}
! remove_common(0.25, $check_words);
return;
--- 405,427 ----
message_die(GENERAL_ERROR, "Couldn't insert new word", "", __LINE__, __FILE__, $sql);
}
}
}
}
+
+ $word_sql_in = implode(", ", $match_word);
+
+ $sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match)
+ SELECT $post_id, word_id, 0
+ FROM " . SEARCH_WORD_TABLE . "
+ WHERE word_text IN ($word_sql_in)";
+ $result = $db->sql_query($sql);
+ if( !$result )
+ {
+ message_die(GENERAL_ERROR, "Couldn't insert new word matches", "", __LINE__, __FILE__, $sql);
+ }
+
}
! remove_common(0.15, $check_words);
return;
Index: search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/search.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** search.php 2001/11/19 17:54:27 1.34
--- search.php 2001/11/20 23:45:27 1.35
***************
*** 278,282 ****
}
-
$cleaned_search = clean_words_search($query_keywords);
$cleaned_search = remove_stop_words($cleaned_search, $stopword_array);
--- 278,281 ----
***************
*** 286,303 ****
$split_search = split_words($cleaned_search);
! $word_match = array();
! $current_match_type = "and";
! for($i = 0; $i < count($split_search); $i++)
{
! if( $split_search[$i] == "and" )
{
$current_match_type = "and";
}
! else if( $split_search[$i] == "or" )
{
$current_match_type = "or";
}
! else if( $split_search[$i] == "not" )
{
$current_match_type = "not";
--- 285,306 ----
$split_search = split_words($cleaned_search);
! $current_match_type = "";
! $word_count = 0;
! $word_store = array();
! $post_id_match_list = array();
! for($i = 0; $i < min(count($split_search), 10); $i++)
{
! $word_match = str_replace("*", "%", trim($split_search[$i]));
!
! if( $word_match == "and" )
{
$current_match_type = "and";
}
! else if( $word_match == "or" )
{
$current_match_type = "or";
}
! else if( $word_match == "not" )
{
$current_match_type = "not";
***************
*** 305,400 ****
else
{
! if( !empty($search_all_terms) )
{
$current_match_type = "and";
}
-
- $word_match[$current_match_type][] = $split_search[$i];
- }
- }
! @reset($word_match);
!
! $word_count = 0;
! $result_list = array();
!
! while( list($match_type, $match_word_list) = each($word_match) )
! {
! for($i = 0; $i < count($match_word_list); $i++ )
! {
! $match_word = str_replace("*", "%", $match_word_list[$i]);
!
! $sql = "SELECT m.post_id, m.word_count
! FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
! WHERE w.word_text LIKE '$match_word'
! AND m.word_id = w.word_id
! ORDER BY m.post_id, m.word_count DESC";
! $result = $db->sql_query($sql);
! if( !$result )
! {
! message_die(GENERAL_ERROR, "Couldn't matched posts", "", __LINE__, __FILE__, $sql);
! }
!
! $row = array();
!
! while( $temp_row = $db->sql_fetchrow($result) )
{
! $row['' . $temp_row['post_id'] . ''] = $temp_row['word_count'];
! }
!
! @reset($row);
! while( list($post_id, $match_count) = each($row) )
! {
! if( !$word_count )
{
! $result_list['' . $post_id . ''] = $match_count;
}
! else if( $match_type == "and" )
{
! $result_list['' . $post_id . ''] = ( $result_list['' . $post_id . ''] ) ? $result_list['' . $post_id . ''] + intval($match_count) : 0;
}
! else if( $match_type == "or" )
{
! if( $result_list['' . $post_id . ''] )
{
! $result_list['' . $post_id . ''] += intval($match_count);
}
! else
{
! $result_list['' . $post_id . ''] = 0;
! $result_list['' . $post_id . ''] += intval($match_count);
! }
! }
! else if( $match_type == "not" )
! {
! $result_list['' . $post_id . ''] = 0;
! }
! }
!
! if( $match_type == "and" && $word_count )
! {
! @reset($row);
! @reset($result_list);
! while( list($post_id, $match_count) = each($result_list) )
! {
! if( !$row['' . $post_id . ''] )
{
! $result_list['' . $post_id . ''] = 0;
}
}
}
! $word_count++;
}
}
- @reset($result_list);
-
$total_posts = 0;
$sql_post_id_in = "";
! while( list($post_id, $matches) = each($result_list) )
{
! if( $matches )
{
if( $sql_post_id_in != "" )
--- 308,404 ----
else
{
! if( $current_match_type == "" )
{
$current_match_type = "and";
}
! if( $word_match != "" )
{
! $word_store[] = $word_match;
! $sql = "SELECT m.post_id
! FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
! WHERE w.word_text LIKE '$word_match'
! AND m.word_id = w.word_id
! ORDER BY m.post_id DESC";
! $result = $db->sql_query($sql);
! if( !$result )
{
! message_die(GENERAL_ERROR, "Couldn't matched posts", "", __LINE__, __FILE__, $sql);
}
!
! if( !$word_count )
{
! while( $row = $db->sql_fetchrow($result) )
! {
! $post_id_match_list[] = $row['post_id'];
! }
}
! else
{
! if( $current_match_type == "or" )
{
! while( $row = $db->sql_fetchrow($result) )
! {
! $post_id_match_list[] = $row['post_id'];
! }
}
! else if( $current_match_type == "and" )
{
! $rowset = $db->sql_fetchrowset($result);
! for($j = 0; $j < count($post_id_match_list); $j++)
! {
! $and_match = false;
! for($k = 0; $k < count($rowset); $k++)
! {
! if( $post_id_match_list[$j] == $rowset[$k]['post_id'] )
! {
! $and_match = true;
! }
! }
!
! if( !$and_match )
! {
! $post_id_match_list[$j] = 0;
! }
! }
! }
! else if( $current_match_type == "not" )
{
! $rowset = $db->sql_fetchrowset($result);
!
! for($j = 0; $j < count($post_id_match_list); $j++)
! {
! $not_match = false;
! for($k = 0; $k < count($rowset); $k++)
! {
! if( $post_id_match_list[$j] == $rowset[$k]['post_id'] )
! {
! $not_match = true;
! }
! }
!
! if( $not_match )
! {
! $post_id_match_list[$j] = 0;
! }
! }
}
}
+
+ $word_count++;
+
}
!
! $current_match_type = "";
}
}
$total_posts = 0;
$sql_post_id_in = "";
! for($i = 0; $i < count($post_id_match_list); $i++)
{
! if( $post_id_match_list[$i] )
{
if( $sql_post_id_in != "" )
***************
*** 402,432 ****
$sql_post_id_in .= ", ";
}
! $sql_post_id_in .= $post_id;
$total_posts++;
}
}
- //
- // Start building appropriate SQL query
- //
- /* switch(SQL_LAYER)
- {
- case 'mysql':
- case 'postgresql':
- $post_text_substring = "SUBSTRING(pt.post_text, 1, $return_chars) AS post_text";
- break;
-
- case 'mssql':
- case 'odbc':
- $post_text_substring = "SUBSTR(pt.post_text, 1, $return_chars) AS post_text";
- break;
- }
- */
$sql_fields = ( $show_results == "posts") ? "pt.post_text, pt.post_subject, p.post_id, p.post_time, p.post_username, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid" : "f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username" ;
! $sql_from = ( $show_results == "posts") ? FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt" : FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2";
! $sql_where = ( $show_results == "posts") ? "pt.post_id = p.post_id AND f.forum_id = p.forum_id AND p.topic_id = t.topic_id AND p.poster_id = u.user_id" : "f.forum_id = p.forum_id AND t.topic_id = p.topic_id AND u.user_id = t.topic_poster AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id";
$search_sql = "";
--- 406,421 ----
$sql_post_id_in .= ", ";
}
! $sql_post_id_in .= $post_id_match_list[$i];
$total_posts++;
}
}
+
$sql_fields = ( $show_results == "posts") ? "pt.post_text, pt.post_subject, p.post_id, p.post_time, p.post_username, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid" : "f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_poster, t.topic_time, t.topic_views, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username" ;
! $sql_from = ( $show_results == "posts") ? FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt" : FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2";
! $sql_where = ( $show_results == "posts") ? "pt.post_id = p.post_id AND f.forum_id = p.forum_id AND p.topic_id = t.topic_id AND p.poster_id = u.user_id" : "f.forum_id = t.forum_id AND u.user_id = t.topic_poster AND p.post_id = t.topic_last_post_id AND u2.user_id = p.poster_id";
$search_sql = "";
***************
*** 437,443 ****
if( $sql_post_id_in != "" )
{
! $search_sql .= "p.post_id IN ($sql_post_id_in) ";
! }
//
// Author name search
--- 426,459 ----
if( $sql_post_id_in != "" )
{
! if( $show_results == "posts" )
! {
! $search_sql .= "p.post_id IN ($sql_post_id_in) ";
! }
! else
! {
! $sql = "SELECT topic_id
! FROM " . POSTS_TABLE . "
! WHERE post_id IN ($sql_post_id_in)
! GROUP BY topic_id";
! $result = $db->sql_query($sql);
! if( !$result )
! {
! message_die(GENERAL_ERROR, "Couldn't matched posts", "", __LINE__, __FILE__, $sql);
! }
+ $sql_post_id_in = "";
+ while( $row = $db->sql_fetchrow($result) )
+ {
+ if( $sql_post_id_in != "" )
+ {
+ $sql_post_id_in .= ", ";
+ }
+ $sql_post_id_in .= $row['topic_id'];
+ }
+
+ $search_sql .= "t.topic_id IN ($sql_post_id_in) ";
+
+ }
+ }
//
// Author name search
***************
*** 445,450 ****
if( $query_author != "" )
{
! $search_sql = preg_replace("/\(\)/", "", $search_sql);
! $query_author = preg_replace("/\*/", "%", $query_author);
if( $show_results == "posts" )
--- 461,465 ----
if( $query_author != "" )
{
! $query_author = str_replace("*", "%", trim($query_author));
if( $show_results == "posts" )
***************
*** 468,478 ****
//
! // If user is logged in then we'll
! // check to see which (if any) private
! // forums they are allowed to view and
! // include them in the search.
//
! // If not logged in we explicitly prevent
! // searching of private forums
//
if( $search_sql != "" || $search_id == "newposts" || $search_id == "egosearch" || $search_id == "unanswered" )
--- 483,490 ----
//
! // If user is logged in then we'll check to see which (if any) private
! // forums they are allowed to view and include them in the search.
//
! // If not logged in we explicitly prevent searching of private forums
//
if( $search_sql != "" || $search_id == "newposts" || $search_id == "egosearch" || $search_id == "unanswered" )
***************
*** 529,537 ****
}
- if( $show_results != "posts")
- {
- $sql .= " GROUP BY t.topic_id";
- }
-
$sql .= " ORDER BY " . $sortby_sql[$sortby] . " $sortby_dir";
--- 541,544 ----
***************
*** 541,551 ****
}
! if( ( $total_match_count = $db->sql_numrows($result) ) > 500 )
{
! message_die(GENERAL_MESSAGE, "Your search returned too many matches, refine your search criteria and try again");
}
!
$searchset = $db->sql_fetchrowset($result);
//
// Clean up search results table
--- 548,561 ----
}
! $total_match_count = $db->sql_numrows($result);
! /* if( $total_match_count > 500 )
{
! message_die(GENERAL_MESSAGE, $lang['Too_many_results']);//"Your search returned too many matches, refine your search criteria and try again";
}
! */
$searchset = $db->sql_fetchrowset($result);
+ $db->sql_freeresult($result);
+
//
// Clean up search results table
***************
*** 625,628 ****
--- 635,641 ----
}
}
+
+ $db->sql_freeresult($result);
+
}
else
***************
*** 691,694 ****
--- 704,709 ----
$searchset = $db->sql_fetchrowset($result);
+
+ $db->sql_freeresult($result);
}
else
***************
*** 1207,1209 ****
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
! ?>
--- 1222,1224 ----
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
! ?>
\ No newline at end of file
|