summaryrefslogtreecommitdiff
path: root/includes/system/history.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 14:20:13 +0100
committerMinteck <contact@minteck.org>2023-02-23 14:20:13 +0100
commit8cc1f13c17fa2fb5a4410542d39e650e02945634 (patch)
treee3f668e635253310b97fb379d71318dc96d1dd2d /includes/system/history.inc
parent6563d542af0930ebb6b2f9b71f2b7538d7467665 (diff)
downloadpluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.tar.gz
pluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.tar.bz2
pluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.zip
Updated 27 files, added assets/uploads/pt-twilightsparkle.png and deleted 3 files (automated)
Diffstat (limited to 'includes/system/history.inc')
-rw-r--r--includes/system/history.inc11
1 files changed, 8 insertions, 3 deletions
diff --git a/includes/system/history.inc b/includes/system/history.inc
index ee7f762..5905276 100644
--- a/includes/system/history.inc
+++ b/includes/system/history.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $lang; global $pages; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"][$lang["_name"]] . " · " . $systemCommonName; global $systemID; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $lang; global $pages; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"][$lang["_name"]] . " · " . $systemCommonName; global $systemID; global $app; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
function getMember(string $id) {
global $systemID;
@@ -109,7 +109,7 @@ function getMember(string $id) {
}
?>
- <h2><?= $lang["history"]["title"] ?> <?= $systemCommonName ?></h2>
+ <h2><?= $systemID === $app["other"]["id"] ? "Front history in " . $app["other"]["name"] : $lang["history"]["title"] . " " . $systemCommonName ?></h2>
<div class="alert alert-warning" id="timezone" style="display: none;">
<?= str_replace("%1", '<span id="timezone-name">-</span>', str_replace("%2", '<span id="day-start">-</span>', $lang["history"]["timezone"])) ?>
<script>
@@ -130,9 +130,14 @@ function getMember(string $id) {
[ date('D j M', time() - (86400 * 9)), 9 ],
] as $day):
$switchesDay = getSwitchesForDay($day[1]);
- $switchesDay[] = getSwitchBefore($switchesDay[count($switchesDay) - 1]["id"]);
+ if (isset($switchesDay[count($switchesDay) - 1])) {
+ $switchesDay[] = getSwitchBefore($switchesDay[count($switchesDay) - 1]["id"]);
+ }
?>
<h4 style="margin-top:15px;"><?= frenchIfRequired($day[0]) ?></h4>
+ <?php if (count($switchesDay) === 0): ?>
+ <p class="text-muted">No switches happened on that day</p>
+ <?php endif; ?>
<?php foreach ($switchesDay as $switch): $switch["timestamp"] = strtotime($switch["timestamp"]); ?>
<?php if (isset($switch["members"][0])): $member = getMemberWithoutSystem($switch["members"][0]); ?>
<div class="fronter">