Remove articles from np during expire.

This commit is contained in:
Retro_Guy 2023-08-14 05:34:27 -07:00
parent d156214a85
commit d66f90e528
1 changed files with 5 additions and 2 deletions

View File

@ -61,14 +61,17 @@ file_put_contents($logfile, "\n".format_log_date()." ".$config_name." ".$group."
$articles_query->execute([':newsgroup' => $group, ':expireme' => $expireme]);
$articles_dbh = null;
}
} else { // Expire tradspool
} else { // Expire tradspool and remove from newsportal
$database = $spooldir.'/articles-overview.db3';
$dbh = overview_db_open($database);
$query = $dbh->prepare('SELECT FROM overview WHERE newsgroup=:newsgroup AND date<:expireme');
$query->execute([':newsgroup' => $group, ':expireme' => $expireme]);
$grouppath = preg_replace('/\./', '/', $group);
while($row = $query->fetch()) {
unlink($spooldir.'/articles/'.$grouppath.'/'.$row['number']);
if(is_file($spooldir.'/articles/'.$grouppath.'/'.$row['number'])) {
unlink($spooldir.'/articles/'.$grouppath.'/'.$row['number']);
}
thread_cache_removearticle($group,$row['number']);
}
$dbh = null;
}