pages.php: use ReportQueries for the dashboard report counter

This commit is contained in:
Zankaria 2024-12-08 23:16:25 +01:00
parent 907656c0ff
commit d75f3fecf8

View file

@ -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();