summaryrefslogtreecommitdiff
path: root/includes/system/compare.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-10-10 20:51:39 +0200
committerMinteck <contact@minteck.org>2022-10-10 20:51:39 +0200
commit108525534c28013cfe1897c30e4565f9893f3766 (patch)
treedd3e5132971f96ab5f05e7f3f8f6dbbf379a19bd /includes/system/compare.inc
parent2162eaa06f7e4764eb3dcfe130ec2c711d0c62ab (diff)
downloadpluralconnect-108525534c28013cfe1897c30e4565f9893f3766.tar.gz
pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.tar.bz2
pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.zip
Update
Diffstat (limited to 'includes/system/compare.inc')
-rw-r--r--includes/system/compare.inc189
1 files changed, 189 insertions, 0 deletions
diff --git a/includes/system/compare.inc b/includes/system/compare.inc
new file mode 100644
index 0000000..de777aa
--- /dev/null
+++ b/includes/system/compare.inc
@@ -0,0 +1,189 @@
+<?php global $system; global $systemCommonName; global $systemID; $title = "Compare members ยท " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling;
+
+$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true);
+
+function getMember(string $id) {
+ global $systemID;
+ global $members;
+
+ $member = null;
+
+ foreach ($members as $m) {
+ if ($m["id"] === $id) $member = $m;
+ }
+
+ return $member;
+}
+
+?>
+
+ <br>
+ <div class="container">
+ <h2>Compare members of the <?= $systemCommonName ?></h2>
+ <div class="comparison">
+ <span class="comparison-header comparison-item">
+ <span class="comparison-header-l0">Member</span>
+ <span class="comparison-header-l1">Member</span>
+ <span class="comparison-header-l2">Member</span>
+ <span class="comparison-header-l3">Member</span>
+ <span class="comparison-header-l4">Member</span>
+ <span class="comparison-header-l5"><abbr title="Member" data-bs-toggle="tooltip">Mmbr.</abbr></span>
+ </span>
+ <span class="comparison-header comparison-item">
+ <span class="comparison-header-l0">Species</span>
+ <span class="comparison-header-l1">Species</span>
+ <span class="comparison-header-l2">Species</span>
+ <span class="comparison-header-l3">Species</span>
+ <span class="comparison-header-l4"><abbr title="Species" data-bs-toggle="tooltip">Spec.</abbr></span>
+ <span class="comparison-header-l5"><abbr title="Species" data-bs-toggle="tooltip">Spec.</abbr></span>
+ </span>
+ <span class="comparison-header comparison-item">
+ <span class="comparison-header-l0">Relations</span>
+ <span class="comparison-header-l1">Relations</span>
+ <span class="comparison-header-l2">Relations</span>
+ <span class="comparison-header-l3">Relations</span>
+ <span class="comparison-header-l4"><abbr title="Relations" data-bs-toggle="tooltip">Relt.</abbr></span>
+ <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>
+ <span class="comparison-header comparison-item">
+ <span class="comparison-header-l0">Fictive</span>
+ <span class="comparison-header-l1">Fictive</span>
+ <span class="comparison-header-l2">Fictive</span>
+ <span class="comparison-header-l3">Fictive</span>
+ <span class="comparison-header-l4"><abbr title="Fictive" data-bs-toggle="tooltip">Fic.</abbr></span>
+ <span class="comparison-header-l5"><abbr title="Fictive" data-bs-toggle="tooltip">Fic.</abbr></span>
+ </span>
+ <span class="comparison-header comparison-item">
+ <span class="comparison-header-l0">Little</span>
+ <span class="comparison-header-l1">Little</span>
+ <span class="comparison-header-l2">Little</span>
+ <span class="comparison-header-l3">Little</span>
+ <span class="comparison-header-l4"><abbr title="Little" data-bs-toggle="tooltip">Ltl.</abbr></span>
+ <span class="comparison-header-l5"><abbr title="Little" data-bs-toggle="tooltip">Ltl.</abbr></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"><abbr title="Protector" data-bs-toggle="tooltip">Protect.</abbr></span>
+ <span class="comparison-header-l3"><abbr title="Protector" data-bs-toggle="tooltip">Protect.</abbr></span>
+ <span class="comparison-header-l4"><abbr title="Protector" data-bs-toggle="tooltip">Prt.</abbr></span>
+ <span class="comparison-header-l5"><abbr title="Protector" data-bs-toggle="tooltip">Prt.</abbr></span>
+ </span>
+
+ <?php foreach (scoreOrder($members, $systemID) as $member):
+
+ $metadata = $member["_metadata"];
+
+ if ($member["name"] === "scootaloo") {
+ if ((int)date('j') % 2 === 0) {
+ $metadata["marefriends"] = array_reverse($metadata["marefriends"]);
+ }
+ }
+
+ ?>
+ <a title="<?= $member["display_name"] ?? $member["name"] ?>" data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" href="/<?= $member["name"] ?>">
+ <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" 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 if ($metadata["plush"]) echo "Earth pony plush"; else echo "Earth pony";
+ break;
+
+ case "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 if ($metadata["plush"]) echo "Crystal pony plush"; else echo "Crystal pony";
+ break;
+
+ case "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 if ($metadata["plush"]) echo "Bat pony plush"; else echo "Bat pony";
+ break;
+
+ case "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" : ($metadata["plush"] ? "-plush" : "") ?>.png" alt="<?= $species ?>">
+ <?php endforeach; ?>
+ </span>
+ <span class="comparison-item">
+ <?= count($metadata["marefriends"]) + count($metadata["sisters"]) === 0 ? "-" : "" ?>
+ <span class="comparison-relations-count">
+ <?= count($metadata["marefriends"]) + count($metadata["sisters"]) > 0 ? count($metadata["marefriends"]) + count($metadata["sisters"]) : "" ?>
+ </span>
+ <span class="comparison-relations-full">
+ <?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 tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" 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="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" 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>Caretaker" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?>
+ </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 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; ?>
+ </span>
+ <span class="comparison-item">
+ <?php if ($metadata["fictive"]): ?>
+ <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["little"] >= 2): ?>
+ <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <?php elseif ($metadata["little"] === 1): ?>
+ <img data-bs-toggle="tooltip" title="Age regressor" src="/assets/icons/partial.svg" alt="Partial" 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"]): ?>
+ <?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; ?>
+ </span>
+ <?php endforeach; ?>
+ </div>
+ </div>
+
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file