diff options
Diffstat (limited to 'includes/system/species.inc')
-rw-r--r-- | includes/system/species.inc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/system/species.inc b/includes/system/species.inc index cca1eb8..fb1ba69 100644 --- a/includes/system/species.inc +++ b/includes/system/species.inc @@ -3,18 +3,18 @@ $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); $members = scoreOrder($members, $systemID); -function species(array $members, string $id, string $name) { global $systemID; ?> +function species(array $members, string $id, string $name) { global $systemID; global $travelling; ?> <?php $members = [ - ...array_filter($members, function ($i) { + ...array_map(function ($i) use ($systemID) { $i["_system"] = $systemID; return $i; },array_filter($members, function ($i) use ($systemID) { global $travelling; return !$travelling[$i['id']]['travelling']; - }), - ...array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($id, $systemID) { + })), + ...array_map(function ($i) use ($systemID) { $i["_system"] = $systemID === "gdapd" ? "ynmuc" : "gdapd"; return $i; }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($id, $systemID) { global $travelling; return $travelling[$i['id']]['travelling'] && in_array($id, parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $i['id'] . ".json"), true))["species"]); - }) + })) ]; ?> @@ -26,7 +26,7 @@ function species(array $members, string $id, string $name) { global $systemID; ? <div class="relation-item" style="margin-left:10px;padding:0 20px;"> <?php if (count($members) > 0): ?> <?php $index = 0; foreach ($members as $member): ?> - <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?> + <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?> <?php else: ?>-<?php endif; ?> </div> </div> |