Replace this
PHP Code:
$sids = $db->query_read_slave("
SELECT id
FROM " . TABLE_PREFIX . "wp_table
WHERE userid = " . $vbulletin->userinfo['userid'] . "
AND id IN(" . implode(', ', $wp_ids) . ")
");
// build the final array of ids to work with
while ($wp_id = $db->fetch_array($sids))
{
$wp_sids[] = $wp_id['id'];
}
// delete from the pm table using the results from above
$delsql = "DELETE FROM " . TABLE_PREFIX . "wp_table WHERE id IN(" . implode(', ', $wp_sids) . ")";
$db->query_write($delsql);
with this
PHP Code:
// delete from the pm table using the results from above
$delsql = "DELETE FROM " . TABLE_PREFIX . "wp_table WHERE id IN(" . implode(', ', $wp_ids) . ") AND userid = " . $vbulletin->userinfo['userid'] . "";
$db->query_write($delsql);