summaryrefslogtreecommitdiff
path: root/includes/system/compare.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-08-26 22:29:23 +0200
committerMinteck <contact@minteck.org>2022-08-26 22:29:23 +0200
commit09bd0164ebc020a54b944b7326dcba496fb5d82c (patch)
tree0c5e765e627ecc94e534ccb6e2bc83917d58dc4c /includes/system/compare.php
parenta2df9a69dcc14cb70118cda2ded499055e7ee358 (diff)
downloadpluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.tar.gz
pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.tar.bz2
pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.zip
idk when was the last commit so I'm making a new one - Violet Dawn
Diffstat (limited to 'includes/system/compare.php')
-rw-r--r--includes/system/compare.php54
1 files changed, 25 insertions, 29 deletions
diff --git a/includes/system/compare.php b/includes/system/compare.php
index 6d69cd0..f597cf3 100644
--- a/includes/system/compare.php
+++ b/includes/system/compare.php
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; $title = "Compare members · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php';
+<?php global $system; global $systemCommonName; global $systemID; $title = "Compare members · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; global $travelling;
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true);
@@ -70,14 +70,6 @@ function getMember(string $id) {
<span class="comparison-header-l5">Ltl.</span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0">Not talking</span>
- <span class="comparison-header-l1">No talk</span>
- <span class="comparison-header-l2">No talk</span>
- <span class="comparison-header-l3">NT.</span>
- <span class="comparison-header-l4">NT.</span>
- <span class="comparison-header-l5">NT.</span>
- </span>
- <span class="comparison-header comparison-item">
<span class="comparison-header-l0">Protector</span>
<span class="comparison-header-l1">Protector</span>
<span class="comparison-header-l2">Protect.</span>
@@ -97,41 +89,41 @@ function getMember(string $id) {
}
?>
- <a title="<?= $member["display_name"] ?? $member["name"] ?>" data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" href="/<?= $systemID === "gdapd" ? "raindrops" : "cloudburst" ?>/<?= $member["name"] ?>">
- <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member['name'] . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <span style="vertical-align: middle;"><span class="comparison-name-full"><?= $member["display_name"] ?? $member["name"] ?></span><span class="comparison-name-small"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></span>
+ <a title="<?= $member["display_name"] ?? $member["name"] ?>" data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" 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;"> <span style="vertical-align: middle;"><span class="comparison-name-full"><?= $member["display_name"] ?? $member["name"] ?></span><span class="comparison-name-small"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></span>
<span class="comparison-colors" style="background-color: #<?= $member["color"] ?? "ffffff" ?>; height: 16px; width: 16px;display: inline-block;vertical-align: middle;border-radius:2px;"></span>
</a>
<span class="comparison-item">
<?php foreach ($metadata["species"] ?? [] as $species): ?>
<img data-bs-toggle="tooltip" title="<?php switch ($species) {
case "earth":
- if ($metadata["robot"]) echo "Robot earth pony"; else echo "Earth pony";
+ if ($metadata["robot"]) echo "Robot earth pony"; else if ($metadata["plush"]) echo "Earth pony plush"; else echo "Earth pony";
break;
case "alicorn":
- if ($metadata["robot"]) echo "Robot alicorn"; else echo "Alicorn";
+ if ($metadata["robot"]) echo "Robot alicorn"; else if ($metadata["plush"]) echo "Alicorn plush"; else echo "Alicorn";
break;
case "crystal":
- if ($metadata["robot"]) echo "Robot crystal pony"; else echo "Crystal pony";
+ if ($metadata["robot"]) echo "Robot crystal pony"; else if ($metadata["plush"]) echo "Crystal pony plush"; else echo "Crystal pony";
break;
case "pegasus":
- if ($metadata["robot"]) echo "Robot pegasus"; else echo "Pegasus";
+ if ($metadata["robot"]) echo "Robot pegasus"; else if ($metadata["plush"]) echo "Pegasus plush"; else echo "Pegasus";
break;
case "batpony":
- if ($metadata["robot"]) echo "Robot bat pony"; else echo "Bat pony";
+ if ($metadata["robot"]) echo "Robot bat pony"; else if ($metadata["plush"]) echo "Bat pony plush"; else echo "Bat pony";
break;
case "unicorn":
- if ($metadata["robot"]) echo "Robot unicorn"; else echo "Unicorn";
+ if ($metadata["robot"]) echo "Robot unicorn"; else if ($metadata["plush"]) echo "Unicorn plush"; else echo "Unicorn";
break;
default:
echo $species . "_" . $metadata["robot"];
break;
- } ?>" style="width:24px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/<?= $species ?><?= $metadata["robot"] ? "-robot" : "" ?>.png" alt="<?= $species ?>">
+ } ?>" 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>
<span class="comparison-item">
@@ -143,15 +135,22 @@ function getMember(string $id) {
<?php $index = 0; foreach ($metadata["marefriends"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) {
global $mfMemberID;
return $item["id"] === $mfMemberID;
- }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link" href="/<?= $mfSystem === "gdapd" ? "raindrops" : "cloudburst" ?>/<?= $mfMember["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "" ?>.png" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["sisters"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) {
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "" ?>.png" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["sisters"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) {
+ global $mfMemberID;
+ return $item["id"] === $mfMemberID;
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "" ?>.png" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["caretakers"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) {
global $mfMemberID;
return $item["id"] === $mfMemberID;
- }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link" href="/<?= $mfSystem === "gdapd" ? "raindrops" : "cloudburst" ?>/<?= $mfMember["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "" ?>.png" style="width:24px;"></a><?php $index++; endforeach; ?>
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Caretaker" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "" ?>.png" style="width:24px;"></a><?php $index++; endforeach; ?>
</span>
</span>
<span class="comparison-item">
<?php if ($metadata["host"]): ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <?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 else: ?>
+ <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <?php endif; ?>
<?php else: ?>
<img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
<?php endif; ?>
@@ -173,15 +172,12 @@ function getMember(string $id) {
<?php endif; ?>
</span>
<span class="comparison-item">
- <?php if ($metadata["not_talking"]): ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
- <?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
- <?php endif; ?>
- </span>
- <span class="comparison-item">
<?php if ($metadata["protector"]): ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <?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 else: ?>
+ <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <?php endif; ?>
<?php else: ?>
<img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
<?php endif; ?>