From 737f5008f8a4a011c832e83f6b2019d3dc27dbd0 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 22 Feb 2023 20:45:15 +0100 Subject: Updated 8 files (automated) --- includes/functions.inc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'includes/functions.inc') 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(' -
'); +