From 03c6ace568d7b8bf3bcfb0a8ac6beb4b845306b5 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 19 Mar 2002 00:46:22 +0000 Subject: [PATCH] Allow a a comma delimited set of post id's to be sent to remove words function ... for modcp et al git-svn-id: file:///svn/phpbb/trunk@2336 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_search.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_search.php b/phpBB/includes/functions_search.php index 325581101a..ce6ce5167e 100644 --- a/phpBB/includes/functions_search.php +++ b/phpBB/includes/functions_search.php @@ -347,7 +347,7 @@ function remove_common($mode, $fraction, $word_id_list = array()) return $word_count; } -function remove_search_post($post_id) +function remove_search_post($post_id_sql) { global $db; @@ -359,7 +359,8 @@ function remove_search_post($post_id) case 'mysql4': $sql = "SELECT word_id FROM " . SEARCH_MATCH_TABLE . " - WHERE post_id = $post_id"; + WHERE post_id IN ($post_id_sql) + GROUP BY word_id"; if ( $result = $db->sql_query($sql) ) { $word_id_sql = ''; @@ -404,7 +405,8 @@ function remove_search_post($post_id) WHERE word_id IN ( SELECT word_id FROM " . SEARCH_MATCH_TABLE . " - WHERE post_id = $post_id + WHERE post_id IN ($post_id_sql) + GROUP BY word_id ) GROUP BY word_id HAVING COUNT(word_id) = 1 @@ -420,7 +422,7 @@ function remove_search_post($post_id) } $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . " - WHERE post_id = $post_id"; + WHERE post_id IN ($post_id_sql)"; if ( !($db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);