1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
<?php global $system; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:compare"]["name"] . " · " . $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">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>
<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"]) + count($metadata["caretakers"]) === 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["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; ?>
<?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'; ?>
|