summaryrefslogtreecommitdiff
path: root/includes/system/history.inc
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-06-25 20:10:39 +0200
committerRaindropsSys <contact@minteck.org>2023-06-25 20:10:39 +0200
commit5adf2b8517c21845dd0b406dee910514ff78640d (patch)
tree433c26dd202a8e201cef5b2ea7786e038ffd84d7 /includes/system/history.inc
parent395cc068abf1aadb34be8b03e5567e24aa8a898d (diff)
downloadpluralconnect-5adf2b8517c21845dd0b406dee910514ff78640d.tar.gz
pluralconnect-5adf2b8517c21845dd0b406dee910514ff78640d.tar.bz2
pluralconnect-5adf2b8517c21845dd0b406dee910514ff78640d.zip
Updated 6 files and added 2 files (automated)
Diffstat (limited to 'includes/system/history.inc')
-rw-r--r--includes/system/history.inc28
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)); ?>