From ef16637d0f6822f326266f50b496f294ecd53cba Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 30 Apr 2025 01:25:44 +0500 Subject: feat: featured emotes --- src/emote.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/emote.php') diff --git a/src/emote.php b/src/emote.php index 42cd2ac..769d62a 100644 --- a/src/emote.php +++ b/src/emote.php @@ -65,7 +65,7 @@ class Emote function html_random_emote(PDO &$db) { - $stmt = $db->prepare("SELECT id, ext, code FROM emotes WHERE visibility = 1 ORDER BY RAND() LIMIT 1"); + $stmt = $db->prepare("SELECT id, ext, code FROM emotes WHERE visibility = 1 AND is_featured = false ORDER BY RAND() LIMIT 1"); $stmt->execute(); if ($row = $stmt->fetch()) { @@ -85,4 +85,28 @@ function html_random_emote(PDO &$db) prepare("SELECT id, ext, code FROM emotes WHERE visibility = 1 AND is_featured = true ORDER BY updated_at DESC LIMIT 1"); + $stmt->execute(); + + if ($row = $stmt->fetch()) { + echo '' + ?> + +