From 7e64cda41548500c25825cca29bb7e0167249b83 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 15 Dec 2013 04:07:12 +0100 Subject: Date minimum pour afficher les articles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implémente décision https://github.com/marienfressinaud/FreshRSS/issues/323 --- app/Models/EntryDAO.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 8c18150b6..b61b97624 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -259,7 +259,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { return isset ($entries[0]) ? $entries[0] : false; } - public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = -1, $filter = '') { + public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0) { $where = ''; $values = array(); switch ($type) { @@ -299,9 +299,12 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { default: throw new FreshRSS_EntriesGetter_Exception ('Bad order in Entry->listByType: [' . $order . ']!'); } - if ($firstId > 0) { + if ($firstId !== '') { $where .= 'AND e.id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' '; } + if ($date_min > 0) { + $where .= 'AND e.id >= ' . $date_min . '000000 '; + } $terms = array_unique(explode(' ', trim($filter))); sort($terms); //Put #tags first $having = ''; -- cgit v1.2.3