Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Fix the bug: when the code for the custom header and custom CSS is too long, it will crash.
-> The ad placement design is now working better.
-> Replace the license in the footer with a sponsor button.
-> Removed from the copyright of ShadowsDash due to the dash containing no code from ShadowsDash.
-> Removed old API routing.
-> Fixed bug with the route error for /admin/api (Telemetry).
-> Fixed the stupid bug with AFK page $nseconds and $seconds.
-> Removed the old create user from the admin page
  • Loading branch information
NaysKutzu committed Oct 21, 2023
1 parent 6ab974f commit ce806af
Show file tree
Hide file tree
Showing 25 changed files with 189 additions and 290 deletions.
10 changes: 0 additions & 10 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
include(__DIR__ . '/../routes/index.php');
//Default api routes and static routes
include(__DIR__ . '/../routes/api/index.php');
//Default api routes and static routes
include(__DIR__ . '/../routes/api/admin/index.php');
//Default api routes and static routes
include(__DIR__ . '/../routes/api/client/index.php');
//Default admin routes and static routes
include(__DIR__ . '/../routes/admin/index.php');
//Routes for /auth/
Expand All @@ -59,8 +55,6 @@
include(__DIR__ . '/../routes/earn.php');
//Routes for /admin/api/
include(__DIR__ . '/../routes/admin/api.php');
//Routes for /admin/api/
include(__DIR__ . '/../routes/admin/api.php');
//Routes for /admin/settings/
include(__DIR__ . '/../routes/admin/settings.php');
//Routes for /admin/redeem/
Expand All @@ -71,10 +65,6 @@
include(__DIR__ . '/../routes/admin/eggs.php');
//Routes for /admin/locations/
include(__DIR__ . '/../routes/admin/locations.php');
//Routes for /api/client/user/
include(__DIR__ . '/../routes/api/client/user.php');
//Routes for /api/client/user/
include(__DIR__ . '/../routes/api/admin/user.php');

$router->add("/(.*)", function () {
require("../include/main.php");
Expand Down
5 changes: 0 additions & 5 deletions routes/admin/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
require("../view/admin/users/edit_user.php");
});

$router->add("/admin/users/new", function () {
require("../include/main.php");
require("../view/admin/users/new_user.php");
});

