From 11b6668cbf98debb8e3063e6a392b43343fcf858 Mon Sep 17 00:00:00 2001 From: Anton Smirnov Date: Sun, 22 Mar 2020 02:10:28 +0200 Subject: More inactive cutoffs (#2831) * Fill additional cutoffs * Update phpdoc * Add translation strings * Update app/i18n/fr/gen.php Co-Authored-By: Alexandre Alapetite * Add Dutch translation Co-authored-by: Alexandre Alapetite Co-authored-by: Frans de Jonge --- app/Controllers/statsController.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'app/Controllers') 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; -- cgit v1.2.3