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
This commit is contained in:
Paul S. Owen 2002-03-19 00:46:22 +00:00
parent 1ab738dcb2
commit 03c6ace568

View file

@ -347,7 +347,7 @@ function remove_common($mode, $fraction, $word_id_list = array())
return $word_count; return $word_count;
} }
function remove_search_post($post_id) function remove_search_post($post_id_sql)
{ {
global $db; global $db;
@ -359,7 +359,8 @@ function remove_search_post($post_id)
case 'mysql4': case 'mysql4':
$sql = "SELECT word_id $sql = "SELECT word_id
FROM " . SEARCH_MATCH_TABLE . " 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) ) if ( $result = $db->sql_query($sql) )
{ {
$word_id_sql = ''; $word_id_sql = '';
@ -404,7 +405,8 @@ function remove_search_post($post_id)
WHERE word_id IN ( WHERE word_id IN (
SELECT word_id SELECT word_id
FROM " . SEARCH_MATCH_TABLE . " FROM " . SEARCH_MATCH_TABLE . "
WHERE post_id = $post_id WHERE post_id IN ($post_id_sql)
GROUP BY word_id
) )
GROUP BY word_id GROUP BY word_id
HAVING COUNT(word_id) = 1 HAVING COUNT(word_id) = 1
@ -420,7 +422,7 @@ function remove_search_post($post_id)
} }
$sql = "DELETE FROM " . SEARCH_MATCH_TABLE . " $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . "
WHERE post_id = $post_id"; WHERE post_id IN ($post_id_sql)";
if ( !($db->sql_query($sql)) ) if ( !($db->sql_query($sql)) )
{ {
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);