Limit overboard db query by age

This commit is contained in:
Retro_Guy 2020-12-16 23:26:09 -07:00
parent 45775395e1
commit abd6be4db2

View File

@ -96,7 +96,7 @@ ob_start();
$database = $spooldir.'/'.$config_name.'-overview.db3'; $database = $spooldir.'/'.$config_name.'-overview.db3';
$table = 'overview'; $table = 'overview';
$dbh = rslight_db_open($database, $table); $dbh = rslight_db_open($database, $table);
$query = $dbh->prepare('SELECT * FROM '.$table.' WHERE newsgroup=:findgroup ORDER BY date DESC LIMIT '.$maxdisplay); $query = $dbh->prepare('SELECT * FROM '.$table.' WHERE newsgroup=:findgroup AND date >= '.$oldest.' ORDER BY date DESC LIMIT '.$maxdisplay);
$articles = array(); $articles = array();
foreach($grouplist as $findgroup) { foreach($grouplist as $findgroup) {
$groups = preg_split("/(\ |\t)/", $findgroup, 2); $groups = preg_split("/(\ |\t)/", $findgroup, 2);