From 5adf2b8517c21845dd0b406dee910514ff78640d Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 25 Jun 2023 20:10:39 +0200 Subject: Updated 6 files and added 2 files (automated) --- .idea/deployment.xml | 6 -- app.php | 4 +- includes/components/sysbanner.inc | 88 +++++++++++++----------------- includes/components/timeline.inc | 112 ++++++++++++++++++++++++++++++++++++++ includes/system/history.inc | 28 ++++++---- includes/util/functions.inc | 2 +- pages/api/timeline.php | 12 ++++ pages/home.inc | 23 +++++++- 8 files changed, 202 insertions(+), 73 deletions(-) create mode 100644 includes/components/timeline.inc create mode 100644 pages/api/timeline.php diff --git a/.idea/deployment.xml b/.idea/deployment.xml index a20124a..05a71fc 100644 --- a/.idea/deployment.xml +++ b/.idea/deployment.xml @@ -7,12 +7,6 @@ - - - - - - diff --git a/app.php b/app.php index 2568d06..eb35cd2 100644 --- a/app.php +++ b/app.php @@ -2,8 +2,8 @@ ob_start(); -//if (false) { -if (!str_starts_with($_SERVER['REQUEST_URI'], "/api")) { +if (false) { +//if (!str_starts_with($_SERVER['REQUEST_URI'], "/api")) { require_once $_SERVER['DOCUMENT_ROOT'] . "/error.php"; set_error_handler("ch_error"); } diff --git a/includes/components/sysbanner.inc b/includes/components/sysbanner.inc index a650cd0..26a049e 100644 --- a/includes/components/sysbanner.inc +++ b/includes/components/sysbanner.inc @@ -13,49 +13,12 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa ?> -
-
- -
+
padding-top: 15px;">
-
+
+

-
-
-
- " data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="//-/history"> - - - -
+
+
+ +
\ No newline at end of file diff --git a/includes/components/timeline.inc b/includes/components/timeline.inc new file mode 100644 index 0000000..6c85472 --- /dev/null +++ b/includes/components/timeline.inc @@ -0,0 +1,112 @@ + 1; ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + '00000000-0000-0000-0000-000000000000', + 'timestamp' => date('c', time() + 60), + 'members' => [] + ] + ]; + + foreach ($switches as $index => $switch) { + if (strtotime($switch["timestamp"]) >= $time) { + $correct = $switches[$index - 1]; + $v = floor((strtotime($switch["timestamp"]) - $time) / 60); + + echo(''); + + $leftCols -= $v; if ($leftCols < 0) $leftCols = 0; + $time = strtotime($switch["timestamp"]); + } + } + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ " style="width: 100%; height: 30px; display: flex; align-items: center; justify-content: center;"> + + + ' . implode(", ", array_map(function ($i) { + return getMemberWithoutSystem($i)["display_name"] ?? getMemberWithoutSystem($i)["name"] ?? $i; + }, $correct["members"])) . '
6 hours ago5 hours ago4 hours ago3 hours ago2 hours ago1 hour agoNow
-6h-5h-4h-3h-2-1Now
+ + + +function page() { global $lang; global $systemCommonName; global $systemID; global $app; global $switches; global $isLoggedIn; global $isLowerLoggedIn; ?>
- "> + "> " style="width:24px;"> 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)); ?> diff --git a/includes/util/functions.inc b/includes/util/functions.inc index ad54706..9b6f356 100644 --- a/includes/util/functions.inc +++ b/includes/util/functions.inc @@ -91,7 +91,7 @@ if (!function_exists("getAsset")) { } if ($type === "bodies" || $type === "heads") { - if (in_array("human", getSystemMember($systemID, $memberID)["_metadata"]["species"])) { + if (getSystemMember($systemID, $memberID) !== null && getSystemMember($systemID, $memberID)["_metadata"] !== null && getSystemMember($systemID, $memberID)["_metadata"]["species"] !== null && in_array("human", getSystemMember($systemID, $memberID)["_metadata"]["species"])) { $type = "avatars"; if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/" . $type . "/" . $id . ".webp")) { diff --git a/pages/api/timeline.php b/pages/api/timeline.php new file mode 100644 index 0000000..392d5de --- /dev/null +++ b/pages/api/timeline.php @@ -0,0 +1,12 @@ +;z-index: 9;margin-left: 8px;opacity: .75;">
-
+

Cold Haze

ponies in 3 plural systems

@@ -156,6 +156,27 @@ function members() { global $isLoggedIn; global $isLowerLoggedIn; global $app; ? } ?> +
+
+ +