diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-08 02:07:24 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-08 02:07:24 +0500 |
| commit | 2cceb6f38983d958e6ba7bb6e607f5c74ef06c27 (patch) | |
| tree | cc094d34b6d5e249739ccb6560d07aaeb423bb19 | |
| parent | 3a5cad0f5fb9461d06b81903763cf504988e8091 (diff) | |
feat: icons for featured and global emotes
| -rw-r--r-- | public/emotes/index.php | 30 | ||||
| -rw-r--r-- | public/static/img/icons/world.png | bin | 0 -> 923 bytes |
2 files changed, 28 insertions, 2 deletions
diff --git a/public/emotes/index.php b/public/emotes/index.php index 1ef4a6d..7c76522 100644 --- a/public/emotes/index.php +++ b/public/emotes/index.php @@ -176,8 +176,34 @@ if (CLIENT_REQUIRES_JSON) { <section class="content"> <?php display_alert() ?> <section class="box"> - <div class="box navtab"> - <?php echo $emote != null ? "Emote - " . $emote->get_code() : "$total_emotes Emotes - Page $page/$total_pages" ?> + <div class="box navtab row"> + <?php + if ($emote != null) { + echo "Emote - " . $emote->get_code(); + echo '<div class="row small-gap" style="margin-left:auto">'; + + $stmt = $db->prepare(" + SELECT MAX(es.is_featured) AS is_featured, MAX(es.is_global) AS is_global + FROM emote_sets es + JOIN emote_set_contents esc ON esc.emote_set_id = es.id + JOIN emotes e ON esc.emote_id = e.id + WHERE e.id = ? + "); + $stmt->execute([$emote->get_id()]); + + if ($row = $stmt->fetch()) { + if ($row["is_featured"]) { + echo '<img src="/static/img/icons/star.png" title="Featured emote" alt="Featured" />'; + } + if ($row["is_global"]) { + echo '<img src="/static/img/icons/world.png" title="Global emote" alt="Global" />'; + } + } + echo '</div>'; + } else { + echo "$total_emotes Emotes - Page $page/$total_pages"; + } + ?> </div> <?php if ($emote != null) { ?> diff --git a/public/static/img/icons/world.png b/public/static/img/icons/world.png Binary files differnew file mode 100644 index 0000000..68f21d3 --- /dev/null +++ b/public/static/img/icons/world.png |
