From d461b5be189cb2f38a48e0e1d1e0ee6570b6e877 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 14 May 2025 22:08:39 +0500 Subject: feat: personal badges in approval panel --- public/system/emotes/index.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/public/system/emotes/index.php b/public/system/emotes/index.php index 79dfc28..9732bdb 100644 --- a/public/system/emotes/index.php +++ b/public/system/emotes/index.php @@ -22,12 +22,14 @@ $emote_results = $db->prepare("SELECT e.*, CASE WHEN up.private_profile = FALSE OR up.id = ? THEN e.uploaded_by ELSE NULL END AS uploaded_by, CASE WHEN up.private_profile = FALSE OR up.id = ? THEN u.username ELSE NULL END AS uploader_name, r.name AS role_name, -r.badge_id AS role_badge_id +r.badge_id AS role_badge_id, +ub.badge_id AS custom_badge_id FROM emotes e LEFT JOIN users u ON u.id = e.uploaded_by LEFT JOIN user_preferences up ON up.id = u.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 e.visibility = 2 ORDER BY e.created_at DESC LIMIT 25 @@ -43,12 +45,14 @@ if (isset($_GET["id"])) { CASE WHEN up.private_profile = FALSE OR up.id = ? THEN e.uploaded_by ELSE NULL END AS uploaded_by, CASE WHEN up.private_profile = FALSE OR up.id = ? THEN u.username ELSE NULL END AS uploader_name, r.name AS role_name, - r.badge_id AS role_badge_id + r.badge_id AS role_badge_id, + ub.badge_id AS custom_badge_id FROM emotes e LEFT JOIN users u ON u.id = e.uploaded_by LEFT JOIN user_preferences up ON up.id = u.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 e.visibility = 2 AND e.id = ? LIMIT 1"); @@ -162,6 +166,10 @@ if (isset($_GET["id"])) { echo ' ## ' . $emote['; } + if ($emote["custom_badge_id"]) { + echo ' '; + } + echo ', about ' . format_timestamp(time() - strtotime($emote["created_at"])) . " ago"; -- cgit v1.2.3