diff options
Diffstat (limited to 'includes/functions.inc')
-rw-r--r-- | includes/functions.inc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/includes/functions.inc b/includes/functions.inc index 924bfae..1345db1 100644 --- a/includes/functions.inc +++ b/includes/functions.inc @@ -5,11 +5,14 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; if (!function_exists("getAsset")) { function getAsset($systemID, $memberID = null, $type = "avatars") { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/general.json")) { - $id1 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/general.json"), true)["uuid"]); + $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); + $systemFile = (isset($app["other"]) && $systemID === $app["other"]["id"]) ? "other" : $systemID; + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemFile/general.json")) { + $id1 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemFile/general.json"), true)["uuid"]); if (isset($memberID)) { - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemFile/members.json"), true); $list = array_map(function ($i) { return $i["id"]; }, $members); @@ -272,16 +275,17 @@ if (!function_exists("showSubsystem")) { if (!function_exists("showSystem")) { function showSystem(string $id, string $name, string $color, bool $hideTitle) { + $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); global $travelling; - $global = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/general.json"), true); + $global = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/general.json"), true); if ($hideTitle) { echo('<!-- ' . $name . ' --> -<div id="hpd-' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px;display:grid;grid-template-columns: 1fr;margin-bottom:10px;">'); +<div id="hpd-' . ($id === "gdapd" ? "raindrops" : ($id === "ynmuc" ? "cloudburst" : "other")) . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px;display:grid;grid-template-columns: 1fr;margin-bottom:10px;">'); } else { echo('<!-- ' . $name . ' --> -<div id="hpd-' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px 10px 10px 20px;display:grid;grid-template-columns: 128px 1fr;margin-bottom:10px;">'); +<div id="hpd-' . ($id === "gdapd" ? "raindrops" : ($id === "ynmuc" ? "cloudburst" : "other")) . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px 10px 10px 20px;display:grid;grid-template-columns: 128px 1fr;margin-bottom:10px;">'); } if (!$hideTitle) echo('<!-- System Name --> <a style="display:flex;margin: -10px -20px;align-items:center;justify-content:center;text-align:center;padding: 10px 20px;border-radius: 10px;background: #' . $global['color'] . '55;width: 148px;text-decoration:none;color:white;filter:none !important;" href="/' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '" class="hpd-system"> @@ -327,6 +331,13 @@ if (!function_exists("raindrops")) { } } +if (!function_exists("other")) { + function other(bool $hideTitle): void { + $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); + showSystem($app["other"]["id"], $app["other"]["name"], "#" . $app["other"]["color"] . "a6", $hideTitle); + } +} + if (!function_exists("getMember")) { function getMember(string $id) { global $systemID; |