diff options
| author | 2025-10-14 11:05:17 +0200 | |
|---|---|---|
| committer | 2025-10-14 11:05:17 +0200 | |
| commit | 5eba322cbd24191e05304df08c80af846977d99b (patch) | |
| tree | 6f41386abfc77937fb042e48ca061e6dc0d2a7a5 /app/Controllers | |
| parent | 20ecbeb09cdf05ca3ffd44980e9070b34c2b71ec (diff) | |
New stats overview of dates with most unread articles (#8089)
New view with direct links to dates with most unread articles:
<img width="734" height="581" alt="image" src="https://github.com/user-attachments/assets/159a39b3-3a06-4ae9-9cc0-62ae36d9db9c" />
Diffstat (limited to 'app/Controllers')
| -rw-r--r-- | app/Controllers/statsController.php | 14 |
1 files changed, 14 insertions, 0 deletions
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; + } } |
