From 633c92eae865e957121e08de634aeee11a8b3992 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Mon, 24 Apr 2023 14:03:36 +0200 Subject: Updated 18 files, added 1692 files and deleted includes/system/compare.inc (automated) --- pages/alphabet.inc | 51 +++++++++++--- pages/api/fronter.php | 17 +++++ pages/byspecies.inc | 98 +++++++++++++++++---------- pages/home.inc | 4 +- pages/metadata.inc | 5 ++ pages/relations.inc | 184 +++++++++++++++++++++++++++++--------------------- pages/rules.inc | 9 +++ pages/splitting.inc | 7 ++ pages/stats.inc | 16 ++++- pages/travelling.inc | 1 + 10 files changed, 268 insertions(+), 124 deletions(-) (limited to 'pages') diff --git a/pages/alphabet.inc b/pages/alphabet.inc index 37bd74d..2b57c76 100644 --- a/pages/alphabet.inc +++ b/pages/alphabet.inc @@ -1,24 +1,26 @@ +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/alphabet.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/alphabet.json", "{}"); -
-
+$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/alphabet.json"), true); + +function page(): void +{ global $lang; global $pages; ?>

-
-
.
- 0): ?> @@ -33,6 +35,37 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
+ + +
+
+
diff --git a/pages/api/fronter.php b/pages/api/fronter.php index 9f70fdc..a908efa 100644 --- a/pages/api/fronter.php +++ b/pages/api/fronter.php @@ -1,5 +1,6 @@ -1 ? $index - 1 : $index); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/planner.json", "{}"); + createJob("RefreshCache", []); break; @@ -147,6 +162,8 @@ switch ($type) { } moveElement($list[$date], $index, 0); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/planner.json", "{}"); + createJob("RefreshCache", []); break; diff --git a/pages/byspecies.inc b/pages/byspecies.inc index e3bdcc4..672493e 100644 --- a/pages/byspecies.inc +++ b/pages/byspecies.inc @@ -1,6 +1,8 @@ -
@@ -16,45 +18,71 @@ function species(array $members, string $id, string $name) { global $systemID; g

-

- Members by species + + ob_start(); + $isLoggedInOldState = $isLoggedIn; + $isLowerLoggedInOldState = $isLowerLoggedIn; + $isLoggedIn = false; + $isLowerLoggedIn = false; + page(); + $isLoggedIn = $isLoggedInOldState; + $isLowerLoggedIn = $isLowerLoggedInOldState; + $cache["public"] = ob_get_contents(); + ob_end_clean(); + } - - - - - - - - + echo($isLoggedIn ? $cache["private"] : $cache["public"]); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/species.json", json_encode($cache)); ?>
\ No newline at end of file diff --git a/pages/home.inc b/pages/home.inc index cc04e42..9686f7f 100644 --- a/pages/home.inc +++ b/pages/home.inc @@ -151,9 +151,9 @@ function members() { global $isLoggedIn; global $isLowerLoggedIn; global $app; ? ?> -
+ +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/relations.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/relations.json", "{}"); -
-
+$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/relations.json"), true); + +function page() { global $isLoggedIn; global $isLowerLoggedIn; global $pages; global $lang; global $app; ?> @@ -115,6 +116,37 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; text-align: center; } + + +
+
+
diff --git a/pages/rules.inc b/pages/rules.inc index 967a4b4..23447f2 100644 --- a/pages/rules.inc +++ b/pages/rules.inc @@ -1,5 +1,6 @@ + +
@@ -272,5 +279,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; filter: invert(1); } + diff --git a/pages/splitting.inc b/pages/splitting.inc index d1dccae..2f5fa39 100644 --- a/pages/splitting.inc +++ b/pages/splitting.inc @@ -3,10 +3,15 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/splitting.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/splitting.json", "{}"); + +$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/splitting.json"), true); + ?>
+

Members by splitting date

+
diff --git a/pages/stats.inc b/pages/stats.inc index de501bb..742fb87 100644 --- a/pages/stats.inc +++ b/pages/stats.inc @@ -3,8 +3,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; -$switchesRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/switches.json"), true); -$switchesCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/switches.json"), true); +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/stats.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/stats.json", "{}"); + +$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/stats.json"), true); ?> @@ -16,6 +17,11 @@ $switchesCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] .

Statistics

+
diff --git a/pages/travelling.inc b/pages/travelling.inc index 687b9f2..9eadaed 100644 --- a/pages/travelling.inc +++ b/pages/travelling.inc @@ -99,6 +99,7 @@ if (isset($_GET['toggleTravel']) && $isLoggedIn) { file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/navigation.json", "{}"); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json", "{}"); + createJob("RefreshCache", []); header("Location: /-/travelling"); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); -- cgit