diff options
| author | 2014-10-22 19:19:15 +0200 | |
|---|---|---|
| committer | 2014-10-22 19:19:15 +0200 | |
| commit | 1fe5ed5d210334a051c48442fad29a14e8aee155 (patch) | |
| tree | 985b9b3d364f8e6443434826d363f62c7ebcc0e7 /app/Controllers/indexController.php | |
| parent | 8a6ad05ebacb6bf6c0f6afd0afe54a29a0a18ee9 (diff) | |
nextGet and idMax are coming back.
See https://github.com/marienfressinaud/FreshRSS/issues/634
Diffstat (limited to 'app/Controllers/indexController.php')
| -rwxr-xr-x | app/Controllers/indexController.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 2dd4c3068..80675b3a6 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -34,12 +34,25 @@ class FreshRSS_index_Controller extends Minz_ActionController { try { $entries = $this->listEntriesByContext(); - if (count($entries) > FreshRSS_Context::$number) { + $nb_entries = count($entries); + if ($nb_entries > FreshRSS_Context::$number) { // We have more elements for pagination $last_entry = array_pop($entries); FreshRSS_Context::$next_id = $last_entry->id(); } + $first_entry = $nb_entries > 0 ? $entries[0] : null; + FreshRSS_Context::$id_max = $first_entry === null ? + (time() - 1) . '000000' : + $first_entry->id(); + if (FreshRSS_Context::$order === 'ASC') { + // In this case we do not know but we guess id_max + $id_max = (time() - 1) . '000000'; + if (strcmp($id_max, FreshRSS_Context::$id_max) > 0) { + FreshRSS_Context::$id_max = $id_max; + } + } + $this->view->entries = $entries; } catch (FreshRSS_EntriesGetter_Exception $e) { Minz_Log::notice($e->getMessage()); |
