From 5eba322cbd24191e05304df08c80af846977d99b Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 14 Oct 2025 11:05:17 +0200 Subject: New stats overview of dates with most unread articles (#8089) New view with direct links to dates with most unread articles: image --- app/Controllers/statsController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/Controllers/statsController.php') diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index 4491443c0..7c1791dd6 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -246,4 +246,18 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController { $this->view->hours24Labels = $hours24Labels; } + + public function unreadDatesAction(): void { + $statsDAO = FreshRSS_Factory::createStatsDAO(); + $field = Minz_Request::paramString('field', plaintext: true); + if (!in_array($field, ['id', 'date'], true)) { + $field = 'id'; + } + $granularity = Minz_Request::paramString('granularity', plaintext: true); + if (!in_array($granularity, ['day', 'month', 'year'], true)) { + $granularity = 'day'; + } + $dates = $statsDAO->getMaxUnreadDates($field, $granularity, Minz_Request::paramInt('max') ?: 100); + $this->view->unreadDates = $dates; + } } -- cgit v1.2.3