diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-09 16:50:07 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-09 16:50:07 +0500 |
| commit | 8925a9526a1d3eac914030b3069713f56c37e55a (patch) | |
| tree | 2811f088ab13168658d8ac8ba9f15d01ffb49249 /lib/emote.php | |
| parent | 77c7d534f46392f62b56305ec8b71eecff3b9221 (diff) | |
feat: emoteset editors
Diffstat (limited to 'lib/emote.php')
| -rw-r--r-- | lib/emote.php | 13 |
1 files changed, 11 insertions, 2 deletions
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 "<a href='/emotesets.php?id={$es->id}' class='box column small-gap'>"; + echo "<a href='/emotesets/?id={$es->id}' class='box column small-gap'>"; echo '<div>'; echo "<p>$es->name</p>"; |
