summaryrefslogtreecommitdiff
path: root/includes/subsysbanner.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/subsysbanner.php')
-rw-r--r--includes/subsysbanner.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/includes/subsysbanner.php b/includes/subsysbanner.php
index e36d0b5..7788155 100644
--- a/includes/subsysbanner.php
+++ b/includes/subsysbanner.php
@@ -24,7 +24,7 @@ $fronters = array_map(function ($item) {
<div style="height:max-content;display:grid;grid-template-columns: repeat(4, 1fr);" id="member-card">
<span>
<b>Fronter:</b>
- <?php if (in_array($fronters[0], getSubsystemByID($subsystemID)["members"])): $member = getMember($fronters[0]); ?>
+ <?php if (in_array($fronters[0], $subsystem["members"])): $member = getMember($fronters[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") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a>
<?php else: ?>
<span class="text-muted">N/A</span>
@@ -33,11 +33,12 @@ $fronters = array_map(function ($item) {
<span>
<?php
- $arr = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true), function ($i) use ($subsystemID) {
- return in_array($i["members"][0], getSubsystemByID($subsystemID)["members"]);
+ $subsystem = getSubsystemByID($subsystemID);
+ $arr = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true), function ($i) use ($subsystem) {
+ return isset($i["members"][0]) && in_array($i["members"][0], $subsystem["members"]);
});
sort($arr);
- $previousID = $arr[in_array($fronters[0], getSubsystemByID($subsystemID)["members"]) ? 1 : 0]["members"][0];
+ $previousID = $arr[in_array($fronters[0], $subsystem["members"]) ? 1 : 0]["members"][0];
$member = null;
foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true) as $members) {
@@ -48,13 +49,13 @@ $fronters = array_map(function ($item) {
}
?>
- <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"]) ?></a>
+ <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"]) ?></a>
</span>
<span>
- <b>Members:</b> <?= count(getSubsystemByID($subsystemID)["members"]) ?>
+ <b>Members:</b> <?= count($subsystem["members"]) ?>
</span>
<span>
- <b>Parent System:</b> <a class="member-link" href="/<?= $system ?>"><img style="width:24px;border-radius:5px;" src="/assets/uploads/<?= $system ?>.png"> <?= getMiniName($systemCommonName) ?></a>
+ <b>Parent system:</b> <a class="member-link" href="/<?= $system ?>"><img style="width:24px;border-radius:5px;" src="/assets/uploads/<?= $system ?>.png"> <?= getMiniName($systemCommonName) ?></a>
</span>
</div>
</div>