From 02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 2 Apr 2023 23:03:02 +0200 Subject: Updated 35 files, added 11 files and deleted includes/components/search.inc (automated) --- includes/components/footer.inc | 13 +- includes/components/header.inc | 16 +- includes/components/navigation.inc | 148 +++--- includes/components/pane.inc | 5 +- includes/components/search.inc | 534 --------------------- includes/components/wakeup.inc | 2 +- includes/external/chvfs/index.js | 104 ++++ .../external/chvfs/node_modules/.package-lock.json | 15 + .../external/chvfs/node_modules/node-watch/LICENSE | 22 + .../chvfs/node_modules/node-watch/README.md | 233 +++++++++ .../node-watch/lib/has-native-recursive.js | 115 +++++ .../chvfs/node_modules/node-watch/lib/is.js | 78 +++ .../chvfs/node_modules/node-watch/lib/watch.d.ts | 75 +++ .../chvfs/node_modules/node-watch/lib/watch.js | 530 ++++++++++++++++++++ .../chvfs/node_modules/node-watch/package.json | 36 ++ includes/external/chvfs/package-lock.json | 27 ++ includes/external/chvfs/package.json | 5 + includes/jobs/FrontersNotification.php | 18 +- includes/jobs/PKMembers.php | 9 +- includes/jobs/PKSystem.php | 2 +- includes/jobs/UpdateAssets.php | 4 +- includes/pages.json | 350 +++----------- includes/util/agewarning.inc | 10 +- includes/util/banner.inc | 13 +- includes/util/functions.inc | 16 +- includes/util/score.inc | 2 +- includes/util/session.inc | 6 + includes/util/travelling.inc | 2 +- 28 files changed, 1446 insertions(+), 944 deletions(-) delete mode 100644 includes/components/search.inc create mode 100644 includes/external/chvfs/index.js create mode 100644 includes/external/chvfs/node_modules/.package-lock.json create mode 100644 includes/external/chvfs/node_modules/node-watch/LICENSE create mode 100644 includes/external/chvfs/node_modules/node-watch/README.md create mode 100644 includes/external/chvfs/node_modules/node-watch/lib/has-native-recursive.js create mode 100644 includes/external/chvfs/node_modules/node-watch/lib/is.js create mode 100644 includes/external/chvfs/node_modules/node-watch/lib/watch.d.ts create mode 100644 includes/external/chvfs/node_modules/node-watch/lib/watch.js create mode 100644 includes/external/chvfs/node_modules/node-watch/package.json create mode 100644 includes/external/chvfs/package-lock.json create mode 100644 includes/external/chvfs/package.json (limited to 'includes') diff --git a/includes/components/footer.inc b/includes/components/footer.inc index d75b480..059d956 100644 --- a/includes/components/footer.inc +++ b/includes/components/footer.inc @@ -1,7 +1,8 @@ @@ -16,8 +17,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; global $lang; global $pages; + $time = microtime(true) - $GLOBALS["ColdHazeStart"]; + ?> - © · build . + © · build ., took ms




@@ -35,7 +38,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; }) - + +
+ \ No newline at end of file diff --git a/includes/components/header.inc b/includes/components/header.inc index 06b9bdb..0542314 100644 --- a/includes/components/header.inc +++ b/includes/components/header.inc @@ -1,14 +1,6 @@ -Cold Haze .png" type="image/png"> - id="admin-page"> + @@ -246,4 +238,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; display: none; } - + diff --git a/includes/components/navigation.inc b/includes/components/navigation.inc index bd4ea4b..29168ec 100644 --- a/includes/components/navigation.inc +++ b/includes/components/navigation.inc @@ -4,7 +4,78 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa global $navigation; global $toplevel; -global $lang; global $pages; global $app; global $isLowerLoggedIn; +global $lang; global $pages; global $app; global $isLowerLoggedIn; global $isLoggedIn; + +$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/navigation.json"), true); + +if (!isset($cache["raindrops"])) $cache["raindrops"] = []; +if (!isset($cache["cloudburst"])) $cache["cloudburst"] = []; +if (!isset($cache["other"])) $cache["other"] = []; + +foreach ([ + [ + "name" => "raindrops", + "id" => "gdapd" + ], + [ + "name" => "cloudburst", + "id" => "ynmuc" + ], + [ + "name" => "other", + "id" => $app["other"]["id"] + ] +] as $cacheSystem) { + if (!isset($cache[$cacheSystem["name"]]["public"])) { + $isLoggedInOldState = $isLoggedIn; + $isLowerLoggedInOldState = $isLowerLoggedIn; + + $isLoggedIn = false; + $isLowerLoggedIn = false; + + $cache[$cacheSystem["name"]]["public"] = array_map(function ($member) { + return [ + "name" => $member['display_name'] ?? $member['name'], + "icon" => getAsset($member["system"], $member["id"], "heads"), + "invert" => false, + "link" => "/$member[name]", + "stepped" => null, + "private" => false + ]; + }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$cacheSystem[id]/members.json"), true), "$cacheSystem[id]"), "$cacheSystem[id]"), function ($member) { + return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; + })); + + $isLoggedIn = $isLoggedInOldState; + $isLowerLoggedIn = $isLowerLoggedInOldState; + } + + if (!isset($cache[$cacheSystem["name"]]["private"])) { + $isLoggedInOldState = $isLoggedIn; + $isLowerLoggedInOldState = $isLowerLoggedIn; + + $isLoggedIn = true; + $isLowerLoggedIn = false; + + $cache[$cacheSystem["name"]]["private"] = array_map(function ($member) { + return [ + "name" => $member['display_name'] ?? $member['name'], + "icon" => getAsset($member["system"], $member["id"], "heads"), + "invert" => false, + "link" => "/$member[name]", + "stepped" => null, + "private" => false + ]; + }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$cacheSystem[id]/members.json"), true), "$cacheSystem[id]"), "$cacheSystem[id]"), function ($member) { + return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; + })); + + $isLoggedIn = $isLoggedInOldState; + $isLowerLoggedIn = $isLowerLoggedInOldState; + } +} + +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/navigation.json", json_encode($cache)); $navigation_admin = [ "admin" => !$isLowerLoggedIn, @@ -173,41 +244,7 @@ $navigation_admin = [ "private" => false ], ] - ], - /*"debug" => [ - "name" => $lang["navigation"]["debug"], - "minimal" => false, - "items" => [ - [ - "name" => $pages["debug"]["name"][$lang["_name"]], - "icon" => "/assets/icons/debug.svg", - "invert" => true, - "link" => "/-/debug", - "stepped" => null - ], - [ - "name" => $pages["bitset"]["name"][$lang["_name"]], - "icon" => "/assets/icons/bitset.svg", - "invert" => true, - "link" => "/-/bitset", - "stepped" => null - ], - [ - "name" => $pages["score"]["name"][$lang["_name"]], - "icon" => "/assets/icons/score.svg", - "invert" => true, - "link" => "/-/score", - "stepped" => null - ], - [ - "name" => $pages["logout"]["name"][$lang["_name"]], - "icon" => "/assets/icons/logout.svg", - "invert" => true, - "link" => "/-/logout", - "stepped" => null - ] - ] - ]*/ + ] ] ]; $navigation_global = [ @@ -287,18 +324,7 @@ $navigation_cloudburst = [ "members" => [ "name" => $lang["navigation"]["members"], "minimal" => false, - "items" => array_map(function ($member) { - return [ - "name" => $member['display_name'] ?? $member['name'], - "icon" => getAsset($member["system"], $member["id"], "heads"), - "invert" => false, - "link" => "/$member[name]", - "stepped" => null, - "private" => false - ]; - }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true), "ynmuc"), "ynmuc"), function ($member) { - return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; - })) + "items" => $cache["cloudburst"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] ] ]; @@ -341,18 +367,7 @@ $navigation_other = [ "members" => [ "name" => $lang["navigation"]["members"], "minimal" => false, - "items" => array_map(function ($member) { - return [ - "name" => $member['display_name'] ?? $member['name'], - "icon" => getAsset($member["system"], $member["id"], "heads"), - "invert" => false, - "link" => "/$member[name]", - "stepped" => null, - "private" => false - ]; - }, array_filter(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true), $app["other"]["id"]), function ($member) { - return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; - })) + "items" => $cache["other"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] ] ]; @@ -395,18 +410,7 @@ $navigation_raindrops = [ "members" => [ "name" => $lang["navigation"]["members"], "minimal" => false, - "items" => array_map(function ($member) { - return [ - "name" => $member['display_name'] ?? $member['name'], - "icon" => getAsset($member["system"], $member["id"], "heads"), - "invert" => false, - "link" => "/$member[name]", - "stepped" => null, - "private" => false - ]; - }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd"), "gdapd"), function ($member) { - return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; - })) + "items" => $cache["raindrops"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] ] ]; diff --git a/includes/components/pane.inc b/includes/components/pane.inc index eb735f5..1ecbcdf 100644 --- a/includes/components/pane.inc +++ b/includes/components/pane.inc @@ -22,8 +22,9 @@ foreach ($list as $color) { -