diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-06 01:29:57 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-06 01:29:57 +0500 |
| commit | 643fccf82f1ab35565172f6bbe7b001927d71775 (patch) | |
| tree | c5136183f55b74403a542a589c1a4b0f0908f9b7 /public | |
| parent | 68be07e299beab5c29d59535de809042c83c30d9 (diff) | |
feat: approval notes
Diffstat (limited to 'public')
| -rw-r--r-- | public/emotes/upload.php | 19 | ||||
| -rw-r--r-- | public/static/style.css | 5 | ||||
| -rw-r--r-- | public/system/emotes/index.php | 18 |
3 files changed, 26 insertions, 16 deletions
diff --git a/public/emotes/upload.php b/public/emotes/upload.php index de4d2d4..b5a11aa 100644 --- a/public/emotes/upload.php +++ b/public/emotes/upload.php @@ -56,7 +56,7 @@ if ($_SERVER['REQUEST_METHOD'] != "POST") { <div class="wrapper"> <?php html_navigation_bar() ?> - <section class="content" style="width: 50%;"> + <section class="content" style="width: 400px;"> <?php display_alert() ?> <section class="box"> <div class="box navtab"> @@ -67,20 +67,27 @@ if ($_SERVER['REQUEST_METHOD'] != "POST") { </div> <div class="box content"> <form action="/emotes/upload.php" method="POST" enctype="multipart/form-data"> - <h3>Emote name</h3> + <h3>Emote name<span style="color:red;">*</span></h3> <input type="text" name="code" id="code" required> - <h3>Image</h3> + <h3>Image<span style="color:red;">*</span></h3> <input type="file" name="file" id="file" accept=".gif,.jpg,.jpeg,.png,.webp" required> <div> - <label for="visibility">Emote visibility: </label> + <label for="visibility" class="inline">Emote visibility: </label> <select name="visibility" id="form-visibility"> <option value="1">Public</option> <option value="0">Unlisted</option> </select><br> <p id="form-visibility-description" style="font-size: 10px;">test</p> - <label for="tos">Do you accept <a href="/rules">the rules</a>?</label> - <input type="checkbox" name="tos" required> + </div> + + <label for="notes">Approval notes (optional)</label> + <textarea name="notes" id="form-notes"></textarea> + + <div> + <label for="tos" class="inline">Do you accept <a href="/rules">the rules</a>?<span + style="color:red;">*</span></label> + <input type="checkbox" name="tos" value="1" required> </div> <button type="submit" id="upload-button">Upload as diff --git a/public/static/style.css b/public/static/style.css index ed1396c..b658488 100644 --- a/public/static/style.css +++ b/public/static/style.css @@ -81,6 +81,11 @@ label.inline { display: inline; } +textarea { + resize: vertical; + height: 100px; +} + .container { width: 100%; min-height: 100vh; diff --git a/public/system/emotes/index.php b/public/system/emotes/index.php index 98d56b8..92d9c9f 100644 --- a/public/system/emotes/index.php +++ b/public/system/emotes/index.php @@ -15,8 +15,6 @@ if (!authorize_user(true) || !$_SESSION["user_role"]["permission_approve_emotes" exit; } -$emote_id = max(0, intval($_GET["id"] ?? "0")); - $db = new PDO(DB_URL, DB_USER, DB_PASS); $emote_results = $db->query("SELECT e.*, u.username as uploader_name FROM emotes e @@ -28,13 +26,13 @@ LIMIT 25 $emote = $emote_results[0] ?? null; -if ($emote_id > 0) { +if (isset($_GET["id"])) { $stmt = $db->prepare("SELECT e.*, u.username as uploader_name FROM emotes e LEFT JOIN users u ON u.id = e.uploaded_by WHERE e.visibility = 2 AND e.id = ? LIMIT 1"); - $stmt->execute([$emote_id]); + $stmt->execute([$_GET["id"]]); $emote = $stmt->fetch(PDO::FETCH_ASSOC) ?? null; } @@ -117,9 +115,9 @@ if ($emote_id > 0) { $username = ANONYMOUS_DEFAULT_NAME; $link = "#"; - if ($row["uploader_name"] != null) { - $username = $row["uploader_name"]; - $link = '/users.php?id=' . $row["uploaded_by"]; + if ($emote["uploader_name"] != null) { + $username = $emote["uploader_name"]; + $link = '/users.php?id=' . $emote["uploaded_by"]; } echo "<a href=\"$link\">"; @@ -127,13 +125,13 @@ if ($emote_id > 0) { echo "</a>"; echo ', <span title="'; - echo date("M d, Y H:i:s", strtotime($row["created_at"])); - echo ' UTC">about ' . format_timestamp(time() - strtotime($row["created_at"])) . " ago</span>"; + echo date("M d, Y H:i:s", strtotime($emote["created_at"])); + echo ' UTC">about ' . format_timestamp(time() - strtotime($emote["created_at"])) . " ago</span>"; ?></td> </tr> <tr> <th>Notes</th> - <td><i>Empty</i></td> + <td><?php echo isset($emote["notes"]) == true ? $emote["notes"] : '<i>Empty</i>' ?></td> </tr> </table> </section> |
