From a2df9a69dcc14cb70118cda2ded499055e7ee358 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 21 Aug 2022 17:31:56 +0200 Subject: m. update --- includes/system/compare.php | 18 +++++++++++------- includes/system/history.php | 43 +++++++++++++++++++++++++++++++------------ includes/system/subsystem.php | 6 ++++-- 3 files changed, 46 insertions(+), 21 deletions(-) (limited to 'includes/system') diff --git a/includes/system/compare.php b/includes/system/compare.php index 96eb5d9..6d69cd0 100644 --- a/includes/system/compare.php +++ b/includes/system/compare.php @@ -105,29 +105,33 @@ function getMember(string $id) { " style="width:24px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/.png" alt=""> + } ?>" style="width:24px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/.png" alt=""> diff --git a/includes/system/history.php b/includes/system/history.php index ad4e30e..8483e3a 100644 --- a/includes/system/history.php +++ b/includes/system/history.php @@ -21,7 +21,11 @@ function getMember(string $id) { $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true); uksort($switches, function ($a, $b) { - return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + if (isset($b["timestamp"]) && isset($a["timestamp"])) { + return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + } else { + return null; + } }); function getSwitchesForDay(int $day) { @@ -33,7 +37,11 @@ function getMember(string $id) { })); uksort($filtered, function ($a, $b) { - return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + if (isset($b["timestamp"]) && isset($a["timestamp"])) { + return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + } else { + return null; + } }); return $filtered; @@ -80,6 +88,13 @@ function getMember(string $id) { ?>

Front history in the

+

Today

- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -130,7 +145,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -160,7 +175,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -190,7 +205,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -220,7 +235,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -250,7 +265,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -280,7 +295,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -310,7 +325,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -340,7 +355,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -365,7 +380,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -376,5 +391,9 @@ function getMember(string $id) {
+ \ No newline at end of file diff --git a/includes/system/subsystem.php b/includes/system/subsystem.php index 5d28cba..14d1b2a 100644 --- a/includes/system/subsystem.php +++ b/includes/system/subsystem.php @@ -1,5 +1,7 @@ 1 ? "s" :''); - return "{$difference} {$period} {$tense} "; + return "{$difference} {$period} {$tense}"; } if (getSubsystemByID($subsystemID) === null) header("Location: /?error=Invalid subsystem ID") and die(); @@ -114,7 +116,7 @@ $title = $subsystemData["name"] . " ยท " . $systemCommonName; require_once $_SER
- (edit) + (edit)
-- cgit