diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-14 22:08:39 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-14 22:08:39 +0500 |
| commit | d461b5be189cb2f38a48e0e1d1e0ee6570b6e877 (patch) | |
| tree | 97fa7027bfa7f5ebfa22712900884fff2d9f4e5f /public/system | |
| parent | c02313140497b6ec3d4b963a18c4528f4e1a57cd (diff) | |
feat: personal badges in approval panel
Diffstat (limited to 'public/system')
| -rw-r--r-- | public/system/emotes/index.php | 12 |
1 files 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 ' <img src="/static/userdata/badges/' . $emote["role_badge_id"] . '/1x.webp" alt="## ' . $emote["role_name"] . '" title="' . $emote["role_name"] . '" />'; } + if ($emote["custom_badge_id"]) { + echo ' <img src="/static/userdata/badges/' . $emote["custom_badge_id"] . '/1x.webp" alt="" title="Personal badge" />'; + } + echo ', <span title="'; echo date("M d, Y H:i:s", strtotime($emote["created_at"])); echo ' UTC">about ' . format_timestamp(time() - strtotime($emote["created_at"])) . " ago</span>"; |
