From 6338b16fb54ae39135eec0e4dbea5349b02ec516 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Apr 2011 20:01:25 +0400 Subject: [PATCH] filter_to_sql: limit results to last 30 days of articles --- functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 3d4a9849..a3e3e8f9 100644 --- a/functions.php +++ b/functions.php @@ -7301,8 +7301,14 @@ if ($filter["inverse"]) $query = "NOT ($query)"; - if ($query) + if ($query) { + if (DB_TYPE == "pgsql") { + $query .= " AND ttrss_entries.date_entered > NOW() - INTERVAL '30 days'"; + } else { + $query .= " AND ttrss_entries.date_entered > DATE_SUB(NOW(), INTERVAL 30 DAY"; + } $query .= " AND "; + } return $query; } -- 2.39.5