forked from leftypol/leftypol
pages.php: use ReportQueries for the dashboard report counter
This commit is contained in:
parent
907656c0ff
commit
d75f3fecf8
1 changed files with 3 additions and 2 deletions
|
@ -100,6 +100,8 @@ function mod_logout(Context $ctx) {
|
||||||
function mod_dashboard(Context $ctx) {
|
function mod_dashboard(Context $ctx) {
|
||||||
global $config, $mod;
|
global $config, $mod;
|
||||||
|
|
||||||
|
$report_queries = $ctx->get(ReportQueries::class);
|
||||||
|
|
||||||
$args = [];
|
$args = [];
|
||||||
|
|
||||||
$args['boards'] = listBoards();
|
$args['boards'] = listBoards();
|
||||||
|
@ -126,8 +128,7 @@ function mod_dashboard(Context $ctx) {
|
||||||
cache::set('pm_unreadcount_' . $mod['id'], $args['unread_pms']);
|
cache::set('pm_unreadcount_' . $mod['id'], $args['unread_pms']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = query('SELECT COUNT(*) FROM ``reports``') or error(db_error($query));
|
$args['reports'] = $report_queries->getCount();
|
||||||
$args['reports'] = $query->fetchColumn();
|
|
||||||
|
|
||||||
$query = query('SELECT COUNT(*) FROM ``ban_appeals`` WHERE denied = 0') or error(db_error($query));
|
$query = query('SELECT COUNT(*) FROM ``ban_appeals`` WHERE denied = 0') or error(db_error($query));
|
||||||
$args['appeals'] = $query->fetchColumn();
|
$args['appeals'] = $query->fetchColumn();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue