summaryrefslogtreecommitdiff
path: root/includes/sysbanner.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/sysbanner.php')
-rw-r--r--includes/sysbanner.php43
1 files changed, 35 insertions, 8 deletions
diff --git a/includes/sysbanner.php b/includes/sysbanner.php
index 3a2b8c1..45c1c16 100644
--- a/includes/sysbanner.php
+++ b/includes/sysbanner.php
@@ -16,8 +16,8 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
<div style="padding:10px 10px 10px 20px;text-align:center;">
<div style="display: grid; grid-template-columns: 1fr;height:100%;grid-template-rows: max-content max-content 1fr;">
<h3 style="height:max-content;"><?= $systemCommonName ?></h3>
- <div style="height:max-content;display:grid;grid-template-columns: repeat(5, 1fr);" id="member-card">
- <span>
+ <div style="height:max-content;display:grid;grid-template-columns: repeat(4, 1fr);" id="member-card">
+ <!--<span>
<b><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr>: </b><?php
$foundHost = false;
@@ -25,7 +25,7 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
$members = array_filter(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true), $systemID), function ($i) use ($travelling) {
global $hostGoneTravelling;
- if ($travelling[$i['id']]['travelling']) $hostGoneTravelling = true;
+ if ($travelling[$i['id']]['travelling'] && $i["_metadata"]["host"]) $hostGoneTravelling = true;
return true;
});
foreach ($members as $member) {
@@ -40,15 +40,28 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
?>
- </span>
+ </span>-->
<span>
- <?php $member = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-fronters.json"), true)["members"][0]; ?>
- <b>Fronter: </b><a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . resolveMember($member['name']) : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a>
+ <?php $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-fronters.json"), true); ?>
+ <b>Fronter: </b>
+ <?php if (isset($fronters["members"][0])): ?>
+ <?php $member = $fronters["members"][0]; ?>
+ <a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . resolveMember($member['name']) : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a>
+ <?php if (isset($fronters["members"][1])): ?>
+ <?php $member2 = $fronters["members"][1]; ?>
+ <br>(with
+ <a class="member-link" href="/<?= $member2["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . resolveMember($member2['name']) : "" ?>.png" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a>)
+ <?php else: ?>-<?php endif; ?>
+ <?php else: ?>-<?php endif; ?>
</span>
<span>
+ <b>Last fronter: </b>
<?php
- $previousID = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true)[1]["members"][0];
+ $previous = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true)[1]["members"];
+
+ if (isset($previous[0])):
+ $previousID = $previous[0];
$member = null;
foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true) as $members) {
@@ -59,7 +72,21 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
}
?>
- <b>Last fronter: </b><a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a>
+ <a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a>
+ <?php if (isset($previous[1])):
+ $previousID = $previous[1];
+ $member2 = null;
+
+ foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true) as $members) {
+ if ($members["id"] === $previousID) {
+ $member2 = $members;
+ break;
+ }
+ } ?>
+ <br>(with
+ <a class="member-link" href="/<?= $member2["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . resolveMember($member2['name']) : "" ?>.png" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a>)
+ <?php else: ?>-<?php endif; ?>
+ <?php else: ?>-<?php endif; ?>
</span>
<span>
<?php