prepare('DELETE FROM overview WHERE msgid=:messageid'); $query->execute(['messageid' => $messageid]); $dbh = null; } if($CONFIG['article_database'] == '1') { $database = $spooldir.'/'.$group.'-articles.db3'; if(is_file($database)) { $articles_dbh = article_db_open($database); $articles_query = $articles_dbh->prepare('DELETE FROM articles WHERE msgid=:messageid'); $articles_query->execute(['messageid' => $messageid]); $articles_dbh = null; } } $this_overview=$spooldir.'/'.$group.'-overview'; if(false === (is_file($this_overview))) { return; } $out_overview=$this_overview.'.new'; $overviewfp=fopen($this_overview, 'r'); $out_overviewfp=fopen($out_overview, 'w'); while($line=fgets($overviewfp)) { $break=explode("\t", $line); if($break[4] == $messageid) { echo "DELETING: ".$messageid." IN: ".$group." #".$break[0]."\r\n"; file_put_contents($logfile, "\n".format_log_date()." ".$config_name." DELETING: ".$messageid." IN: ".$group." #".$break[0], FILE_APPEND); $grouppath = preg_replace('/\./', '/', $group); unlink($spooldir.'/articles/'.$grouppath.'/'.$break[0]); continue; } else { fputs($out_overviewfp, $line); } } fclose($overviewfp); fclose($out_overviewfp); rename($out_overview, $this_overview); chown($this_overview, $CONFIG['webserver_user']); chgrp($this_overview, $webserver_group); delete_message_from_overboard($config_name, $group, $messageid); 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)); } } } ?>