aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-15 04:07:12 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-15 04:07:12 +0100
commit7e64cda41548500c25825cca29bb7e0167249b83 (patch)
tree713c590a4d3e10e46861c4ec8ad1247dcf4a2e3a /app/Models/EntryDAO.php
parent83e8c68b6f9fc563230920ee520eae138898a2c1 (diff)
Date minimum pour afficher les articles
Implémente décision https://github.com/marienfressinaud/FreshRSS/issues/323
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php7
1 files changed, 5 insertions, 2 deletions
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 = '';