From c02313140497b6ec3d4b963a18c4528f4e1a57cd Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 14 May 2025 21:51:30 +0500 Subject: feat: personal badges for approvers --- public/emotes/index.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'public/emotes/index.php') diff --git a/public/emotes/index.php b/public/emotes/index.php index ad4df09..978515f 100644 --- a/public/emotes/index.php +++ b/public/emotes/index.php @@ -383,10 +383,12 @@ if (CLIENT_REQUIRES_JSON) { ?> prepare("SELECT u.id, u.username, a.created_at, r.name AS role_name, r.badge_id AS role_badge_id FROM users u + $stmt = $db->prepare("SELECT u.id, u.username, a.created_at, r.name AS role_name, r.badge_id AS role_badge_id, ub.badge_id AS custom_badge_id + FROM users u INNER JOIN mod_actions a ON a.emote_id = ? LEFT JOIN role_assigns ra ON ra.user_id = u.id LEFT JOIN roles r ON r.id = ra.role_id + LEFT JOIN user_badges ub ON ub.user_id = u.id WHERE u.id = a.user_id"); $stmt->execute([$emote->get_id()]); @@ -398,6 +400,10 @@ if (CLIENT_REQUIRES_JSON) { echo ' ## ' . $row['; } + if ($row["custom_badge_id"]) { + echo " "; + } + echo ', '; echo format_timestamp(strtotime($row["created_at"]) - $emote->get_created_at()) . ' after upload'; -- cgit v1.2.3