From: Andrew Dolgov Date: Mon, 18 Apr 2011 16:01:25 +0000 (+0400) Subject: filter_to_sql: limit results to last 30 days of articles X-Git-Tag: 1.5.3~29 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6338b16fb54ae39135eec0e4dbea5349b02ec516;p=tt-rss.git filter_to_sql: limit results to last 30 days of articles --- 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; }