prepare('DELETE FROM '.$table.' WHERE msgid=:messageid'); $query->execute(['messageid' => $messageid]); $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); return; } ?>