diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-02 18:35:09 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-02 18:35:09 +0500 |
| commit | 0c25e3dd54225b126ad8e48e10f4fbde8ce26ec5 (patch) | |
| tree | db7fc3d7c73f96a236eafd12c4255b1835ab3cdd /public/emotes | |
| parent | 9c7e8c24f8273f70d743ae44034a01da352a88e9 (diff) | |
feat: emote approval
Diffstat (limited to 'public/emotes')
| -rw-r--r-- | public/emotes/index.php | 17 | ||||
| -rw-r--r-- | public/emotes/upload.php | 6 |
2 files changed, 18 insertions, 5 deletions
diff --git a/public/emotes/index.php b/public/emotes/index.php index 1606b17..2102aba 100644 --- a/public/emotes/index.php +++ b/public/emotes/index.php @@ -357,10 +357,19 @@ if (CLIENT_REQUIRES_JSON) { <tr> <th>Visibility</th> <td><?php - if ($emote->get_visibility() == 1) { - echo 'Public'; - } else { - echo 'Unlisted'; + switch ($emote->get_visibility()) { + case 0: + echo 'Unlisted'; + break; + case 1: + echo 'Public'; + break; + case 2: + echo 'Pending approval (unlisted for a moment)'; + break; + default: + echo 'N/A'; + break; } ?></td> </tr> diff --git a/public/emotes/upload.php b/public/emotes/upload.php index 5563323..50a8d15 100644 --- a/public/emotes/upload.php +++ b/public/emotes/upload.php @@ -220,7 +220,11 @@ if (is_null(list($mime, $ext) = get_mime_and_ext($image["tmp_name"]))) { exit; } -$visibility = intval($_GET["visibility"], "0"); +$visibility = clamp(intval($_POST["visibility"], EMOTE_VISIBILITY_DEFAULT), 0, 2); + +if (MOD_EMOTES_APPROVE && $visibility == 1 && EMOTE_VISIBILITY_DEFAULT != 1) { + $visibility = 2; +} // creating a new emote record $db = new PDO(DB_URL, DB_USER, DB_PASS); |
