diff options
| author | 2020-03-22 02:10:28 +0200 | |
|---|---|---|
| committer | 2020-03-22 01:10:28 +0100 | |
| commit | 11b6668cbf98debb8e3063e6a392b43343fcf858 (patch) | |
| tree | 42a58c80842ac7644445aa961c53e06feb6ae72e /app/Controllers | |
| parent | 7299e67ee42213703a6efe96655e2e75531452d2 (diff) | |
More inactive cutoffs (#2831)
* Fill additional cutoffs
* Update phpdoc
* Add translation strings
* Update app/i18n/fr/gen.php
Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr>
* Add Dutch translation
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Diffstat (limited to 'app/Controllers')
| -rw-r--r-- | app/Controllers/statsController.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index 0d7d8f65a..03f945ab4 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -73,6 +73,9 @@ class FreshRSS_stats_Controller extends Minz_ActionController { * * It displays the list of idle feed for different period. The supported * periods are: + * - last 5 years + * - last 3 years + * - last 2 years * - last year * - last 6 months * - last 3 months @@ -83,6 +86,9 @@ class FreshRSS_stats_Controller extends Minz_ActionController { $statsDAO = FreshRSS_Factory::createStatsDAO(); $feeds = $statsDAO->calculateFeedLastDate(); $idleFeeds = array( + 'last_5_year' => array(), + 'last_3_year' => array(), + 'last_2_year' => array(), 'last_year' => array(), 'last_6_month' => array(), 'last_3_month' => array(), @@ -101,13 +107,25 @@ class FreshRSS_stats_Controller extends Minz_ActionController { $last6Month->modify('-6 month'); $lastYear = clone $now; $lastYear->modify('-1 year'); + $last2Year = clone $now; + $last2Year->modify('-2 year'); + $last3Year = clone $now; + $last3Year->modify('-3 year'); + $last5Year = clone $now; + $last5Year->modify('-5 year'); foreach ($feeds as $feed) { $feedDate->setTimestamp($feed['last_date']); if ($feedDate >= $lastWeek) { continue; } - if ($feedDate < $lastYear) { + if ($feedDate < $last5Year) { + $idleFeeds['last_5_year'][] = $feed; + } elseif ($feedDate < $last3Year) { + $idleFeeds['last_3_year'][] = $feed; + } elseif ($feedDate < $last2Year) { + $idleFeeds['last_2_year'][] = $feed; + } elseif ($feedDate < $lastYear) { $idleFeeds['last_year'][] = $feed; } elseif ($feedDate < $last6Month) { $idleFeeds['last_6_month'][] = $feed; |
