diff options
| author | 2013-12-15 04:07:12 +0100 | |
|---|---|---|
| committer | 2013-12-15 04:07:12 +0100 | |
| commit | 7e64cda41548500c25825cca29bb7e0167249b83 (patch) | |
| tree | 713c590a4d3e10e46861c4ec8ad1247dcf4a2e3a /app/controllers/indexController.php | |
| parent | 83e8c68b6f9fc563230920ee520eae138898a2c1 (diff) | |
Date minimum pour afficher les articles
Implémente décision
https://github.com/marienfressinaud/FreshRSS/issues/323
Diffstat (limited to 'app/controllers/indexController.php')
| -rwxr-xr-x | app/controllers/indexController.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 16a053ba3..92070590a 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -124,15 +124,19 @@ class FreshRSS_index_Controller extends Minz_ActionController { } } + // on calcule la date des articles les plus anciens qu'on affiche + $nb_month_old = $this->view->conf->oldEntries (); + $date_min = time () - (3600 * 24 * 30 * $nb_month_old); + try { - $entries = $this->entryDAO->listWhere($getType, $getId, $state, $order, $nb + 1, $first, $filter); + $entries = $this->entryDAO->listWhere($getType, $getId, $state, $order, $nb + 1, $first, $filter, $date_min); // Si on a récupéré aucun article "non lus" // on essaye de récupérer tous les articles if ($state === 'not_read' && empty($entries)) { //TODO: Remove in v0.8 Minz_Log::record ('Conflicting information about nbNotRead!', Minz_Log::DEBUG); $this->view->state = 'all'; - $entries = $this->entryDAO->listWhere($getType, $getId, 'all', $order, $nb, $first, $filter); + $entries = $this->entryDAO->listWhere($getType, $getId, 'all', $order, $nb, $first, $filter, $date_min); } if (count($entries) <= $nb) { |
