diff --git a/migrate/47.sql b/migrate/47.sql new file mode 100644 index 00000000..0c9514d2 --- /dev/null +++ b/migrate/47.sql @@ -0,0 +1 @@ +ALTER TABLE `mythicaldash_settings` ADD `show_snow` ENUM('true','false') NOT NULL DEFAULT 'true' AFTER `maintenance`; \ No newline at end of file diff --git a/migrate/48.sql b/migrate/48.sql new file mode 100644 index 00000000..962e7916 --- /dev/null +++ b/migrate/48.sql @@ -0,0 +1 @@ +UPDATE `mythicaldash_settings` SET `version` = '3.1.1' WHERE `mythicaldash_settings`.`id` = 1; diff --git a/view/admin/settings/general.php b/view/admin/settings/general.php index 58223ae4..2affa370 100644 --- a/view/admin/settings/general.php +++ b/view/admin/settings/general.php @@ -6,9 +6,17 @@ if (isset($_GET['update_settings'])) { $name = mysqli_real_escape_string($conn, $_GET['app:name']); $logo = mysqli_real_escape_string($conn, $_GET['app:logo']); + $snow = mysqli_real_escape_string($conn, $_GET['app:snow']); + mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `name` = '" . $name . "' WHERE `mythicaldash_settings`.`id` = 1;"); mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `logo` = '" . $logo . "' WHERE `mythicaldash_settings`.`id` = 1;"); - header('location: /admin/settings?s=We updated the settings inside the database'); + mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `show_snow` = '" . $snow . "' WHERE `mythicaldash_settings`.`id` = 1;"); + + if ($snow == "false") { + header('location: /admin/settings?e=Well it looks like you are grinch!'); + } else { + header('location: /admin/settings?s=We updated the settings inside the database'); + } $conn->close(); die(); } else { diff --git a/view/admin/settings/main.php b/view/admin/settings/main.php index 9768d099..c2caa750 100644 --- a/view/admin/settings/main.php +++ b/view/admin/settings/main.php @@ -42,7 +42,7 @@
-
+
" @@ -53,6 +53,29 @@ " autofocus="">
+
+ +
+ + + + + + +
+