diff options
Diffstat (limited to 'includes/system/history.inc')
-rw-r--r-- | includes/system/history.inc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/includes/system/history.inc b/includes/system/history.inc index 963e124..b879f6e 100644 --- a/includes/system/history.inc +++ b/includes/system/history.inc @@ -55,7 +55,7 @@ if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/history.json" $cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/history.json"), true); -function page() { global $lang; global $systemCommonName; global $systemID; global $app; global $switches; ?> +function page() { global $lang; global $systemCommonName; global $systemID; global $app; global $switches; global $isLoggedIn; global $isLowerLoggedIn; ?> <br> <div class="container" id="page-content"> <?php @@ -107,7 +107,7 @@ function page() { global $lang; global $systemCommonName; global $systemID; glob <?= isNotToday($switch["timestamp"], $day[1]) ? "00:00" : date('H:i', $switch["timestamp"]) ?> </span> <span class="fronter-profile" style="vertical-align: middle;"> - <a class="member-link" href="/<?= $member["name"] === "unknown" ? ($systemID === "gdapd" ? "unknown-rd" : ($systemID === "ynmuc" ? "unknown-cb" : $app["other"]["unknown"])) : $member["name"] ?>"> + <a class="member-link" href="/<?= (isset($member) && $member["name"] === "unknown") ? ($systemID === "gdapd" ? "unknown-rd" : ($systemID === "ynmuc" ? "unknown-cb" : $app["other"]["unknown"])) : $member["name"] ?>"> <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (count($switch["members"]) > 1): ?> @@ -153,16 +153,20 @@ if (!isset($cache[$systemID]["private"]) || !isset($cache[$systemID]["public"])) $cache[$systemID]["private"] = ob_get_contents(); ob_end_clean(); - ob_start(); - $isLoggedInOldState = $isLoggedIn; - $isLowerLoggedInOldState = $isLowerLoggedIn; - $isLoggedIn = false; - $isLowerLoggedIn = false; - page(); - $isLoggedIn = $isLoggedInOldState; - $isLowerLoggedIn = $isLowerLoggedInOldState; - $cache[$systemID]["public"] = ob_get_contents(); - ob_end_clean(); + if ($systemID !== $app["other"]["id"]) { + ob_start(); + $isLoggedInOldState = $isLoggedIn; + $isLowerLoggedInOldState = $isLowerLoggedIn; + $isLoggedIn = false; + $isLowerLoggedIn = false; + page(); + $isLoggedIn = $isLoggedInOldState; + $isLowerLoggedIn = $isLowerLoggedInOldState; + $cache[$systemID]["public"] = ob_get_contents(); + ob_end_clean(); + } else { + $cache[$systemID]["public"] = ""; + } } echo($isLoggedIn ? $cache[$systemID]["private"] : $cache[$systemID]["public"]); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/history.json", json_encode($cache)); ?> |