$router->add("/admin/users/delete", function () {
require("../include/main.php");
require("../view/admin/users/delete_user.php");
Expand Down
7 changes: 0 additions & 7 deletions routes/api/admin/index.php

This file was deleted.

12 changes: 0 additions & 12 deletions routes/api/admin/user.php

This file was deleted.

Empty file removed routes/api/client/index.php
Empty file.
7 changes: 0 additions & 7 deletions routes/api/client/user.php

This file was deleted.

6 changes: 3 additions & 3 deletions view/admin/settings/customcss.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
include(__DIR__ . '/../../requirements/page.php');
include(__DIR__ . '/../../requirements/admin.php');

if (isset($_GET['update_settings'])) {
$customcss_enabled = mysqli_real_escape_string($conn,$_GET['customcss:enabled']);
$customcss_code = mysqli_real_escape_string($conn,$_GET['customcss:code']);
if (isset($_POST['update_settings'])) {
$customcss_enabled = mysqli_real_escape_string($conn,$_POST['customcss:enabled']);
$customcss_code = mysqli_real_escape_string($conn,$_POST['customcss:code']);
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `customcss_enabled` = '" . $customcss_enabled . "' WHERE `mythicaldash_settings`.`id` = 1;");
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `customcss_code` = '" . $customcss_code . "' WHERE `mythicaldash_settings`.`id` = 1;");
header('location: /admin/settings');
Expand Down
6 changes: 3 additions & 3 deletions view/admin/settings/customhead.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
include(__DIR__ . '/../../requirements/page.php');
include(__DIR__ . '/../../requirements/admin.php');

if (isset($_GET['update_settings'])) {
$customhead_enabled = mysqli_real_escape_string($conn,$_GET['customhead:enabled']);
$customhead_code = mysqli_real_escape_string($conn,$_GET['customhead:code']);
if (isset($_POST['update_settings'])) {
$customhead_enabled = mysqli_real_escape_string($conn,$_POST['customhead:enabled']);
$customhead_code = mysqli_real_escape_string($conn,$_POST['customhead:code']);
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `customhead_enabled` = '" . $customhead_enabled . "' WHERE `mythicaldash_settings`.`id` = 1;");
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `customhead_code` = '" . $customhead_code . "' WHERE `mythicaldash_settings`.`id` = 1;");
header('location: /admin/settings');
Expand Down
6 changes: 3 additions & 3 deletions view/admin/settings/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class="btn btn-primary me-2 waves-effect waves-light" value="true">Save
name="afk:coins:per:min" value="<?= $settings['afk_coins_per_min'] ?>"
placeholder="2">
</div>

</div>
<div class="mt-2">
<button type="submit" name="update_settings"
Expand Down Expand Up @@ -578,7 +578,7 @@ class="btn btn-primary me-2 waves-effect waves-light" value="true">Save
<h5 class="card-header">Custom CSS</h5>
<hr class="my-0">
<div class="card-body">
<form action="/admin/settings/customcss" method="GET">
<form action="/admin/settings/customcss" method="POST">
<div class="row">
<div class="form-group col-md-2">
<label class="control-label">Status</label>
Expand Down Expand Up @@ -627,7 +627,7 @@ class="btn btn-primary me-2 waves-effect waves-light" value="true">Save
<h5 class="card-header">Custom Header Code</h5>
<hr class="my-0">
<div class="card-body">
<form action="/admin/settings/customhead" method="GET">
<form action="/admin/settings/customhead" method="POST">
<div class="row">
<div class="form-group col-md-2">
<label class="control-label">Status</label>
Expand Down
122 changes: 0 additions & 122 deletions view/admin/users/new_user.php

This file was deleted.

12 changes: 11 additions & 1 deletion view/blank.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@
<div class="container-xxl flex-grow-1 container-p-y">
<h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Dashboard /</span> Blank</h4>
<?php include(__DIR__ . '/components/alert.php') ?>

<div id="ads">
<?php
if ($settings['enable_ads'] == "true") {
?>
<br>
<?= $settings['ads_code'] ?>
<br>
<?php
}
?>
</div>
</div>
<?php include(__DIR__ . '/components/footer.php') ?>
<div class="content-backdrop fade"></div>
Expand Down
6 changes: 3 additions & 3 deletions view/components/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class="footer-container d-flex align-items-center justify-content-between py-2 f
<script>
document.write(new Date().getFullYear());
</script>
, made with ❤️ by <a href="https://github.com/mythicalltd" target="_blank" class="fw-semibold">MythicalSystems</a> / <a href="https://github.com/shadowsdash" target="_blank" class="fw-semibold">ShadowsDash</a>
made with ❤️ by <a href="https://github.com/mythicalltd" target="_blank" class="fw-semibold">MythicalSystems</a>
</div>
<div>
<a href="https://raw.githubusercontent.com/MythicalLTD/mythicaldash/main/LICENSE" class="footer-link me-4" target="_blank">License</a>
<a href="https://mythicaldocs.pages.dev" target="_blank" class="footer-link me-4">Documentation</a>
<a href="https://github.com/sponsors/nayskutzu" class="footer-link me-4" target="_blank">Support us</a>
<a href="https://docs.mythicalsystems.me" target="_blank" class="footer-link me-4">Documentation</a>
<a href="/help-center/tos" target="_blank" class="footer-link me-4" >Terms of Service</a>
<a href="/help-center/pp" target="_blank" class="footer-link d-none d-sm-inline-block" >Privacy Policy</a>
</div>
Expand Down
12 changes: 8 additions & 4 deletions view/components/navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,15 @@ class="dropdown-item d-flex justify-content-center text-primary p-2 h-px-40 mb-1
</div>
<div class="flex-grow-1">
<span class="fw-semibold d-block">
<?= $userdb['username'] ?> (
<?= $userdb['role'] ?>)
<?= $userdb['username'] ?>
<span class="badge bg-<?php if ($userdb['role'] == "Administrator") {
echo 'danger';
} else {
echo 'success';
} ?> requestor-type ms-2">
<?= $userdb['role'] ?>
</span>
</span>

<!--<small class="text-muted"><?= $userdb['role'] ?></small><br>-->
<small class="text-muted">
<?= $userdb['coins'] ?> coins
</small>
Expand Down
16 changes: 10 additions & 6 deletions view/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,17 @@ function percentage($number, $total, $outof)
</div>
</div>
</div>
<br>
<div id="ads">
<?php
if ($settings['enable_ads'] == "true") {
echo $settings['ads_code'];
?>
<br>
<?= $settings['ads_code'] ?>
<br>
<?php
}
?>
</div>
<br>
<div class="row">
<div class="col">
<div class="card bg-default shadow">
Expand Down Expand Up @@ -366,15 +368,17 @@ class="btn btn-danger btn-sm">Delete</button></a>
</div>
</div>
</div>
<br>
<div id="ads">
<?php
if ($settings['enable_ads'] == "true") {
echo $settings['ads_code'];
?>
<br>
<?= $settings['ads_code'] ?>
<br>
<?php
}
?>
</div>
<br>
</div>
<?php include('components/footer.php') ?>
<div class="content-backdrop fade"></div>
Expand Down
Loading

0 comments on commit ce806af

Please sign in to comment.