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/util/functions.inc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'includes/util/functions.inc') diff --git a/includes/util/functions.inc b/includes/util/functions.inc index 5b5b6b5..79a47c6 100644 --- a/includes/util/functions.inc +++ b/includes/util/functions.inc @@ -17,6 +17,12 @@ if (!function_exists("createJob")) { } } +if (!function_exists("formatPonypush")) { + function formatPonypush($message) { + return "Update to Ponypush 3.1.0 or later — (\$PA1$\$" . base64_encode($message) . "\$\$)"; + } +} + if (!function_exists("peh_error")) { function peh_error($message, $code = 500): void { header("Location: /?em=" . urlencode(base64_encode($message)) . "&ec=" . $code); @@ -26,7 +32,7 @@ if (!function_exists("peh_error")) { if (!function_exists("getAsset")) { function getAsset($systemID, $memberID = null, $type = "avatars") { - $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); + $app = $GLOBALS["ColdHazeApp"] ?? 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")) { @@ -234,7 +240,7 @@ if (!function_exists("withCaretakersDown")) { if (!function_exists("getSystemMember")) { function getSystemMember(string $system, string $id) { - $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); + $app = $GLOBALS["ColdHazeApp"] ?? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); $systemID = $system; $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === $app["other"]["id"] ? "other" : $systemID) . "/members.json"), true); @@ -270,7 +276,7 @@ if (!function_exists("getMemberWithoutSystem")) { } if ($isLowerLoggedIn || $isLoggedIn) { - $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); + $app = $GLOBALS["ColdHazeApp"] ?? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); $members3 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true); foreach ($members3 as $m) { @@ -316,7 +322,7 @@ if (!function_exists("prettySize")) { 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); + $app = $GLOBALS["ColdHazeApp"] ?? 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/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/general.json"), true); @@ -381,7 +387,7 @@ 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); + $app = $GLOBALS["ColdHazeApp"] ?? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); showSystem($app["other"]["id"], $app["other"]["name"], "#" . $app["other"]["color"] . "a6", $hideTitle); } } -- cgit