From 65eb2ff002015f066f47495bbd41e0412e9071d7 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 1 May 2025 01:24:11 +0500 Subject: feat: emote aliases --- public/emotes/index.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'public/emotes/index.php') diff --git a/public/emotes/index.php b/public/emotes/index.php index 04dec65..1606b17 100644 --- a/public/emotes/index.php +++ b/public/emotes/index.php @@ -199,9 +199,15 @@ if (CLIENT_REQUIRES_JSON) { $added = false; if (isset($_SESSION["user_emote_set_id"])) { - $stmt = $db->prepare("SELECT id FROM emote_set_contents WHERE emote_set_id = ? AND emote_id = ?"); + $stmt = $db->prepare("SELECT id, name FROM emote_set_contents WHERE emote_set_id = ? AND emote_id = ?"); $stmt->execute([$_SESSION["user_emote_set_id"], $emote->get_id()]); - $added = $stmt->rowCount() > 0; + + $added = false; + + if ($row = $stmt->fetch()) { + $added = true; + $emote_current_name = $row["name"] ?? $emote->get_code(); + } } if (isset($_SESSION["user_role"]) && $_SESSION["user_role"]["permission_emoteset_own"]) { @@ -210,9 +216,20 @@ if (CLIENT_REQUIRES_JSON) { + if ($added) { + ?> + +
+ + + + -- cgit v1.2.3