From 73a329d1e620e719932ad8c860f85289c3547ab3 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 7 May 2025 14:59:40 +0500 Subject: feat: show emote approver --- public/emotes/index.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'public') diff --git a/public/emotes/index.php b/public/emotes/index.php index ddde7c3..1ef4a6d 100644 --- a/public/emotes/index.php +++ b/public/emotes/index.php @@ -291,7 +291,6 @@ if (CLIENT_REQUIRES_JSON) { $link = "#"; if ($emote->get_uploaded_by()) { - $db = new PDO(DB_URL, DB_USER, DB_PASS); $stmt = $db->prepare("SELECT username FROM users WHERE id = ?"); $stmt->execute([$emote->get_uploaded_by()]); @@ -310,7 +309,21 @@ if (CLIENT_REQUIRES_JSON) { echo ' UTC">about ' . format_timestamp(time() - $emote->get_created_at()) . " ago"; ?> - + prepare("SELECT u.id, u.username, a.created_at FROM users u + INNER JOIN mod_actions a ON a.emote_id = ? + WHERE u.id = a.user_id"); + $stmt->execute([$emote->get_id()]); + + if ($row = $stmt->fetch()) { + echo 'Approver'; + echo '' . $row["username"] . ', '; + echo format_timestamp(strtotime($row["created_at"]) - $emote->get_created_at()) . ' after upload'; + echo ''; + } + + if (RATING_ENABLE): ?> Rating
prepare("SELECT users.id, users.username FROM users INNER JOIN emote_sets AS es ON es.owner_id = users.id -- cgit v1.2.3