From 6338b16fb54ae39135eec0e4dbea5349b02ec516 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Apr 2011 20:01:25 +0400 Subject: 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 3d4a9849d..a3e3e8f97 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; } -- cgit v1.2.3