prepare('DELETE FROM articles WHERE msgid=:messageid'); $articles_query->execute([ 'messageid' => $messageid ]); $articles_dbh = null; } } // Handle overview and history $database = $spooldir . '/articles-overview.db3'; $dbh = overview_db_open($database); $stmt_del = $dbh->prepare('DELETE FROM overview WHERE newsgroup=:newsgroup AND msgid=:msgid'); $query = $dbh->prepare('SELECT * FROM overview WHERE newsgroup=:newsgroup AND msgid=:msgid'); $query->execute([ ':newsgroup' => $group, ':msgid' => $messageid ]); $grouppath = preg_replace('/\./', '/', $group); $status = "deleted"; $statusdate = time(); $statusreason = "nocem"; $statusnotes = null; while ($row = $query->fetch()) { if (is_file($spooldir . '/articles/' . $grouppath . '/' . $row['number'])) { unlink($spooldir . '/articles/' . $grouppath . '/' . $row['number']); } delete_message_from_overboard($config_name, $group, $messageid); add_to_history($group, $row['number'], $row['msgid'], $status, $statusdate, $statusreason, $statusnotes); thread_cache_removearticle($group, $row['number']); } $stmt_del->execute([ ':newsgroup' => $group, ':msgid' => $messageid ]); $dbh = null; return; } function delete_message_from_overboard($config_name, $group, $messageid) { GLOBAL $spooldir; $cachefile = $spooldir . "/" . $config_name . "-overboard.dat"; if (is_file($cachefile)) { $cached_overboard = unserialize(file_get_contents($cachefile)); if ($target = $cached_overboard['msgids'][$messageid]) { unset($cached_overboard['threads'][$target['date']]); unset($cached_overboard['msgids'][$messageid]); unset($cached_overboard['threadlink'][$messageid]); file_put_contents($cachefile, serialize($cached_overboard)); } } $cachefile = $spooldir . "/" . $group . "-overboard.dat"; if (is_file($cachefile)) { $cached_overboard = unserialize(file_get_contents($cachefile)); if ($target = $cached_overboard['msgids'][$messageid]) { unset($cached_overboard['threads'][$target['date']]); unset($cached_overboard['msgids'][$messageid]); unset($cached_overboard['threadlink'][$messageid]); file_put_contents($cachefile, serialize($cached_overboard)); } } } ?>