From 44334d654977ed4ecd601c7a47127f91dea1517d Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 14 May 2025 23:18:20 +0500 Subject: feat: emote source --- public/emotes/upload.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'public/emotes/upload.php') diff --git a/public/emotes/upload.php b/public/emotes/upload.php index 2c37c26..a9d416c 100644 --- a/public/emotes/upload.php +++ b/public/emotes/upload.php @@ -100,9 +100,14 @@ if ($_SERVER['REQUEST_METHOD'] != "POST") {

test

- + +
+ + +
+
@@ -323,6 +328,11 @@ if (empty($notes)) { $notes = null; } +$source = str_safe($_POST["source"] ?? "", null); +if (empty($source)) { + $source = null; +} + $visibility = clamp(intval($_POST["visibility"], EMOTE_VISIBILITY_DEFAULT), 0, 2); if (MOD_EMOTES_APPROVE && $visibility == 1 && EMOTE_VISIBILITY_DEFAULT != 1) { @@ -333,8 +343,8 @@ if (MOD_EMOTES_APPROVE && $visibility == 1 && EMOTE_VISIBILITY_DEFAULT != 1) { $db = new PDO(DB_URL, DB_USER, DB_PASS); $id = bin2hex(random_bytes(16)); -$stmt = $db->prepare("INSERT INTO emotes(id, code, notes, uploaded_by, visibility) VALUES (?, ?, ?, ?, ?)"); -$stmt->execute([$id, $code, $notes, $uploaded_by, $visibility]); +$stmt = $db->prepare("INSERT INTO emotes(id, code, notes, source, uploaded_by, visibility) VALUES (?, ?, ?, ?, ?, ?)"); +$stmt->execute([$id, $code, $notes, $source, $uploaded_by, $visibility]); $path = "../static/userdata/emotes/$id"; -- cgit v1.2.3