diff options
Diffstat (limited to 'includes/system')
-rw-r--r-- | includes/system/compare.inc | 8 | ||||
-rw-r--r-- | includes/system/history.inc | 11 |
2 files changed, 14 insertions, 5 deletions
diff --git a/includes/system/compare.inc b/includes/system/compare.inc index dbcbfe4..2accb8a 100644 --- a/includes/system/compare.inc +++ b/includes/system/compare.inc @@ -1,4 +1,4 @@ -<?php global $system; global $lang; global $pages; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:compare"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling; +<?php global $system; global $lang; global $pages; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:compare"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling; global $app; $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); @@ -20,7 +20,7 @@ function getMember(string $id) { <br> <div class="container"> <h2><?= $lang["compare"]["title"] ?> <?= $systemCommonName ?></h2> - <div class="comparison"> + <div class="comparison" style="<?php if ($systemID === $app["other"]["id"]): ?>grid-template-columns: 3fr 1.5fr 2fr repeat(4, 1fr);<?php endif; ?>"> <span class="comparison-header comparison-item"> <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][0] ?></abbr></span> <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][1] ?></abbr></span> @@ -37,6 +37,7 @@ function getMember(string $id) { <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][4] ?></abbr></span> <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][5] ?></abbr></span> </span> + <?php if ($systemID !== $app["other"]["id"]): ?> <span class="comparison-header comparison-item"> <span class="comparison-header-l0"><abbr title="Code" data-bs-toggle="tooltip">Code</abbr></span> <span class="comparison-header-l1"><abbr title="Code" data-bs-toggle="tooltip">Code</abbr></span> @@ -45,6 +46,7 @@ function getMember(string $id) { <span class="comparison-header-l4"><abbr title="Code" data-bs-toggle="tooltip">Code</abbr></span> <span class="comparison-header-l5"><abbr title="Code" data-bs-toggle="tooltip">Code</abbr></span> </span> + <?php endif; ?> <span class="comparison-header comparison-item"> <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][0] ?></abbr></span> <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][1] ?></abbr></span> @@ -128,11 +130,13 @@ function getMember(string $id) { } ?>" style="width:24px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/<?= $species ?><?= $metadata["robot"] ? "-robot" : ($metadata["plush"] ? "-plush" : "") ?>.png" alt="<?= $species ?>"> <?php endforeach; ?> </span> + <?php if ($systemID !== $app["other"]["id"]): ?> <span class="comparison-item"> <?php if (isset($metadata["code"]) && trim($metadata["code"]) !== ""): ?> <code style="color: white;"><?= strtoupper(substr($metadata["code"], 0, 3)) ?></code> <?php else: ?>-<?php endif; ?> </span> + <?php endif; ?> <span class="comparison-item"> <?= count($metadata["marefriends"]) + count($metadata["sisters"]) + count($metadata["caretakers"]) === 0 ? "-" : "" ?> <span class="comparison-relations-count"> 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"> |