From ea85d9383460d1957158b023b3b3647d3026687f Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 30 Apr 2025 01:01:31 +0500 Subject: feat: random emote --- src/emote.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/emote.php') diff --git a/src/emote.php b/src/emote.php index 63d5746..42cd2ac 100644 --- a/src/emote.php +++ b/src/emote.php @@ -62,3 +62,27 @@ class Emote return $this->visibility; } } + +function html_random_emote(PDO &$db) +{ + $stmt = $db->prepare("SELECT id, ext, code FROM emotes WHERE visibility = 1 ORDER BY RAND() LIMIT 1"); + $stmt->execute(); + + if ($row = $stmt->fetch()) { + echo '' + ?> +
+ + +
+