From 0a98c4322c689dfe5d3097c7cd0ab36390d4a25f Mon Sep 17 00:00:00 2001 From: o-psi Date: Sat, 14 Oct 2023 14:10:41 -0500 Subject: [PATCH] Allow unarchiving in Post.php --- post/category.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/post/category.php b/post/category.php index 13a6c60b..72ec5273 100644 --- a/post/category.php +++ b/post/category.php @@ -50,6 +50,20 @@ if (isset($_GET['archive_category'])) { } +if (isset($_GET['unarchive_category'])) { + $category_id = intval($_GET['unarchive_category']); + + mysqli_query($mysqli,"UPDATE categories SET category_archived_at = NULL WHERE category_id = $category_id"); + + //logging + mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Category', log_action = 'Unarchive', log_description = '$category_id'"); + + $_SESSION['alert_message'] = "Category Unarchived"; + + header("Location: " . $_SERVER["HTTP_REFERER"]); + +} + if (isset($_GET['delete_category'])) { $category_id = intval($_GET['delete_category']);