summaryrefslogtreecommitdiff
path: root/public/users.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-05-01 01:24:11 +0500
committerilotterytea <iltsu@alright.party>2025-05-01 01:24:11 +0500
commit65eb2ff002015f066f47495bbd41e0412e9071d7 (patch)
tree90f3be293b7ff7e02f72972f0afb6b7e5125517a /public/users.php
parentef16637d0f6822f326266f50b496f294ecd53cba (diff)
feat: emote aliases
Diffstat (limited to 'public/users.php')
-rw-r--r--public/users.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/public/users.php b/public/users.php
index 914f890..8b62a8a 100644
--- a/public/users.php
+++ b/public/users.php
@@ -160,7 +160,16 @@ while ($row = $stmt->fetch()) {
// getting info about emote set content
$em_stmt = $db->prepare(
- "SELECT e.id, e.code, e.mime, e.ext, e.created_at, e.uploaded_by FROM emotes e
+ "SELECT e.id, e.mime, e.ext, e.created_at, e.uploaded_by,
+ CASE
+ WHEN esc.name IS NOT NULL THEN esc.name
+ ELSE e.code
+ END AS code,
+ CASE
+ WHEN esc.name IS NOT NULL THEN e.code
+ ELSE NULL
+ END AS original_code
+ FROM emotes e
INNER JOIN emote_set_contents AS esc
ON esc.emote_set_id = ?
WHERE esc.emote_id = e.id