From 13d99a70a49d3cc49dd4df15e36421f424759ecb Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 12 Aug 2018 15:35:50 +0200 Subject: [PATCH] Display comment count on profiles. --- public/profile.php | 7 ++++++- views/mio/user/view.twig | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/public/profile.php b/public/profile.php index cc3317bb..50dd5fda 100644 --- a/public/profile.php +++ b/public/profile.php @@ -61,7 +61,12 @@ switch ($mode) { SELECT COUNT(`change_id`) FROM `msz_changelog_changes` WHERE `user_id` = u.`user_id` - ) as `changelog_count` + ) as `changelog_count`, + ( + SELECT COUNT(`comment_id`) + FROM `msz_comments_posts` + WHERE `user_id` = u.`user_id` + ) as `comments_count` FROM `msz_users` as u LEFT JOIN `msz_roles` as r ON r.`role_id` = u.`display_role` diff --git a/views/mio/user/view.twig b/views/mio/user/view.twig index bfcc58dd..22cb0f09 100644 --- a/views/mio/user/view.twig +++ b/views/mio/user/view.twig @@ -133,6 +133,19 @@ + {% if profile.comments_count > 0 %} +
+
+
+ Comments +
+
+ {{ profile.comments_count|number_format }} +
+
+
+ {% endif %} + {% if profile.changelog_count > 0 %}