diff options
author | Andrew Dolgov <[email protected]> | 2011-04-18 20:01:25 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-04-18 20:01:25 +0400 |
commit | 6338b16fb54ae39135eec0e4dbea5349b02ec516 (patch) | |
tree | 1b44a6fdf8b983e6dda6aa1fc08a79e75fc8f6f7 /functions.php | |
parent | da497babda5b85504f3d0471751490c88f025b57 (diff) |
filter_to_sql: limit results to last 30 days of articles
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 8 |
1 files changed, 7 insertions, 1 deletions
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; } |