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/index.php | 15 +++++++++++++-- public/emotes/upload.php | 16 +++++++++++++--- public/system/emotes/index.php | 9 +++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) (limited to 'public') diff --git a/public/emotes/index.php b/public/emotes/index.php index 978515f..68ae983 100644 --- a/public/emotes/index.php +++ b/public/emotes/index.php @@ -77,7 +77,8 @@ function display_list_emotes(PDO &$db, string $search, string $sort_by, int $pag $uploader, $row["is_in_user_set"], $row["rating"], - $row["visibility"] + $row["visibility"], + $row["source"] )); } @@ -107,7 +108,8 @@ function display_emote(PDO &$db, string $id) $row["uploaded_by"], false, ["total" => $row["total_rating"], "average" => $row["average_rating"]], - $row["visibility"] + $row["visibility"], + $row["source"] ); } } @@ -476,6 +478,15 @@ if (CLIENT_REQUIRES_JSON) { } ?> + get_source()): ?> + + Source + + get_source() ?> + + + 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"; diff --git a/public/system/emotes/index.php b/public/system/emotes/index.php index 9732bdb..9e88d83 100644 --- a/public/system/emotes/index.php +++ b/public/system/emotes/index.php @@ -179,6 +179,15 @@ if (isset($_GET["id"])) { Notes Empty' ?> + + + Source + + " + target="_blank"> + + + -- cgit v1.2.3