From dbc036b0d8a0213485333f7daaf2718e7d83d8a0 Mon Sep 17 00:00:00 2001 From: NaysKutzu Date: Wed, 18 Oct 2023 16:26:54 +0000 Subject: [PATCH] PUSH -> Now you can customize the colors using a custom CSS inside the settings path. -> Now you can customize the header, so you can add Google AdSense, etc. --- migrate/10.sql | 1 + migrate/8.sql | 1 + migrate/9.sql | 1 + public/index.php | 10 +++ view/admin/settings/customcss.php | 17 ++++++ view/admin/settings/customhead.php | 17 ++++++ view/admin/settings/main.php | 98 ++++++++++++++++++++++++++++++ view/requirements/head.php | 17 +++++- 8 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 migrate/10.sql create mode 100644 migrate/8.sql create mode 100644 migrate/9.sql create mode 100644 view/admin/settings/customcss.php create mode 100644 view/admin/settings/customhead.php diff --git a/migrate/10.sql b/migrate/10.sql new file mode 100644 index 00000000..07c6ef58 --- /dev/null +++ b/migrate/10.sql @@ -0,0 +1 @@ +ALTER TABLE `mythicaldash_settings` ADD `customhead_enabled` ENUM('false','true') NOT NULL DEFAULT 'true' AFTER `customcss_code`, ADD `customhead_code` TEXT NOT NULL DEFAULT '' AFTER `customhead_enabled`; \ No newline at end of file diff --git a/migrate/8.sql b/migrate/8.sql new file mode 100644 index 00000000..9895f98e --- /dev/null +++ b/migrate/8.sql @@ -0,0 +1 @@ +ALTER TABLE `mythicaldash_settings` CHANGE `version` `version` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '\'2.0.1\''; \ No newline at end of file diff --git a/migrate/9.sql b/migrate/9.sql new file mode 100644 index 00000000..bc945c44 --- /dev/null +++ b/migrate/9.sql @@ -0,0 +1 @@ +ALTER TABLE `mythicaldash_settings` ADD `customcss_enabled` ENUM('false','true') NOT NULL DEFAULT 'false' AFTER `ads_code`, ADD `customcss_code` TEXT NOT NULL DEFAULT '.body { height: unset; }' AFTER `customcss_enabled`; \ No newline at end of file diff --git a/public/index.php b/public/index.php index 09c9346a..8a097490 100644 --- a/public/index.php +++ b/public/index.php @@ -290,6 +290,16 @@ require("../view/admin/settings/ads.php"); }); + $router->add("/admin/settings/customcss", function () { + require("../include/main.php"); + require("../view/admin/settings/customcss.php"); + }); + + $router->add("/admin/settings/customhead", function () { + require("../include/main.php"); + require("../view/admin/settings/customhead.php"); + }); + $router->add("/admin/settings/pterodactyl", function () { require("../include/main.php"); require("../view/admin/settings/pterodactyl.php"); diff --git a/view/admin/settings/customcss.php b/view/admin/settings/customcss.php new file mode 100644 index 00000000..900e8b67 --- /dev/null +++ b/view/admin/settings/customcss.php @@ -0,0 +1,17 @@ +close(); + die(); +} else { + header('location: /admin/settings'); + die(); +} +?> \ No newline at end of file diff --git a/view/admin/settings/customhead.php b/view/admin/settings/customhead.php new file mode 100644 index 00000000..33b38203 --- /dev/null +++ b/view/admin/settings/customhead.php @@ -0,0 +1,17 @@ +close(); + die(); +} else { + header('location: /admin/settings'); + die(); +} +?> \ No newline at end of file diff --git a/view/admin/settings/main.php b/view/admin/settings/main.php index 44951be0..a1832bb3 100644 --- a/view/admin/settings/main.php +++ b/view/admin/settings/main.php @@ -524,6 +524,104 @@ class="btn btn-primary me-2 waves-effect waves-light" value="true">Save +
+
Custom CSS
+
+
+
+
+
+ +
+ + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ + Cancel +
+
+
+
+
+
Custom Header Code
+
+
+
+
+
+ +
+ + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ + Cancel +
+
+
+
diff --git a/view/requirements/head.php b/view/requirements/head.php index 0d3c2435..03392342 100644 --- a/view/requirements/head.php +++ b/view/requirements/head.php @@ -44,7 +44,6 @@ class="template-customizer-theme-css" /> - - + + + + \ No newline at end of file