diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-14 21:51:30 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-14 21:51:30 +0500 |
| commit | c02313140497b6ec3d4b963a18c4528f4e1a57cd (patch) | |
| tree | 7b07ceeeca463073d92d7ab913c7c999387fc8ff | |
| parent | 6c9badacab7752af09a772c1ce11bdc6651862e7 (diff) | |
feat: personal badges for approvers
| -rw-r--r-- | public/emotes/index.php | 8 |
1 files changed, 7 insertions, 1 deletions
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) { ?></td> </tr> <?php - $stmt = $db->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 ' <img src="/static/userdata/badges/' . $row["role_badge_id"] . '/1x.webp" alt="## ' . $row["role_name"] . '" title="' . $row["role_name"] . '" />'; } + if ($row["custom_badge_id"]) { + echo " <img src='/static/userdata/badges/" . $row["custom_badge_id"] . "/1x.webp' alt='' title='Personal badge' />"; + } + echo ', <span title="'; echo date("M d, Y H:i:s", strtotime($row["created_at"])) . ' UTC">'; echo format_timestamp(strtotime($row["created_at"]) - $emote->get_created_at()) . ' after upload'; |
