From 3d77712a9ab014635c75a33ea0f491bbda6aead3 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 25 Feb 2023 19:59:31 +0100 Subject: Updated 16 files and added 2 files (automated) --- pages/api/fronter.php | 71 +++++++++++++++++++++++--------------- pages/home.inc | 55 ++++++++++++----------------- pages/home.old.inc | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++ pages/travelling.inc | 2 +- 4 files changed, 161 insertions(+), 62 deletions(-) create mode 100644 pages/home.old.inc (limited to 'pages') diff --git a/pages/api/fronter.php b/pages/api/fronter.php index 51ee4ee..b380a56 100644 --- a/pages/api/fronter.php +++ b/pages/api/fronter.php @@ -12,14 +12,17 @@ $index = (int)$_GET['i'] ?? null; $type = $_GET['t'] ?? null; $date = $_GET['d'] ?? null; -if (!isset($system) || trim($system) === "" || strlen($system) !== 5 || !preg_match("/[a-z]/i", $system) || ($system !== "gdapd" && $system !== "ynmuc")) +if (!isset($system) || trim($system) === "" || strlen($system) !== 5 || !preg_match("/[a-z]/i", $system) || ($system !== "gdapd" && $system !== "ynmuc")) { peh_error("System not found", 404); +} -if (!isset($type) || trim($type) === "") +if (!isset($type) || trim($type) === "") { peh_error("Type not found", 404); +} -if (!isset($date) || trim($date) === "" || strlen($date) !== 10 || !preg_match("/[\d-]/i", $date)) +if (!isset($date) || trim($date) === "" || strlen($date) !== 10 || !preg_match("/[\d-]/i", $date)) { peh_error("Date not found", 404); +} $list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/$system.json"), true); @@ -30,36 +33,42 @@ function moveElement(&$array, $a, $b) { switch ($type) { case "add": - if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) + if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) { if ($member !== null && $member !== "null") peh_error("System member not found", 404); + } if (!isset($list[$date])) $list[$date] = []; $list[$date][] = [$member, null]; break; case "cofront": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } - if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) + if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) { if ($member !== null && $member !== "null") peh_error("System member not found", 404); + } $list[$date][$index][1] = $member; break; case "delete": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } unset($day[$index]); $list[$date] = array_values($day); @@ -67,38 +76,46 @@ switch ($type) { break; case "codelete": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } $list[$date][$index][1] = null; break; case "down": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); - - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; + + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } + moveElement($list[$date], $index, $index + 1 < count($list[$date]) ? $index + 1 : $index); break; case "up": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); - - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; + + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } + moveElement($list[$date], $index, $index - 1 > -1 ? $index - 1 : $index); break; diff --git a/pages/home.inc b/pages/home.inc index 4249947..82ff3d5 100644 --- a/pages/home.inc +++ b/pages/home.inc @@ -25,9 +25,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
.png" style="width:128px;">

-
" data-bs-toggle="tooltip" style="overflow: hidden;" href="/">" style="height:32px;position:absolute;z-index:99;">
+ " style="height:32px;position:absolute;z-index:99;">

-
+
;z-index: 9;margin-left: 8px;opacity: .75;">
@@ -45,50 +45,37 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
-
- - - - -
+
- - - +
style="grid-template-columns: repeat(3, 1fr);"> + + + +
-
+
-
- -

Pony Legacy
-
+ diff --git a/pages/home.old.inc b/pages/home.old.inc new file mode 100644 index 0000000..4249947 --- /dev/null +++ b/pages/home.old.inc @@ -0,0 +1,95 @@ + + +
+
+ +
+ + +
+ + + +
+ Notice: This website is temporarily under maintenance and the administrators have locked the database. Although you are logged in as , you cannot access any of the logged-in features while the website is under maintenance. Alerts dispatching remains possible in case of an emergency. +
+ + + +
+ .png" style="width:128px;"> +

+
" data-bs-toggle="tooltip" style="overflow: hidden;" href="/">" style="height:32px;position:absolute;z-index:99;">
+

+
+
+ ;z-index: 9;margin-left: 8px;opacity: .75;"> +
+
+
+

Cold Haze

+ +

poneys dans une tĂȘte

+ + +

ponies in 3 plural systems

+ +

+ + +
+
+
+ + + + + +
+ + + + + +
+ +
+ +

Pony Legacy
+
+ +
+
+ +
' . ($member['name'] ?? $id) . '
+
' . date('j M Y', strtotime($member["date"])) . '
+
'); + + endforeach; ?> +
+
+ +
+
+ + \ No newline at end of file diff --git a/pages/travelling.inc b/pages/travelling.inc index 2064ce1..e0fbfb1 100644 --- a/pages/travelling.inc +++ b/pages/travelling.inc @@ -165,7 +165,7 @@ global $travelling; Start travelling
-- cgit