From 8925a9526a1d3eac914030b3069713f56c37e55a Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 9 Dec 2025 16:50:07 +0500 Subject: feat: emoteset editors --- lib/emote.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/emote.php') diff --git a/lib/emote.php b/lib/emote.php index a724914..38e4f01 100644 --- a/lib/emote.php +++ b/lib/emote.php @@ -107,7 +107,7 @@ class Emoteset public string $id; public string $name; public User|null $owner; - public array $emotes; + public array $emotes, $editors; public bool $is_default; @@ -119,6 +119,7 @@ class Emoteset $s->name = $arr["name"]; $s->owner = $arr["owner_id"]; $s->emotes = $arr["emotes"] ?? []; + $s->editors = $arr["editors"] ?? []; $s->is_default = $arr["is_default"] ?? false; return $s; @@ -132,6 +133,14 @@ class Emoteset $arr["emotes"] = fetch_all_emotes_from_emoteset($db, $arr["id"], $user_id); + $stmt = $db->prepare('SELECT u.id, u.username FROM users u + INNER JOIN emote_sets es ON es.id = ? + INNER JOIN acquired_emote_sets aes ON aes.emote_set_id = es.id + WHERE aes.user_id = u.id + '); + $stmt->execute([$arr["id"]]); + $arr["editors"] = $stmt->fetchAll(PDO::FETCH_ASSOC); + return Emoteset::from_array($arr); } @@ -281,7 +290,7 @@ function html_display_emotes(array $emotes, int $scale = 3) function html_display_emoteset(array $emotesets) { foreach ($emotesets as $es) { - echo ""; + echo ""; echo '
'; echo "

$es->name

"; -- cgit v1.2.3