diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 9f569c77..bcb324b0 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -100,6 +100,8 @@ function mod_logout(Context $ctx) { function mod_dashboard(Context $ctx) { global $config, $mod; + $report_queries = $ctx->get(ReportQueries::class); + $args = []; $args['boards'] = listBoards(); @@ -126,8 +128,7 @@ function mod_dashboard(Context $ctx) { cache::set('pm_unreadcount_' . $mod['id'], $args['unread_pms']); } - $query = query('SELECT COUNT(*) FROM ``reports``') or error(db_error($query)); - $args['reports'] = $query->fetchColumn(); + $args['reports'] = $report_queries->getCount(); $query = query('SELECT COUNT(*) FROM ``ban_appeals`` WHERE denied = 0') or error(db_error($query)); $args['appeals'] = $query->fetchColumn();