From 1ed75a58c26b55a04048060319dd9d3ffdaea932 Mon Sep 17 00:00:00 2001 From: discomrade Date: Sat, 24 Jul 2021 04:32:45 -0200 Subject: [PATCH] Show ban appeal count on mod dashboard --- inc/mod/pages.php | 3 +++ templates/mod/dashboard.html | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 1357c444..d1bcf939 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -104,6 +104,9 @@ function mod_dashboard() { $query = query('SELECT COUNT(*) FROM ``reports``') or error(db_error($query)); $args['reports'] = $query->fetchColumn(); + $query = query('SELECT COUNT(*) FROM ``ban_appeals``') or error(db_error($query)); + $args['appeals'] = $query->fetchColumn(); + if ($mod['type'] >= ADMIN && $config['check_updates']) { if (!$config['version']) error(_('Could not find current version! (Check .installed)')); diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html index d3b05da6..945b19fe 100644 --- a/templates/mod/dashboard.html +++ b/templates/mod/dashboard.html @@ -91,7 +91,9 @@
  • {% trans 'Ban list' %}
  • {% endif %} {% if config.ban_appeals and mod|hasPermission(config.mod.view_ban_appeals) %} -
  • {% trans 'Ban appeals' %}
  • + {% if appeals > 0 %}{% endif %} +
  • {% trans 'Ban appeals' %}
  • + {% if appeals > 0 %}
    {% endif %} {% endif %} {% if mod|hasPermission(config.mod.manageusers) %}
  • {% trans 'Manage users' %}