summaryrefslogtreecommitdiff
path: root/includes/system
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-11-11 23:47:49 +0100
committerMinteck <contact@minteck.org>2022-11-11 23:47:49 +0100
commit209356b8ade1920b50d1d3a1a5e121c6623d167b (patch)
tree5301396987d1510f715a0b1c24754873af19e1dc /includes/system
parent2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (diff)
downloadpluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.tar.gz
pluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.tar.bz2
pluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.zip
Update
Diffstat (limited to 'includes/system')
-rw-r--r--includes/system/compare.inc20
-rw-r--r--includes/system/species.inc12
2 files changed, 16 insertions, 16 deletions
diff --git a/includes/system/compare.inc b/includes/system/compare.inc
index d2023e4..d7fbdc6 100644
--- a/includes/system/compare.inc
+++ b/includes/system/compare.inc
@@ -46,12 +46,12 @@ function getMember(string $id) {
<span class="comparison-header-l5"><abbr title="Relations" data-bs-toggle="tooltip">Relt.</abbr></span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l1"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l2"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l3"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l4"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l5"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
+ <span class="comparison-header-l0">Memory</span>
+ <span class="comparison-header-l1">Memory</span>
+ <span class="comparison-header-l2">Memory</span>
+ <span class="comparison-header-l3">Memory</span>
+ <span class="comparison-header-l4"><abbr title="Memory" data-bs-toggle="tooltip">Mem.</abbr></span>
+ <span class="comparison-header-l5"><abbr title="Memory" data-bs-toggle="tooltip">Mem.</abbr></span>
</span>
<span class="comparison-header comparison-item">
<span class="comparison-header-l0">Fictive</span>
@@ -127,7 +127,7 @@ function getMember(string $id) {
<?php endforeach; ?>
</span>
<span class="comparison-item">
- <?= count($metadata["marefriends"]) + count($metadata["sisters"]) === 0 ? "-" : "" ?>
+ <?= count($metadata["marefriends"]) + count($metadata["sisters"]) + count($metadata["caretakers"]) === 0 ? "-" : "" ?>
<span class="comparison-relations-count">
<?= count($metadata["marefriends"]) + count($metadata["sisters"]) > 0 ? count($metadata["marefriends"]) + count($metadata["sisters"]) : "" ?>
</span>
@@ -145,9 +145,9 @@ function getMember(string $id) {
</span>
</span>
<span class="comparison-item">
- <?php if ($metadata["host"]): ?>
- <?php if ($travelling[$member["id"]]["travelling"]): ?>
- <img data-bs-toggle="tooltip" title="Yes, but currently travelling" src="/assets/icons/partial.svg" alt="Yes, but currently travelling" style="width:24px;">
+ <?php if ($metadata["shared_memory"] > 0): ?>
+ <?php if ($metadata["shared_memory"] === 1): ?>
+ <img data-bs-toggle="tooltip" title="Partial" src="/assets/icons/partial.svg" alt="Partial" style="width:24px;">
<?php else: ?>
<img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
<?php endif; ?>
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">, &nbsp;</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">, &nbsp;</span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?>
<?php else: ?>-<?php endif; ?>
</div>
</div>