summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/ai.inc311
-rw-r--r--includes/assets.inc1
-rw-r--r--includes/banner.inc83
-rw-r--r--includes/bitset.inc6
-rw-r--r--includes/details.inc33
-rw-r--r--includes/footer.inc27
-rw-r--r--includes/fullbanner.inc55
-rw-r--r--includes/functions.inc55
-rw-r--r--includes/header.inc4
-rw-r--r--includes/init.inc3
-rw-r--r--includes/language.inc14
-rw-r--r--includes/logo.inc110
-rw-r--r--includes/member.inc25
-rw-r--r--includes/member/hierarchy.inc179
-rw-r--r--includes/member/tree.inc8
-rw-r--r--includes/metadata.inc105
-rw-r--r--includes/navbar.inc8
-rw-r--r--includes/navigation.inc167
-rw-r--r--includes/pages.json227
-rw-r--r--includes/pane.inc33
-rw-r--r--includes/profiles.inc97
-rw-r--r--includes/rainbow.inc13
-rw-r--r--includes/score.inc13
-rw-r--r--includes/search.inc26
-rw-r--r--includes/short.inc6
-rw-r--r--includes/subsysbanner.inc11
-rw-r--r--includes/sysbanner.inc37
-rw-r--r--includes/system/compare.inc138
-rw-r--r--includes/system/history.inc46
-rw-r--r--includes/system/species.inc16
-rw-r--r--includes/system/subsystem.inc2
-rw-r--r--includes/system/tree.inc14
-rw-r--r--includes/titlebar.inc81
-rw-r--r--includes/travelling.inc8
34 files changed, 1044 insertions, 918 deletions
diff --git a/includes/ai.inc b/includes/ai.inc
deleted file mode 100644
index 8f5f7ba..0000000
--- a/includes/ai.inc
+++ /dev/null
@@ -1,311 +0,0 @@
-<?php
-
-global $memberData;
-global $metadata;
-global $systemCommonName;
-global $system;
-
-$profile = [
- hexdec(substr(md5($memberData["id"]), 0, 1)),
- hexdec(substr(sha1($memberData["id"]), 0, 1)),
- hexdec(substr(md5(strrev($memberData["id"])), 0, 1)),
- hexdec(substr(sha1(strrev($memberData["id"])), 0, 1)),
- hexdec(substr(md5(strtoupper($memberData["id"])), 0, 1)),
- hexdec(substr(sha1(strtoupper($memberData["id"])), 0, 1)),
- hexdec(substr(md5(strtoupper(strrev($memberData["id"]))), 0, 1)),
- hexdec(substr(sha1(strtoupper(strrev($memberData["id"]))), 0, 1)),
-];
-
-if (!function_exists("component")) {
- function component(int $parts, int $num, int $index = 0): bool {
- global $profile;
-
- $item = round(15 / $parts);
- $split = (int)round($profile[$index] / $item);
-
- return $split === $num;
- }
-}
-
-if (!function_exists("shouldHaveAn")) {
- function shouldHaveAn(string $str): bool {
- if (in_array(substr(strtolower($str), 0, 1), ["a", "e", "i", "o", "u", "y", "h"])) {
- return true;
- } else {
- return false;
- }
- }
-}
-
-if (!function_exists("getSpeciesName")) {
- function getSpeciesName(string $species, bool $canHaveMareSuffix = false): string {
- global $metadata;
-
- return match ($species) {
- "earth" => $metadata["robot"] ?
- "robot earth pony" :
- (!$metadata["plush"] ? "earth pony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") :
- "earth pony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"),
- "alicorn" => $metadata["robot"] ?
- "robot alicorn" :
- (!$metadata["plush"] ? "alicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") :
- "alicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"),
- "crystal" => $metadata["robot"] ?
- "robot crystal pony" :
- (!$metadata["plush"] ? "crystal pony" :
- "crystal pony plush"),
- "pegasus" => $metadata["robot"] ?
- "robot pegasus" :
- (!$metadata["plush"] ? "pegasus" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") :
- "pegasus" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"),
- "batpony" => $metadata["robot"] ?
- "robot batpony" :
- (!$metadata["plush"] ? "batpony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") :
- "batpony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"),
- "unicorn" => $metadata["robot"] ?
- "robot unicorn" :
- (!$metadata["plush"] ? "unicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") :
- "unicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"),
- default => $species . "_" . $metadata["robot"]
- };
- }
-}
-
-if (!function_exists("listing")) {
- function listing(array $list): string {
- $out = "";
-
- foreach (array_values($list) as $index => $value) {
- $mem = getSystemMember(explode("/", $value)[0], explode("/", $value)[1]);
- $value = "<a href='/" . $mem["name"] . "'>" . getMiniName($mem["display_name"] ?? $mem["name"]) . "</a>";
-
- if ($index === 0) {
- $out = $value;
- } else if ($index < count(array_values($list)) - 1) {
- $out .= ", " . $value;
- } else {
- $out .= " and " . $value;
- }
- }
-
- return $out;
- }
-}
-
-$iam = 0;
-$multipleNames = count(explode("/", $memberData["display_name"])) > 1;
-
-$otherNames = explode("/", $memberData["display_name"]);
-array_shift($otherNames);
-
-if ($memberData["name"] === "scootaloo" && ((int)date('N') - 1) % 2 === 0) {
- $metadata["marefriends"] = array_reverse($metadata["marefriends"]);
-}
-
-?>
-
-<!-- Intro -->
-<p>
-<?php if (component(4, 1)): ?>
- Hello,
-<?php elseif (component(4, 2)): ?>
- Hi,
-<?php elseif (component(4, 3)): ?>
- Hey,
-<?php else: ?>
- Hey there!</p><p>
-<?php endif; ?>
-
-<!-- Name -->
-<?= component(3, 2, 2) ? (component(4, 4) ? "My name is" : "my name is") : (component(3, 1, 2) ? "I am" : "I'm") ?> <?= explode("/", $memberData["display_name"] ?? $memberData["name"])[0] ?><?= $multipleNames && component(2, 1, 4) ? " (or " . implode("/", $otherNames) . ")" : "" ?>,
-
-<!-- Role -->
-<?= component(2, 2, 1) ? "I'm " : "I am " ?><?php $iam++; ?>
-<?php if ($metadata["host"]): ?>the most common fronter
-<?php elseif ($metadata["protector"]): ?>a protector
-<?php else: ?><?= component(2, 2, 0) ? "part" : "a member" ?> <?php endif; ?>
-of the <a href="/<?= $system ?>"><?= $systemCommonName ?></a>,<?php if (isset($metadata["median"])): ?>
- <?php if ($metadata["little"] > 0): $source = getMember($metadata["median"]); ?><?php $iam++; ?><?= component(2, 2, 2) ? "I'm " : "I am " ?><?php $iam++; ?><?= component(2, 2, 4) ? "an age regressed version of" : "age regressed from" ?> <a href="/<?= $source["name"] ?>"><?= getMiniName($source["display_name"] ?? $source["name"]) ?></a>,<?php endif; ?>
-<?php endif; ?> <?= ($iam >= 3) ? "and" : (component(2, 2, 1) ? "I'm" : "I am") ?><?php $iam++; ?>
-
-<!-- Species -->
-<?php if ($iam >= 3 && component(2, 1, 4)): ?>also <?php endif; ?>
-<?php if (count($metadata["species"]) === 2): ?>
-<?= component(2, 1) ? "both " : "" ?>a<?= shouldHaveAn(getSpeciesName($metadata["species"][0])) ? "n" : "" ?> <?= getSpeciesName($metadata["species"][0]) ?> and a<?= shouldHaveAn(getSpeciesName($metadata["species"][1])) ? "n" : "" ?> <?= getSpeciesName($metadata["species"][1], true) ?>
-<?php elseif (count($metadata["species"]) === 3): ?>
-a<?= shouldHaveAn(getSpeciesName($metadata["species"][0])) ? "n" : "" ?> <?= getSpeciesName($metadata["species"][0]) ?>, a<?= shouldHaveAn(getSpeciesName($metadata["species"][1])) ? "n" : "" ?> <?= getSpeciesName($metadata["species"][1]) ?> and a<?= shouldHaveAn(getSpeciesName($metadata["species"][2])) ? "n" : "" ?> <?= getSpeciesName($metadata["species"][2], true) ?>
-<?php else: ?>
-a<?= shouldHaveAn(getSpeciesName($metadata["species"][0])) ? "n" : "" ?> <?= getSpeciesName($metadata["species"][0], true) ?><?php endif; ?><?php if ($iam >= 3 && component(2, 2, 4)): ?> too<?php endif; ?><!-- Pronouns --><?php if (isset($memberData["pronouns"]) && $memberData["pronouns"] !== "she/her"): ?>
-, <?= component(3, 1, 3) ? "I use " . $memberData["pronouns"] . " pronouns" : (component(3, 2, 3) ? "my pronouns are " . $memberData["pronouns"] : "I go with " . $memberData["pronouns"]) ?>
-<?php endif; ?>.
-
-</p>
-
-<p>
-<!-- Shared memory -->
-<?php $iamFacts = 0; $factGiven = false; if ($metadata["shared_memory"] === 1): ?>
- <?php $factGiven = true;
- if (component(3, 1, 4)): ?>
- Depending on the circumstances, I may not share memories with my headmates
- <?php elseif (component(3, 2, 4)): ?>
- I may not share memories with my headmates depending on the circumstances
- <?php else: ?>
- I sometimes <?= component(2, 2, 1) ? "don't" : "do not" ?> share memories with my headmates
- <?php endif; ?>
-<?php elseif ($metadata["shared_memory"] === 0): ?>
- <?php $factGiven = true;
- if (component(3, 1, 4)): ?>
- I <?= component(2, 2, 1) ? "don't" : "do not" ?> share memories with my headmates
- <?php elseif (component(3, 2, 4)): ?>
- I <?= component(2, 2, 1) ? "don't" : "do not" ?> have access to my headmates' memories
- <?php else: ?>
- I <?= component(2, 2, 1) ? "can't" : "cannot" ?> have access to my headmates' memories
- <?php endif; ?>
-<?php endif; ?>
-
-<!-- Fictive -->
-<?php if ($metadata["fictive"]): ?>
- <?php if (component(3, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; ?> a fictive
- <?php elseif (component(3, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; ?> from Equestria
- <?php else: ?><?= $factGiven ? " and" : ""?>
- I come from Equestria
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-<!-- Less frequent -->
-<?php if ($metadata["less_frequent"]): ?>
- <?php if (component(3, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; ?> fronting less often
- <?php elseif (component(3, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; ?> less often at front
- <?php else: ?><?= $factGiven ? " and" : ""?>
- I like to front less often
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-<!-- Non verbal IRL -->
-<?php if ($metadata["nonverbal"]): ?>
- <?php if (component(3, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; ?> nonverbal in real life
- <?php elseif (component(3, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; ?> not talking in real life
- <?php else: ?><?= $factGiven ? " and" : ""?>
- I don't talk in real life
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-<!-- Age regression -->
-<?php if ($metadata["little"] === 1): ?>
- <?php if (component(3, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- an age regressor
- <?php elseif (component(3, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- capable of age regression
- <?php else: ?><?= $factGiven ? " and" : ""?>
- I can age regress
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-<!-- Younger -->
-<?php if ($metadata["little"] === 3): ?>
- <?php if (component(3, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- younger than the body is
- <?php elseif (component(3, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- younger but not enough to be considered a little
- <?php else: ?><?= $factGiven ? " and" : ""?>
- I feel <?= component(2, 2, 5) ? "kinda" : "kind of" ?> younger than my headmates
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-<!-- Age spells -->
-<?php if ($metadata["age_spells"] && $metadata["little"] !== 1 && !(isset($metadata["median"]) && $metadata["little"] > 0)): ?>
- <?php if (component(3, 1, 4)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- affected by spells to make me feel younger
- <?php elseif (component(3, 2, 4)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- affected by age spells
- <?php else: ?><?= $factGiven ? " and" : ""?>
- age regression spells can affect me
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-<!-- Little -->
-<?php if ($metadata["little"] === 2): ?>
- <?php if (component(3, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- a lot younger than the body is
- <?php elseif (component(3, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- a little
- <?php else: ?><?= $factGiven ? " and" : ""?>
- I feel a lot younger than my headmates
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-</p>
-
-<p>
-
-<!-- Marefriends -->
-<?php $factGiven = false; $iamFacts = 0; if (count($metadata["marefriends"]) > 0): ?>
- <?php if (component(4, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- <?php if (count($metadata["marefriends"]) > 1): ?>in relationships with<?php else: ?>in a relationship with<?php endif; ?> <?= listing($metadata["marefriends"]) ?>
- <?php elseif (component(4, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?php endif; ?>
- <?php if (count($metadata["marefriends"]) > 1): ?>My marefriends are<?php else: ?>My marefriend is<?php endif; ?> <?= listing($metadata["marefriends"]) ?>
- <?php elseif (component(4, 3, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?php endif; ?>
- <?= listing($metadata["marefriends"]) ?> <?php if (count($metadata["marefriends"]) > 1): ?>are my marefriends<?php else: ?>is my marefriend<?php endif; ?>
- <?php else: ?><?= $factGiven ? " and" : ""?>
- I love <?= listing($metadata["marefriends"]) ?>
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-<!-- Sisters -->
-<?php if (count($metadata["sisters"]) > 0): ?>
- <?php if (component(4, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- <?php if (count($metadata["sisters"]) > 1): ?>in relationships with<?php else: ?>in a relationship with<?php endif; ?> <?= listing($metadata["sisters"]) ?>
- <?php elseif (component(4, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?php endif; ?>
- <?= $factGiven ? "my" : "My"?><?php if (count($metadata["sisters"]) > 1): ?> sisters are<?php else: ?> sister is<?php endif; ?> <?= listing($metadata["sisters"]) ?>
- <?php elseif (component(4, 3, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?php endif; ?>
- <?= listing($metadata["sisters"]) ?> <?php if (count($metadata["sisters"]) > 1): ?>are my sisters<?php else: ?>is my sister<?php endif; ?>
- <?php else: ?><?= $factGiven ? " and" : ""?>
- <?php if ($factGiven): ?>
- I also love <?= listing($metadata["sisters"]) ?> as sister<?php if (count($metadata["sisters"]) > 1): ?>s<?php endif; ?>
- <?php else: ?>
- <?= listing($metadata["sisters"]) ?> <?php if (count($metadata["sisters"]) > 1): ?>are my family<?php else: ?>is my family<?php endif; ?>
- <?php endif; ?>
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-<!-- Caretakers -->
-<?php if (count($metadata["caretakers"]) > 0): ?>
- <?php if (component(4, 1, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?= component(2, 2, 0) ? "I'm" : "I am" ?><?php $iamFacts++; endif; ?>
- being taken care of by <?= listing($metadata["caretakers"]) ?>
- <?php elseif (component(4, 2, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?php endif; ?>
- <?= $factGiven ? "the" : "The"?><?php if (count($metadata["caretakers"]) > 1): ?> mares who take care of me are<?php else: ?> mare who takes care of me is<?php endif; ?> <?= listing($metadata["caretakers"]) ?>
- <?php elseif (component(4, 3, 5)): ?><?= $factGiven ? " and" : ""?>
- <?php if ($iamFacts > 0): ?><?php else: ?><?php endif; ?>
- <?= listing($metadata["caretakers"]) ?> <?php if (count($metadata["caretakers"]) > 1): ?>are my caretakers<?php else: ?>is my caretaker<?php endif; ?>
- <?php else: ?><?= $factGiven ? " and" : ""?>
- <?php if ($factGiven): ?>
- I like having <?= listing($metadata["caretakers"]) ?> take care of me
- <?php else: ?>
- <?= listing($metadata["caretakers"]) ?> take care of me
- <?php endif; ?>
- <?php endif; ?>
-<?php $factGiven = true; endif; ?>
-
-</p> \ No newline at end of file
diff --git a/includes/assets.inc b/includes/assets.inc
index 3f9971a..05296ce 100644
--- a/includes/assets.inc
+++ b/includes/assets.inc
@@ -13,7 +13,6 @@ function downloadAssets($system) {
echo(" /avatars/$id.webp\n");
file_put_contents("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION), file_get_contents($general['avatar_url']));
exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" ../assets/avatars/" . $id . ".webp");
- exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" ../assets/uploads/" . ($id === "gdapd" ? "raindrops" : "cloudburst") . ".png");
unlink("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION));
}
diff --git a/includes/banner.inc b/includes/banner.inc
index e1b06be..d62ba97 100644
--- a/includes/banner.inc
+++ b/includes/banner.inc
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $lang; global $pages;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/pronouns.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
@@ -47,6 +47,9 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
global $subsystems;
global $travelling;
global $isLoggedIn;
+ global $lang;
+
+ $french = $lang["_french"];
$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$system.json"), true) ?? [];
@@ -188,7 +191,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
];
}
- if ($travelling[$member['id']]["travelling"]) {
+ if ($travelling[$member['id']]["travelling"] && !$travelling[$member['id']]["equestria"]) {
$systemData['page'] = "/" . ($system === "gdapd" ? "cloudburst" : "raindrops");
$systemData['icon'] = ($system === "gdapd" ? "cloudburst" : "raindrops") . ".png";
$systemData['name'] = $system === "gdapd" ? "Cloudburst" : "Raindrops";
@@ -197,6 +200,16 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
$systemData['temporary'] = true;
}
+
+ if ($travelling[$member['id']]["travelling"] && $travelling[$member['id']]["equestria"]) {
+ $systemData['page'] = null;
+ $systemData['icon'] = "../logo/equestria.png";
+ $systemData['name'] = "Equestria";
+ $systemData['full_name'] = "Equestria";
+ $systemData['subsystem'] = null;
+ $systemData['temporary'] = true;
+ }
+
$marefriends = [];
foreach ($metadata["marefriends"] as $marefriend) {
$mfSystem = explode("/", $marefriend)[0];
@@ -268,7 +281,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
"html" => (
$french
?
- '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronteuse la plus présente</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' the one who fronts the most often in ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' system." class="badge rounded-pill bg-primary">Fronteuse la plus présente</span>'
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronteuse la plus présente</b><br>Elle est le membre qui fronte le plus dans son système." class="badge rounded-pill bg-primary">Fronteuse la plus présente</span>'
:
'<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Most common fronter</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' the one who fronts the most often in ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' system." class="badge rounded-pill bg-primary">Most common fronter</span>'
)
@@ -276,13 +289,13 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
}
}
- if (($metadata["age_spells"] ?? false) && !$french) {
+ /*if (($metadata["age_spells"] ?? false) && !$french) {
$badges[] = [
"id" => "age_spells",
"color" => "#6f42c1",
"html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Affected by age spells</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' can feel younger than ' . getMemberPronouns($member['pronouns'])["subjective"] . ' actually ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' when somepony else casts an age spell on ' . getMemberPronouns($member['pronouns'])["object"] . '." class="badge rounded-pill" style="background-color: #6f42c1;">Affected by age spells</span>'
];
- }
+ }*/
if ($metadata["fictive"] ?? false) {
$badges[] = [
@@ -291,18 +304,38 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
"html" => (
$french
?
- '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fictive</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' based on the personality, look and behavior of a character that is fictional in this world." class="badge rounded-pill bg-info">Fictive</span>'
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fictive</b><br>Elle est basée sur la personnalité, apparence et comportement d\'un personnage qui est fictif dans ce monde." class="badge rounded-pill bg-info">Fictive</span>'
:
'<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fictive</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' based on the personality, look and behavior of a character that is fictional in this world." class="badge rounded-pill bg-info">Fictive</span>'
)
];
}
+ if ($metadata["persecutor"] ?? false) {
+ $badges[] = [
+ "id" => "persecutor",
+ "color" => "danger",
+ "html" => (
+ $french
+ ?
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Persécutrice</b><br>Elle se comporte de façon nuisible à l\'égart des autres ou des autres membres du système, potentiellement comme une tentative malavisée de protéger le système." class="badge rounded-pill bg-danger">Persécutrice</span>'
+ :
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Persecutor</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "acts" : "act") . ' harmfully towards other system members and/or others, potentially as a misguided attempt to protect the system." class="badge rounded-pill bg-danger">Persecutor</span>'
+ )
+ ];
+ }
+
if ($metadata["less_frequent"] ?? false) {
$badges[] = [
"id" => "nonverbal",
"color" => "#fd7e14",
- "html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronts less often</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "front" : "fronts") . ' less often than ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' headmates, this can due to various reasons." class="badge rounded-pill" style="background-color:#fd7e14;">Fronts less often</span>'
+ "html" => (
+ $french
+ ?
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronts less often</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "front" : "fronts") . ' less often than ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' headmates, this can due to various reasons." class="badge rounded-pill" style="background-color:#fd7e14;">Fronte moins souvent</span>'
+ :
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronts less often</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "front" : "fronts") . ' less often than ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' headmates, this can due to various reasons." class="badge rounded-pill" style="background-color:#fd7e14;">Fronts less often</span>'
+ )
];
}
@@ -310,7 +343,13 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
$badges[] = [
"id" => "nonverbal",
"color" => "#20c997",
- "html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Non verbal IRL</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' non verbal in real life, although text communication is still possible." class="badge rounded-pill" style="background-color:#20c997;">Non verbal IRL</span>'
+ "html" => (
+ $french
+ ?
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Non verbale dans la réalité</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' non verbal in real life, although text communication is still possible." class="badge rounded-pill" style="background-color:#20c997;">Non verbal IRL</span>'
+ :
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Non verbal IRL</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' non verbal in real life, although text communication is still possible." class="badge rounded-pill" style="background-color:#20c997;">Non verbal IRL</span>'
+ )
];
}
@@ -330,6 +369,20 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
];
}
+ if (($metadata["leader"] ?? false) && $isLoggedIn) {
+ $badges[] = [
+ "id" => "leader",
+ "color" => "d6a833",
+ "html" => (
+ $french
+ ?
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Leader</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a leader in ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' system." class="badge rounded-pill" style="background-color:#fd7e14;">Dirigeante</span>'
+ :
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Leader</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a leader in ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' system." class="badge rounded-pill" style="background-color:#fd7e14;">Leader</span>'
+ )
+ ];
+ }
+
if ($metadata["protector"] ?? false) {
$badges[] = [
"id" => "protector",
@@ -337,7 +390,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
"html" => (
$french
?
- '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protecteur·ice")) . '</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protecteur·ice")) . '</span>'
+ '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protectrice")) . '</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protectrice")) . '</span>'
:
'<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Protector</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">Protector</span>'
)
@@ -386,18 +439,6 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
'<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Age regressor</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' capable of regressing ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' mental age, which causes ' . getMemberPronouns($member['pronouns'])["object"] . ' to become ' . (getMiniName($regression["display_name"] ?? $regression["name"])) . ', temporarily behaving and feeling younger than the body is." class="badge rounded-pill bg-secondary">Age regresses into <a href="/' . $regression["name"] . '">'. (getMiniName($regression["display_name"] ?? $regression["name"])) . '</a></span>'
)
];
- } else {
- $badges[] = [
- "id" => "regressor",
- "color" => "secondary",
- "html" => (
- $french
- ?
- '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Régresseur d\'âge</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' capable of regressing ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' mental age, temporarily behaving and feeling younger than the body is." class="badge rounded-pill bg-secondary">Régresseur d\'âge</span>'
- :
- '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Age regressor</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' capable of regressing ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' mental age, temporarily behaving and feeling younger than the body is." class="badge rounded-pill bg-secondary">Age regressor</span>'
- )
- ];
}
}
diff --git a/includes/bitset.inc b/includes/bitset.inc
index 1d026e5..0bd5c4d 100644
--- a/includes/bitset.inc
+++ b/includes/bitset.inc
@@ -11,6 +11,8 @@ function parseBitset ($bitset) {
$lessFrequent = substr($bin, 14, 1) !== "0";
$sexuallyActive = substr($bin, 13, 1) !== "0";
$ageRegressor = substr($bin, 12, 1) !== "0";
+ $leader = substr($bin, 11, 1) !== "0";
+ $persecutor = substr($bin, 10, 1) !== "0";
$magic = bindec(substr($bin, 18, 3));
$sensitivity = bindec(substr($bin, 21, 3));
$protector = substr($bin, 29, 1) !== "0";
@@ -76,6 +78,8 @@ function parseBitset ($bitset) {
'less_frequent' => $lessFrequent,
'age_spells' => $age,
'age_regressor' => $ageRegressor,
+ 'leader' => $leader,
+ 'persecutor' => $persecutor,
'sexually_active' => $sexuallyActive,
'species' => array_filter([
$species1,
@@ -92,7 +96,7 @@ function parseMetadata ($metadata) {
if ($metadata["bitset"]) {
$m = parseBitset($metadata["bitset"]);
$m["marefriends"] = $metadata["marefriends"] ?? [];
- $m["bitset"] = $metadata["bitset"] ?? [];
+ $m["bitset"] = $metadata["bitset"] ?? 0;
$m["sisters"] = $metadata["sisters"] ?? [];
$m["regression"] = $metadata["regression"] ?? null;
$m["caretakers"] = $metadata["caretakers"] ?? [];
diff --git a/includes/details.inc b/includes/details.inc
index abd07bc..e4ee519 100644
--- a/includes/details.inc
+++ b/includes/details.inc
@@ -1,31 +1,20 @@
-<?php global $isLoggedIn; global $metadata; global $memberData; ?>
-<div id="member-details" class="<?= $isLoggedIn ? 'member-details-loggedIn' : '' ?>" style="<?php if (!$isLoggedIn): ?>grid-template-columns: repeat(3, 1fr);<?php endif; ?> background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
+<?php global $isLoggedIn; global $metadata; global $memberData; global $lang; global $pages; ?>
+<div id="member-details" class="<?= $isLoggedIn ? 'member-details-loggedIn' : '' ?>" style="<?php if (!$isLoggedIn): ?>grid-template-columns: repeat(2, 1fr);<?php endif; ?> background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
<div>
- <b>Food:</b><span class="member-small-separator"><br></span>
+ <b><?= $lang["details"]["food"] ?></b><span class="member-small-separator"><br></span>
<?= match ($metadata["food"]) {
- 0 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"])) . " species indicates that " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($memberData["pronouns"])["third"] ? "doesn&apos;t" : "don&apos;t") . " need to eat food, therefore " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"]) . " can eat all foods.'>Not needed</span>",
- 1 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can&apos;t eat fish or meat.'>Not animals</span>",
- 2 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can&apos;t eat meat, but can eat fish.'>Not meat</span>",
- 3 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can eat all foods, meat and fish included.'>All</span>",
+ 0 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"])) . " species indicates that " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($memberData["pronouns"])["third"] ? "doesn&apos;t" : "don&apos;t") . " need to eat food, therefore " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"]) . " can eat all foods.'>" . $lang["details"]["food_states"][0] . "</span>",
+ 1 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can&apos;t eat fish or meat.'>" . $lang["details"]["food_states"][1] . "</span>",
+ 2 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can&apos;t eat meat, but can eat fish.'>" . $lang["details"]["food_states"][2] . "</span>",
+ 3 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can eat all foods, meat and fish included.'>" . $lang["details"]["food_states"][3] . "</span>",
} ?>
</div>
<div>
- <b>Shared memory:</b><span class="member-small-separator"><br></span>
+ <b><?= $lang["details"]["memory"] ?></b><span class="member-small-separator"><br></span>
<?= match ($metadata["shared_memory"]) {
- 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " doesn&apos;t directly share" : " don&apos;t directly share") . " memory with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates, but is able to (slowly) query it if that is needed.'>None</span>",
- 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " doesn&apos;t directly shares" : " don&apos;t directly share") . " all memories with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates, but may be able to share certain memories and/or share memories at will.'>Partial</span>",
- 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " shares" : " share") . " all memories with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates.'>Full</span>",
- } ?>
- </div>
- <div>
- <b>Magic:</b><span class="member-small-separator"><br></span>
- <?= match ($metadata["magic"]) {
- 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " is unable to use magic at all.'>None</span>",
- 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can use magic in rare cases, such as when somepony else is pouring magic into " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " or when a physical event occurs.'>In some cases</span>",
- 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " horn.'>Horn</span>",
- 3 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " wings.'>Wings</span>",
- 4 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using both " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " horn and wings.'>Horn and wings</span>",
- 5 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using another part of " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body that is neither a horn or wings.'>Yes</span>",
+ 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " doesn&apos;t directly share" : " don&apos;t directly share") . " memory with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates, but is able to (slowly) query it if that is needed.'>" . $lang["details"]["memory_states"][0] . "</span>",
+ 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " doesn&apos;t directly shares" : " don&apos;t directly share") . " all memories with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates, but may be able to share certain memories and/or share memories at will.'>" . $lang["details"]["memory_states"][1] . "</span>",
+ 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " shares" : " share") . " all memories with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates.'>" . $lang["details"]["memory_states"][2] . "</span>",
} ?>
</div>
<?php if ($isLoggedIn): ?>
diff --git a/includes/footer.inc b/includes/footer.inc
index 6cf833c..b95ea78 100644
--- a/includes/footer.inc
+++ b/includes/footer.inc
@@ -4,17 +4,22 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
?>
-<hr>
-<div class="container text-muted">
- <?php
-
- $refresh = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/refresh.json"), true);
- $version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true);
-
- ?>
- © <?= date("Y") ?> <a href="https://equestria.horse" target="_blank" class="text-muted">Equestria.dev Developers</a> · version 2.<?= $version["build"] ?>.<?= hexdec(substr($version["hash"], 0, 4)) ?>.<?= $version["revision"] ?><br>
- <a href="/-/debug" class="text-muted" style="text-decoration: none;">Data updated <?= trim(timeAgo($refresh["timestamp"])) ?> (<?php if (time() - $refresh["timestamp"] > 360): ?>not updating; <?php endif; ?><?= date('D j M, G:i:s T', (int)$refresh["timestamp"]) ?>; took <?= round($refresh["duration"] * 1000) ?> ms, <?= count($refresh["restored"]) > 0 ? (count($refresh["restored"]) > 1 ? "reported " . count($refresh["restored"]) . " failures" : "reported 1 failure") : "no failures reported" ?>)</a>
- <br><br><br><br><br>
+<div id="footer-pre"></div>
+<div id="footer">
+ <hr>
+ <div class="container text-muted">
+ <?php
+
+ $refresh = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/refresh.json"), true);
+ $version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true);
+
+ global $lang; global $pages;
+
+ ?>
+ © <?= date("Y") ?> <a href="https://equestria.horse" target="_blank" class="text-muted"><?= $lang["footer"]["copyright"] ?></a> · version 2.<?= $version["build"] ?>.<?= hexdec(substr($version["hash"], 0, 4)) ?>.<?= $version["revision"] ?><br>
+ <a href="/-/debug" class="text-muted" style="text-decoration: none;"><?= $lang["footer"]["update"] ?> <?= trim(timeAgo($refresh["timestamp"], $lang["_french"])) ?> (<?php if (time() - $refresh["timestamp"] > 360): ?><?= $lang["footer"]["no_update"] ?><?= $lang["footer"]["separator"] ?>; <?php endif; ?><?= date('D j M, G:i:s T', (int)$refresh["timestamp"]) ?><?= $lang["footer"]["separator"] ?>; <?= $lang["footer"]["took"] ?> <?= round($refresh["duration"] * 1000) ?> ms, <?= count($refresh["restored"]) > 0 ? (count($refresh["restored"]) > 1 ? $lang["footer"]["failures"][0] . count($refresh["restored"]) . $lang["footer"]["failures"][1] : $lang["footer"]["failure"]) : $lang["footer"]["no_failure"] ?>)</a>
+ <br><br><br><br><br>
+ </div>
</div>
<script>
diff --git a/includes/fullbanner.inc b/includes/fullbanner.inc
index 1c449d3..24e0295 100644
--- a/includes/fullbanner.inc
+++ b/includes/fullbanner.inc
@@ -1,4 +1,4 @@
-<?php global $memberData; global $memberID; global $systemID; global $metadata; global $travelling; global $systemCommonName; global $member; ?>
+<?php global $memberData; global $memberID; global $systemID; global $metadata; global $travelling; global $systemCommonName; global $member; global $lang; global $pages; ?>
<script>
window.currentMemberData = JSON.parse(atob(`<?= base64_encode(json_encode(getMemberBannerData($memberID, $systemID, false))) ?>`));
</script>
@@ -11,7 +11,7 @@
<div id="member-banner"></div>
<?php endif; ?>
-<script src="/app/banner.js"></script><script>refreshBanner(false)</script>
+<script src="/app/banner.js"></script><script>refreshBanner(false, <?= $lang["_french"] ? "true" : "false" ?>)</script>
<br>
<?php global $isLoggedIn; if ($isLoggedIn && $memberData["name"] !== "unknown" && $memberData["name"] !== "fusion"): ?>
@@ -53,24 +53,27 @@
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; $score = calculateScore($metadata, $memberData["display_name"] ?? $memberData["name"]); ?>
<li>
<b>Score breakdown:</b> <code><?= $score["total"] ?></code>
- <ul>
- <li><b>Most common fronter score:</b> <code><?= $score["host"] ?></code></li>
- <li><b>Relationships score:</b> <code><?= $score["relations"] ?></code></li>
- <li><b>Fictive score:</b> <code><?= $score["fictive"] ?></code></li>
- <li><b>Median score:</b> <code><?= $score["median"] ?></code></li>
- <li><b>Species score:</b> <code><?= $score["species"] ?></code></li>
- <li><b>Little score:</b> <code><?= $score["little"] ?></code></li>
- <li><b>Not talking score:</b> <code><?= $score["not_talking"] ?></code></li>
- <li><b>Protector score:</b> <code><?= $score["protector"] ?></code></li>
- <li><b>Name score:</b> <code><?= $score["name"] ?></code></li>
- <li><b>Shared memory score:</b> <code><?= $score["shared_memory"] ?></code></li>
- </ul>
- </li>
- <li><b>Full metadata:</b> <ul><?php
+ <ul><?php
foreach ($metadata as $type => $usage) {
if (is_string($usage)) {
echo("<li><b>" . $type . ":</b> " . $usage . "</li>");
+ } else if (is_array($usage)) {
+ if (count($usage) === 0) {
+ echo("<li><b>" . $type . ":</b> []</li>");
+ } else {
+ echo("<li><b>" . $type . ":</b><ul>");
+
+ foreach ($usage as $key => $item) {
+ if (is_string($item)) {
+ echo("<li><b>" . $key . ":</b> " . $item . "</li>");
+ } else {
+ echo("<li><b>" . $key . ":</b> " . json_encode($item, JSON_UNESCAPED_SLASHES) . "</li>");
+ }
+ }
+
+ echo("</ul></li>");
+ }
} else {
echo("<li><b>" . $type . ":</b> " . json_encode($usage, JSON_UNESCAPED_SLASHES) . "</li>");
}
@@ -78,25 +81,15 @@
?></ul></li>
</ul>
-
- <br>
- <div style="filter:invert(0);" class="alert alert-warning">
- <b>AI-generated page:</b>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.inc"; ?>
- </div>
</details>
</div>
<?php endif; ?>
-<?php if ($travelling[$memberID]['travelling']): ?>
+<?php if ($travelling[$memberID]['travelling'] && !$travelling[$memberID]['equestria']): ?>
<div class="alert alert-primary">
- <?= getMiniName($memberData["display_name"] ?? $memberData["name"]) ?> is visiting the <?= $systemID === "ynmuc" ? "Raindrops System" : "Cloudburst System" ?>, therefore <?= getMemberPronouns($memberData["pronouns"])["subjective"] ?> <?= getMemberPronouns($memberData["pronouns"])["third"] ? "is" : "are" ?> currently not in the <?= $systemCommonName ?>.
+ <?= getMiniName($memberData["display_name"] ?? $memberData["name"]) ?> <?= $lang["fullbanner"]["visit"][0] ?> <?= $systemID === "ynmuc" ? "Raindrops System" : "Cloudburst System" ?><?= str_replace("%1", getMemberPronouns($memberData["pronouns"])["subjective"], str_replace("%2", getMemberPronouns($memberData["pronouns"])["third"] ? "is" : "are", $lang["fullbanner"]["visit"][1])) ?><?= $systemCommonName ?>.
</div>
-<?php endif; ?>
-<?php if ($memberData["name"] === "new"): ?>
- <div class="alert alert-secondary">
- <p>Hello there!</p>
- <p>I'm currently a new headmate slowly figuring myself out.</p>
- <p>Give me some time to figure myself out and see this page change as I find new stuff about my identity. Don't be too worried if I accidentally get pushed to front, it's something that can happen sometimes.</p>
- <span>Thanks!</span>
+<?php elseif ($travelling[$memberID]['travelling'] && $travelling[$memberID]['equestria']): ?>
+ <div class="alert alert-primary">
+ <?= getMiniName($memberData["display_name"] ?? $memberData["name"]) ?> is on a trip to Equestria. <?= str_replace("%1", getMemberPronouns($memberData["pronouns"])["subjective"], str_replace("%2", getMemberPronouns($memberData["pronouns"])["third"] ? "is" : "are", "Therefore %1 %2 currently not in the ")) ?><?= $systemCommonName ?>.
</div>
<?php endif; ?> \ No newline at end of file
diff --git a/includes/functions.inc b/includes/functions.inc
index c3ec313..cc94f11 100644
--- a/includes/functions.inc
+++ b/includes/functions.inc
@@ -179,6 +179,10 @@ if (!function_exists("getMiniName")) {
$parts = explode(" ", $name);
if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn")) {
+ if ($parts[0] === "Princess") {
+ array_shift($parts);
+ }
+
if (str_contains($parts[0], "/")) {
return explode("/", $parts[0])[0];
} else {
@@ -250,7 +254,7 @@ if (!function_exists("showMembersFromList")) {
function showMembersFromList(array $list) {
foreach ($list as $member) { if ($member['name'] !== "unknown" && $member['name'] !== "fusion") {
echo('<!-- ' . ($member['display_name'] ?? $member['name']) . ' -->
-<a href="/' . $member['name'] . '" style="text-decoration:none !important;filter:none !important;"><div class="hpd-item-card" style="background-color:rgba(255, 255, 255, .1);border:1px solid ' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';outline-color:' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;"><div>
+<a href="/' . $member['name'] . '" style="text-decoration:none !important;filter:none !important;"><div class="hpd-item-card" style="background-color:rgba(255, 255, 255, .1);border:1px solid ' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';outline-color:' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;' . ($member["equestria"] ? 'opacity:.5;' : '') . '"><div>
<img alt="" src="' . getAsset($member["system"], $member["id"]) . '" style="border-radius:999px;background-color:rgba(0, 0, 0, .25);height:48px;display:block;margin-left:auto;margin-right:auto;">
<div style="text-decoration:none;color:white;margin-top:5px;">' . ($member['display_name'] ?? $member['name']) . '</div>
<div style="text-decoration:none !important;color:black !important;"><code style="text-decoration:none !important;color:white !important;">' . (isset($member['travelling']) && $member['travelling'] ? "+" . ($member['proxy_tags'][0]['prefix'] ?? "&nbsp;") : ($member['proxy_tags'][0]['prefix'] ?? "&nbsp;")) . '</code></div>
@@ -301,18 +305,19 @@ if (!function_exists("showSystem")) {
echo(' <div style="display:grid;grid-template-columns:repeat(6, 1fr);padding-left:10px;grid-gap:10px;">');
}
- showMembersFromList(scoreOrder([...array_map(function ($i) use ($id) {
+ showMembersFromList(scoreOrder([...array_map(function ($i) use ($id, $travelling) {
$i["travelling"] = false;
$i["system"] = $id;
+ $i["equestria"] = $travelling[$i['id']]['travelling'] && $travelling[$i['id']]['equestria'];
return $i;
}, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/members.json"), true), function ($i) use ($travelling) {
- return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']);
+ return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']));
})), ...array_map(function ($i) use ($id) {
$i["travelling"] = true;
$i["system"] = ($id === "gdapd" ? "ynmuc" : "gdapd");
return $i;
}, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($id === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($travelling) {
- return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'];
+ return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']);
}))], $id));
echo('</div>
@@ -349,23 +354,30 @@ if (!function_exists("getMember")) {
}
if (!function_exists("timeAgo")) {
- function timeAgo($time): string {
+ function timeAgo($time, $french = false): string {
if (!is_numeric($time)) {
$time = strtotime($time);
}
$periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"];
+ $periods_fr = ["sec.", "mn.", "hr.", "j.", "sem.", "m.", "a.", "des années"];
$lengths = array("60", "60", "24", "7", "4.35", "12", "100");
$now = time();
$difference = $now - $time;
if ($difference <= 10 && $difference >= 0) {
- return $tense = "now";
+ if ($french) {
+ return $tense_fr = "à l'instant";
+ } else {
+ return $tense = "now";
+ }
} elseif ($difference > 0) {
$tense = "ago";
+ $tense_fr = "il y a";
} else {
$tense = "later";
+ $tense_fr = "dans";
}
for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
@@ -374,8 +386,13 @@ if (!function_exists("timeAgo")) {
$difference = round($difference);
- $period = $periods[$j];
- return "{$difference} {$period} {$tense}";
+ if ($french) {
+ $period = $periods_fr[$j];
+ return "{$tense_fr} {$difference} {$period}";
+ } else {
+ $period = $periods[$j];
+ return "{$difference} {$period} {$tense}";
+ }
}
}
@@ -412,21 +429,37 @@ if (!function_exists("timeIn")) {
if (!function_exists("duration")) {
function duration($seconds) {
+ global $lang; global $pages;
+
if ($seconds >= 60) {
if (floor($seconds / 60) >= 60) {
if (floor($seconds / 3600) >= 24) {
$days = floor($seconds / 86400);
- return $days . " day" . ($days > 1 ? "s" : "");
+
+ if ($lang["_french"]) {
+ return $days . " jour" . ($days > 1 ? "s" : "");
+ } else {
+ return $days . " day" . ($days > 1 ? "s" : "");
+ }
} else {
$hours = floor($seconds / 3600);
- return $hours . " hour" . ($hours > 1 ? "s" : "");
+
+ if ($lang["_french"]) {
+ return $hours . " heure" . ($hours > 1 ? "s" : "");
+ } else {
+ return $hours . " hour" . ($hours > 1 ? "s" : "");
+ }
}
} else {
$minutes = floor($seconds / 60);
return $minutes . " minute" . ($minutes > 1 ? "s" : "");
}
} else {
- return $seconds . " seconds";
+ if ($lang["_french"]) {
+ return $seconds . " secondes";
+ } else {
+ return $seconds . " seconds";
+ }
}
}
}
diff --git a/includes/header.inc b/includes/header.inc
index 2d95799..d338f78 100644
--- a/includes/header.inc
+++ b/includes/header.inc
@@ -710,7 +710,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php";
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
display: grid;
- grid-template-columns: repeat(6, 1fr);
+ grid-template-columns: repeat(5, 1fr);
text-align: center;
}
@@ -780,7 +780,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php";
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/mobilenav.inc"; ?>
- <div style="margin-top: 34px;"></div>
+ <div id="titlebar-separator" style="margin-top: 34px;"></div>
<style>
body {
diff --git a/includes/init.inc b/includes/init.inc
index 7265c0e..53a6328 100644
--- a/includes/init.inc
+++ b/includes/init.inc
@@ -4,12 +4,13 @@ global $title;
global $toplevel;
global $emergencyHeader;
global $pages;
+global $lang; global $pages;
$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true);
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (in_array($toplevel, array_keys($pages))) {
- $title = $pages[$toplevel]["name"];
+ $title = $pages[$toplevel]["name"][$lang["_name"]];
if ($pages[$toplevel]["admin"]) {
$readOnly = false;
diff --git a/includes/language.inc b/includes/language.inc
new file mode 100644
index 0000000..ddeee3b
--- /dev/null
+++ b/includes/language.inc
@@ -0,0 +1,14 @@
+<?php
+
+if ($_SERVER['HTTP_HOST'] === "fr.equestria.horse") {
+ $default = "fr";
+} else {
+ $default = "en";
+}
+
+$lf = $_COOKIE['PEH2_LANGUAGE'] ?? $default;
+
+if (str_contains("/", $lf)) $lf = "en";
+if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/i18n/" . $lf . ".json")) $lf = "en";
+
+$lang = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/i18n/" . $lf . ".json"), true); \ No newline at end of file
diff --git a/includes/logo.inc b/includes/logo.inc
index 9b4a03f..17026c7 100644
--- a/includes/logo.inc
+++ b/includes/logo.inc
@@ -104,4 +104,112 @@ $img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
unlink("/tmp/image.png");
imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo-template.png");
-imagepng($img3, "/tmp/ponieslogo2.png"); \ No newline at end of file
+imagepng($img3, "/tmp/ponieslogo2.png");
+
+// --------------------------
+
+$columns = ceil(sqrt(count(array_filter(scoreOrderGlobal(), function ($i) {
+ return $i["_system"] === "gdapd";
+}))));
+echo(" Using " . $columns . " columns\n");
+
+$members = array_values(array_filter(scoreOrderGlobal(), function ($i) {
+ return $i["_system"] === "gdapd";
+}));
+
+usort($members, function ($a, $b) {
+ $vr = hexdec(substr($a["color"], 0, 2));
+ $vg = hexdec(substr($a["color"], 2, 2));
+ $vb = hexdec(substr($a["color"], 4, 2));
+
+ $hsl = rgbToHsl($vr, $vg, $vb);
+ if ($hsl[0] == 0) $hsl[0] = 360;
+ $ra = $hsl[0];
+
+ $vr = hexdec(substr($b["color"], 0, 2));
+ $vg = hexdec(substr($b["color"], 2, 2));
+ $vb = hexdec(substr($b["color"], 4, 2));
+
+ $hsl = rgbToHsl($vr, $vg, $vb);
+ if ($hsl[0] == 0) $hsl[0] = 360;
+ $rb = $hsl[0];
+
+ return $ra - $rb;
+});
+
+echo(" " . count($members) . " members\n");
+
+$packs = [];
+$currentPack = [];
+
+foreach ($members as $member) {
+ if (count($currentPack) >= $columns) {
+ $packs[] = $currentPack;
+ $currentPack = [];
+ }
+
+ $currentPack[] = $member["color"];
+}
+
+if (count($currentPack) > 0) $packs[] = $currentPack;
+
+$newPacks = [];
+foreach ($packs as $pack) {
+ usort($pack, function ($a, $b) {
+ $vra = hexdec(substr($a, 0, 2));
+ $vga = hexdec(substr($a, 2, 2));
+ $vba = hexdec(substr($a, 4, 2));
+
+ $hsla = rgbToHsl($vra, $vga, $vba);
+ $ra = $hsla[2] * $hsla[1];
+
+ $vrb = hexdec(substr($b, 0, 2));
+ $vgb = hexdec(substr($b, 2, 2));
+ $vbb = hexdec(substr($b, 4, 2));
+
+ $hslb = rgbToHsl($vrb, $vgb, $vbb);
+ $rb = $hslb[2] * $hslb[1];
+
+ return $rb < $ra;
+ });
+
+ while (count($pack) < $columns) $pack[] = "ffffff";
+
+ $newPacks[] = $pack;
+}
+
+$img = imagecreatetruecolor($columns, $columns);
+$factor = 64;
+
+for ($y = 0; $y < $columns; ++$y) {
+ for ($x = 0; $x < $columns; ++$x) {
+ if (isset($newPacks[$y][$x])) {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2))));
+ } else {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, 255, 255, 255));
+ }
+ }
+}
+
+$img2 = imagecreatetruecolor($columns * $factor, $columns * $factor);
+imagecopyresampled($img2, $img, 0, 0, 0, 0, $columns * $factor, $columns * $factor, $columns, $columns);
+
+imagepng($img2, "/tmp/image.png");
+$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
+unlink("/tmp/image.png");
+
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo2.png");
+imagepng($img3, "/tmp/ponieslogo1a.png");
+
+for ($x = 1; $x <= 120; $x++) {
+ imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR);
+}
+
+imagefilter($img2, IMG_FILTER_BRIGHTNESS, -100);
+
+imagepng($img2, "/tmp/image.png");
+$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
+unlink("/tmp/image.png");
+
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo2-template.png");
+imagepng($img3, "/tmp/ponieslogo2a.png"); \ No newline at end of file
diff --git a/includes/member.inc b/includes/member.inc
index 02f7769..8734471 100644
--- a/includes/member.inc
+++ b/includes/member.inc
@@ -1,7 +1,7 @@
-<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID;
+<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; global $lang; global $pages;
if ($memberData["name"] === "fusion") {
- $title = ($memberCommonName === "fusion" ? "Multiple merged members" : $memberCommonName);
+ $title = ($memberCommonName === "fusion" ? $lang["member"]["merge"] : $memberCommonName);
} else {
$title = $memberCommonName . " · " . $systemCommonName;
}
@@ -57,28 +57,28 @@ if ($memberData["name"] === "fusion") {
<div id="page-content">
<?php if ($memberData["name"] === "unknown"): ?>
<div class="alert alert-secondary">
- <p>Hello there!</p>
- <p>I'm currently not totally sure who I am (it's a thing that can happen with plurality), but I am using <?= $systemID === "ynmuc" ? "Twilight Sparkle" : "Scootaloo" ?> as a temporary identity to stay calm and not panic while I figure out what is going on and who I am.</p>
- <p>I can either be an existing headmate who cannot work out they are fronting (this can sometimes happen when one of us gets pushed out of front), multiple headmates blurring who cannot work out who we are, or a new pony trying to figure out their identity (this can sometimes take a while).</p>
- <span>In all cases, feel free to ask!</span>
+ <p><?= $lang["member"]["unknown"][0] ?></p>
+ <p><?= $lang["member"]["unknown"][1] ?></p>
+ <p><?= $lang["member"]["unknown"][2] ?></p>
+ <span><?= $lang["member"]["unknown"][3] ?></span>
</div>
<?php elseif ($memberData["name"] === "fusion"): ?>
<div class="alert alert-secondary">
- <p>Hello there!</p>
- <p>I'm the result of more than one pony temporarily merging together to the point they are unable to be told apart (this can be done for various reasons). We have not registered this switch for the "Unknown" member since this merge is made on purpose.</p>
- <p>Below is the list of who is merged, we can be either from a single system or from different systems.</p>
+ <p><?= $lang["member"]["fusion"][0] ?></p>
+ <p><?= $lang["member"]["fusion"][1] ?></p>
+ <p><?= $lang["member"]["fusion"][2] ?></p>
<div class="list-group">
<?php $foundFusion = false; $fusionOn = false; foreach ($fusionRaindrops ? $frontersRaindrops['members'] : $frontersCloudburst['members'] as $fronter): if ($fronter["name"] !== "fusion"): if ($fusionOn): $foundFusion = true; $name = str_ends_with($fronter['name'], "-travelling") ? substr($fronter['name'], 0, strlen($fronter['name']) - 11) : $fronter['name'] ?>
<a class="list-group-item list-group-item-action text-black" href="/<?= $name ?>"><img src="<?= getAsset($system, $fronter["id"], "heads") ?>" style="filter:invert(1) hue-rotate(180deg);width:24px;"> <?= $fronter["display_name"] ?? $name ?></a>
<?php endif; else: $fusionOn = true; endif; endforeach; ?>
</div>
<?php if (!$foundFusion): ?>
- <i>No members are currently merged.</i>
+ <i><?= $lang["member"]["no_fusion"] ?></i>
<?php endif; ?>
</div>
<?php else: ?>
<?php global $isLoggedIn; if ($isLoggedIn): ?>
- <small style="opacity:.5;display:block;">(edit: <a href="/-/edit/<?= $system ?>/<?= $memberData['name'] ?>">public</a>, <a href="/-/edit-private/<?= $system ?>/<?= $memberData['name'] ?>">private</a>)</small>
+ <small style="opacity:.5;display:block;">(edit: <a href="/-/metadata/<?= $system ?>/<?= $memberData['name'] ?>">metadata</a>, <a href="/-/edit/<?= $system ?>/<?= $memberData['name'] ?>">public</a>, <a href="/-/edit-private/<?= $system ?>/<?= $memberData['name'] ?>">private</a>)</small>
<?php endif; ?>
<?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") && $isLoggedIn): ?>
@@ -88,9 +88,6 @@ if ($memberData["name"] === "fusion") {
<?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html")): ?>
<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ?>
- <?php else: ?>
- <p class="text-muted">This page is automatically generated and may not be 100% accurate.</p>
- <?php require $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.inc"; ?>
<?php endif; ?>
<?php endif; ?>
</div>
diff --git a/includes/member/hierarchy.inc b/includes/member/hierarchy.inc
deleted file mode 100644
index acf954b..0000000
--- a/includes/member/hierarchy.inc
+++ /dev/null
@@ -1,179 +0,0 @@
-<?php global $system;
-global $systemCommonName;
-global $systemID;
-global $member;
-global $memberData;
-global $memberCommonName;
-global $memberID;
-$title = "Member hierarchy · " . $memberCommonName . " · " . $systemCommonName;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
-
-$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
-
-$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true));
-
-$allMembers = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true), $systemID);
-$allMembers2 = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), $systemID === "gdapd" ? "ynmuc" : "gdapd");
-
-$systemCommonData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/general.json"), true);
-
-if ($travelling[$memberID]["travelling"]) {
- $allMembers = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), $systemID === "gdapd" ? "ynmuc" : "gdapd");
- $allMembers2 = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true), $systemID);
-
- $systemCommonData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/general.json"), true);
-
- $system = $systemID === "gdapd" ? "cloudburst" : "raindrops";
- $systemCommonName = $systemID === "gdapd" ? "Cloudburst System" : "Raindrops System";
-}
-
-$memberData["system"] = $memberData["_system"] = $systemID;
-
-?>
-
- <br>
- <div class="container">
- <h2><?= getMiniName($memberCommonName) ?>'s hierarchy</h2>
- <br>
-
- <?php
-
- $takingCare = [
- ...array_filter($allMembers, function ($i) use ($systemID, $memberData) {
- return in_array($systemID . "/" . $memberData["id"], $i["_metadata"]["caretakers"]) && $i["id"] !== $memberData["id"];
- }),
- ...array_filter($allMembers2, function ($i) use ($systemID, $memberData) {
- return in_array($systemID . "/" . $memberData["id"], $i["_metadata"]["caretakers"]) && $i["id"] !== $memberData["id"];
- })
- ];
-
- $protected = array_filter($allMembers, function ($i) use ($memberData) {
- return $i["_metadata"]["protector"] && $i["id"] !== $memberData["id"];
- });
-
- $caretakers = array_map(function ($i) {
- return getSystemMember(explode("/", $i)[0], explode("/", $i)[1]);
- }, $metadata["caretakers"]);
-
- ?>
-
- <p class="text-muted" style="text-align: center;"><b>Part of:</b></p>
- <div class="row">
- <div class="cell" style="width:20%;display:inline-block;margin-left:auto;margin-right:auto;">
- <a href="/<?= $system ?>" style="text-decoration:none !important;filter:none !important;">
- <div class="hpd-item-card"
- style="background-color:rgba(255, 255, 255, .1);border:1px solid #<?= $systemCommonData["color"] ?? "ffffff" ?>55;outline-color:#<?= $systemCommonData["color"] ?? "ffffff" ?>55;border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;">
- <div>
- <img alt=""
- src="/assets/uploads/<?= $system ?>.png"
- style="height:48px;display:block;margin-left:auto;margin-right:auto;">
- <div style="text-decoration:none;color:white;margin-top:5px;"><?= $systemCommonName ?></div>
- </div>
- </div>
- </a>
- </div>
- </div>
-
- <hr>
-
- <?php if (count($protected) > 0): ?>
- <p class="text-muted" style="text-align: center;"><b>Protected by:</b></p>
- <div class="row">
- <?php foreach ($protected as $selectedMember): ?>
- <div class="cell" style="width:20%;display:inline-block;margin-left:auto;margin-right:auto;">
- <?php showMembersFromList([$selectedMember]) ?>
- </div>
- <?php endforeach; ?>
- </div>
-
- <hr>
- <?php endif; ?>
-
- <?php if (count($caretakers) > 0): ?>
- <p class="text-muted" style="text-align: center;"><b>Taken care of by:</b></p>
- <div class="row">
- <?php foreach ($caretakers as $selectedMember): ?>
- <div class="cell" style="width:20%;display:inline-block;margin-left:auto;margin-right:auto;">
- <?php showMembersFromList([$selectedMember]) ?>
- </div>
- <?php endforeach; ?>
- </div>
-
- <hr>
- <?php endif; ?>
-
- <p class="text-muted" style="text-align: center;"><b>Member:</b></p>
- <div class="row">
- <div class="cell" style="width:20%;display:inline-block;margin-left:auto;margin-right:auto;">
- <?php showMembersFromList([$memberData]) ?>
- </div>
- </div>
-
- <?php if (count($takingCare) > 0): ?>
- <hr>
-
- <p class="text-muted" style="text-align: center;"><b>Taking care of:</b></p>
- <div class="row">
- <?php foreach ($takingCare as $selectedMember): ?>
- <div class="cell" style="width:20%;display:inline-block;margin-left:auto;margin-right:auto;">
- <?php showMembersFromList([$selectedMember]) ?>
- </div>
- <?php endforeach; ?>
- </div>
- <?php endif; ?>
- </div>
-
- <style>
- .row {
- margin-bottom: 20px;
- }
-
- @media (max-width: 750px) {
- #hpd-cloudburst > div, #hpd-raindrops > div {
- grid-template-columns: repeat(1, 1fr) !important;
- }
-
- .hpd-item-card img {
- display: inline-block !important;
- margin-right: 5px !important;
- height: 32px !important;
- }
-
- #hpd-cloudburst > div, #hpd-raindrops > div {
- grid-gap: 5px !important;
- }
-
- .hpd-item-card div {
- display: inline-block !important;
- }
-
- .hpd-item-card div:nth-child(3)::before {
- content: "(";
- padding-left: 5px;
- color: white !important;
- }
-
- .hpd-item-card div:nth-child(3)::after {
- content: ")";
- color: white !important;
- }
-
- div.cell {
- grid-row-gap: 5px !important;
- width: 100% !important;
- margin-bottom: 5px;
- }
-
- div.cell:nth-last-child(1) {
- margin-bottom: 0 !important;
- }
- }
-
- @media (max-width: 997px) {
- .cell {
- width: 30% !important;
- }
- }
- </style>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/member/tree.inc b/includes/member/tree.inc
deleted file mode 100644
index 2e94951..0000000
--- a/includes/member/tree.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-
-global $parts;
-$parts[3] = "hierarchy";
-array_shift($parts);
-
-header("Location: /" . implode("/", $parts));
-die(); \ No newline at end of file
diff --git a/includes/metadata.inc b/includes/metadata.inc
new file mode 100644
index 0000000..1aa7329
--- /dev/null
+++ b/includes/metadata.inc
@@ -0,0 +1,105 @@
+<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing metadata for " . $memberCommonName . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+
+if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")) {
+ $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true));
+}
+
+?>
+
+<br>
+<div class="container" id="page-content">
+ <h2><?= $memberData["display_name"] ?? $memberData["name"] ?></h2>
+ <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")): ?>
+ <form>
+ <input name="submit" type="hidden">
+ <p>
+ <b>File</b><br>
+ <?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json" ?>
+ </p>
+ <p>
+ <b>Bitset</b><br>
+ <code id="bitset-text"><?= $metadata["bitset"] ?></code> · <a data-bs-toggle="modal" data-bs-target="#bitset" href="#">Edit...</a>
+ <input name="bitset" id="bitset-value" type="hidden" value="<?= $metadata["bitset"] ?>">
+ </p>
+ <p>
+ <b>Marefriends (full IDs, comma-separated):</b><br>
+ <input name="marefriends" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["marefriends"]) ?>">
+ </p>
+ <p>
+ <b>Sisters (full IDs, comma-separated):</b><br>
+ <input name="sisters" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["sisters"]) ?>">
+ </p>
+ <p>
+ <b>Caretakers (full IDs, comma-separated):</b><br>
+ <input name="caretakers" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["caretakers"]) ?>">
+ </p>
+ <p>
+ <b>Age regressed version (local ID):</b><br>
+ <input name="regressed" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= $metadata["regressed"] ?? "" ?>">
+ </p>
+ <p>
+ <b>Birth date (use January 1<sup>st</sup> for none):</b><br>
+ <input name="birth" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="date" value="<?= $metadata["birth"]["year"] ?? "" ?>-<?= $metadata["birth"]["date"] ?? "" ?>">
+ </p>
+ <p>
+ <b>Age (for ponies with fixed age):</b><br>
+ <input name="age" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="number" value="<?= $metadata["birth"]["age"] ?? "" ?>">
+ </p>
+ <input name="submit" class="btn btn-outline-primary" value="Save and quit" type="submit">
+ </form>
+ <?php else: ?>
+ <div class="alert alert-warning">
+ This member does not have a metadata file. This file needs to be initially created by an administrator before it can be edited using this page.
+ </div>
+ <?php endif; ?>
+</div>
+
+<div class="modal fade" id="bitset">
+ <div class="modal-dialog modal-xl">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4 class="modal-title">
+ <img src="/assets/icons/bitset.svg" style="filter: invert(1); vertical-align: middle; height: 32px; margin-right: 10px;">
+ <span style="vertical-align: middle;">Bitset editor</span>
+ </h4>
+ <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
+ </div>
+ <div class="modal-body">
+ <iframe src="/-/bitset?embed=<?= $metadata["bitset"] ?>"></iframe>
+ <script>
+ setInterval(() => {
+ try {
+ document.getElementById("bitset-text").innerText = document.getElementById("bitset-value").value = document.getElementsByTagName("iframe")[0].contentDocument.getElementById("output-dec").innerText;
+ } catch (e) {}
+ })
+ </script>
+ </div>
+ </div>
+ </div>
+</div>
+
+<style>
+ .modal-header {
+ border-bottom: 1px solid #353738;
+ }
+
+ .modal-content {
+ border: 1px solid rgba(255, 255, 255, .2);
+ background-color: #111;
+ }
+
+ .btn-close {
+ filter: invert(1);
+ }
+
+ iframe {
+ width: calc(100% + 2rem);
+ min-height: calc(100% + 2rem);
+ border-bottom-left-radius: .3rem;
+ border-bottom-right-radius: .3rem;
+ height: 60vh;
+ margin: -1rem -1rem calc(-1rem - 6px);
+ }
+</style>
+
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/navbar.inc b/includes/navbar.inc
index 379f102..3e68493 100644
--- a/includes/navbar.inc
+++ b/includes/navbar.inc
@@ -1,4 +1,4 @@
-<?php global $isLoggedIn; global $isUserLoggedIn; global $demoHeader; global $pages; global $useNewUI; global $navigation; ?>
+<?php global $isLoggedIn; global $isUserLoggedIn; global $demoHeader; global $pages; global $useNewUI; global $navigation; global $lang; global $pages; ?>
<?php if (!$useNewUI): ?>
<nav class="navbar navbar-expand-<?= $isLoggedIn ? 'xl' : 'lg' ?> bg-dark navbar-dark fixed-top" style="height:60px;">
@@ -24,12 +24,12 @@
<li><h5 class="dropdown-header"><?= $category["name"] ?></h5></li>
<?php endif; ?>
- <?php foreach ($category["items"] as $link): ?>
+ <?php foreach ($category["items"] as $link): if (isset($link)): ?>
<li><a class="dropdown-item" href="<?= $link["link"] ?>">
<img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px; border-radius: 5px; vertical-align: middle;">
<span style="vertical-align: middle;<?= isset($link["stepped"]) ? "color: $link[stepped];" : "" ?>"><?= isset($link["stepped"]) ? "<b>$link[name]</b>" : $link["name"] ?></span>
</a></li>
- <?php endforeach; ?>
+ <?php endif; endforeach; ?>
<?php endforeach; ?>
</ul>
</li>
@@ -59,7 +59,7 @@
<a class="nav-link" href="/-/login">
<?php global $_PROFILE; ?>
<span style="vertical-align: middle;">
- Not logged in
+ <?= $lang["navitation"]["login"] ?>
</span>
<img alt="" src="/assets/icons/login.svg" style="filter:invert(1);width:24px;vertical-align: middle;">
</a>
diff --git a/includes/navigation.inc b/includes/navigation.inc
index 8e6e8cd..bdafe99 100644
--- a/includes/navigation.inc
+++ b/includes/navigation.inc
@@ -14,10 +14,11 @@ $raindrops_subsystemsNotMember = array_values(array_filter($subsystems2, functio
global $navigation;
global $toplevel;
+global $lang; global $pages;
$navigation_admin = [
"admin" => true,
- "name" => "Administrator",
+ "name" => $lang["navigation"]["admin"],
"icon" => "/assets/icons/admin.svg",
"invert" => true,
"items" => [
@@ -26,21 +27,21 @@ $navigation_admin = [
"minimal" => true,
"items" => [
[
- "name" => $pages["emergency"]["name"],
+ "name" => $pages["emergency"]["name"][$lang["_name"]],
"icon" => "/assets/icons/emergency.svg",
"invert" => false,
"link" => "/-/emergency",
"stepped" => "rgb(220,53,69)"
],
[
- "name" => $pages["wakeup"]["name"],
+ "name" => $pages["wakeup"]["name"][$lang["_name"]],
"icon" => "/assets/icons/wakeup.svg",
"invert" => false,
"link" => "/-/wakeup",
"stepped" => "rgb(13,202,240)"
],
[
- "name" => $pages["pleasure"]["name"],
+ "name" => $pages["pleasure"]["name"][$lang["_name"]],
"icon" => "/assets/icons/pleasure.svg",
"invert" => false,
"link" => "/-/pleasure",
@@ -49,102 +50,109 @@ $navigation_admin = [
]
],
"apps" => [
- "name" => "Applications",
+ "name" => $lang["navigation"]["apps"],
"minimal" => false,
"items" => [
[
- "name" => $pages["dashboard"]["name"],
+ "name" => $pages["dashboard"]["name"][$lang["_name"]],
"icon" => "/assets/icons/dashboard.svg",
"invert" => true,
"link" => "/-/dashboard",
"stepped" => null
],
[
- "name" => $pages["about"]["name"],
+ "name" => $pages["about"]["name"][$lang["_name"]],
"icon" => "/assets/icons/about.svg",
"invert" => true,
"link" => "/-/about",
"stepped" => null
],
[
- "name" => $pages["fronting"]["name"],
+ "name" => $pages["fronting"]["name"][$lang["_name"]],
"icon" => "/assets/icons/fronting.svg",
"invert" => true,
"link" => "/-/fronting",
"stepped" => null
],
[
- "name" => $pages["actions"]["name"],
+ "name" => $pages["profiles"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/profiles.svg",
+ "invert" => true,
+ "link" => "/-/profiles",
+ "stepped" => null
+ ],
+ [
+ "name" => $pages["actions"]["name"][$lang["_name"]],
"icon" => "/assets/icons/actions.svg",
"invert" => true,
"link" => "/-/actions",
"stepped" => null
],
[
- "name" => $pages["rules-old"]["name"],
+ "name" => $pages["rules-old"]["name"][$lang["_name"]],
"icon" => "/assets/icons/rules-old.svg",
"invert" => true,
"link" => "/-/rules-old",
"stepped" => null
],
[
- "name" => $pages["docs"]["name"],
+ "name" => $pages["docs"]["name"][$lang["_name"]],
"icon" => "/assets/icons/docs.svg",
"invert" => true,
"link" => "/-/docs",
"stepped" => null
],
[
- "name" => $pages["computers"]["name"],
+ "name" => $pages["computers"]["name"][$lang["_name"]],
"icon" => "/assets/icons/computers.svg",
"invert" => true,
"link" => "/-/computers",
"stepped" => null
],
[
- "name" => $pages["nicknames"]["name"],
+ "name" => $pages["nicknames"]["name"][$lang["_name"]],
"icon" => "/assets/icons/nicknames.svg",
"invert" => true,
"link" => "/-/nicknames",
"stepped" => null
],
[
- "name" => $pages["together"]["name"],
+ "name" => $pages["together"]["name"][$lang["_name"]],
"icon" => "/assets/icons/together.svg",
"invert" => true,
"link" => "/-/together",
"stepped" => null
],
[
- "name" => $pages["splitting"]["name"],
+ "name" => $pages["splitting"]["name"][$lang["_name"]],
"icon" => "/assets/icons/splitting.svg",
"invert" => true,
"link" => "/-/splitting",
"stepped" => null
],
[
- "name" => $pages["byfront"]["name"],
+ "name" => $pages["byfront"]["name"][$lang["_name"]],
"icon" => "/assets/icons/byfront.svg",
"invert" => true,
"link" => "/-/byfront",
"stepped" => null
],
[
- "name" => $pages["travelling"]["name"],
+ "name" => $pages["travelling"]["name"][$lang["_name"]],
"icon" => "/assets/icons/travelling.svg",
"invert" => true,
"link" => "/-/travelling",
"stepped" => null
],
[
- "name" => $pages["stats"]["name"],
+ "name" => $pages["stats"]["name"][$lang["_name"]],
"icon" => "/assets/icons/stats.svg",
"invert" => true,
"link" => "/-/stats",
"stepped" => null
],
[
- "name" => $pages["toys"]["name"],
+ "name" => $pages["toys"]["name"][$lang["_name"]],
"icon" => "/assets/icons/toys.svg",
"invert" => true,
"link" => "/-/toys",
@@ -153,32 +161,32 @@ $navigation_admin = [
]
],
"debug" => [
- "name" => "Debugging",
+ "name" => $lang["navigation"]["debug"],
"minimal" => false,
"items" => [
[
- "name" => $pages["debug"]["name"],
+ "name" => $pages["debug"]["name"][$lang["_name"]],
"icon" => "/assets/icons/debug.svg",
"invert" => true,
"link" => "/-/debug",
"stepped" => null
],
[
- "name" => $pages["bitset"]["name"],
+ "name" => $pages["bitset"]["name"][$lang["_name"]],
"icon" => "/assets/icons/bitset.svg",
"invert" => true,
"link" => "/-/bitset",
"stepped" => null
],
[
- "name" => $pages["score"]["name"],
+ "name" => $pages["score"]["name"][$lang["_name"]],
"icon" => "/assets/icons/score.svg",
"invert" => true,
"link" => "/-/score",
"stepped" => null
],
[
- "name" => $pages["logout"]["name"],
+ "name" => $pages["logout"]["name"][$lang["_name"]],
"icon" => "/assets/icons/logout.svg",
"invert" => true,
"link" => "/-/logout",
@@ -190,7 +198,7 @@ $navigation_admin = [
];
$navigation_global = [
"admin" => false,
- "name" => "Global",
+ "name" => $lang["navigation"]["general"],
"icon" => "/assets/icons/global.svg",
"invert" => true,
"items" => [
@@ -199,66 +207,53 @@ $navigation_global = [
"minimal" => false,
"items" => [
[
- "name" => $pages["home"]["name"],
+ "name" => $pages["home"]["name"][$lang["_name"]],
"icon" => "/assets/icons/home.svg",
"invert" => true,
"link" => "/",
"stepped" => null
],
[
- "name" => $pages["disclaimers"]["name"],
+ "name" => $pages["disclaimers"]["name"][$lang["_name"]],
"icon" => "/assets/icons/disclaimers.svg",
"invert" => true,
"link" => "/-/disclaimers",
"stepped" => null
],
[
- "name" => $pages["relations"]["name"],
+ "name" => $pages["relations"]["name"][$lang["_name"]],
"icon" => "/assets/icons/relations.svg",
"invert" => true,
"link" => "/-/relations",
"stepped" => null
],
- [
- "name" => $pages["government"]["name"],
+ ($_SERVER['HTTP_HOST'] !== "fr.equestria.horse" ? [
+ "name" => $pages["government"]["name"][$lang["_name"]],
"icon" => "/assets/icons/government.svg",
"invert" => true,
"link" => "/-/government",
"stepped" => null
- ],
- [
- "name" => $pages["terminology"]["name"],
- "icon" => "/assets/icons/terminology.svg",
- "invert" => true,
- "link" => "/-/terminology",
- "stepped" => null
- ]
- ]
- ],
- /*"tools" => [
- "name" => "Tools",
- "minimal" => false,
- "items" => [
+ ] : null),
[
- "name" => $pages["parser"]["name"],
- "icon" => "/assets/icons/parser.svg",
+ "name" => $pages["alphabet"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/alphabet.svg",
"invert" => true,
- "link" => "/-/parser",
+ "link" => "/-/alphabet",
"stepped" => null
],
[
- "name" => $pages["prefix"]["name"],
- "icon" => "/assets/icons/prefix.svg",
+ "name" => $pages["terminology"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/terminology.svg",
"invert" => true,
- "link" => "/-/prefix",
+ "link" => "/-/terminology",
"stepped" => null
]
]
- ]*/
+ ]
]
];
$navigation_cloudburst = [
- "admin" => false,
+ "admin" => $_SERVER['HTTP_HOST'] === "fr.equestria.horse",
"name" => "Cloudburst System",
"icon" => getAsset("ynmuc"),
"invert" => false,
@@ -268,16 +263,44 @@ $navigation_cloudburst = [
"minimal" => false,
"items" => [
[
- "name" => "About us",
+ "name" => $lang["navigation"]["about"],
"icon" => "/assets/icons/about.svg",
"invert" => true,
"link" => "/cloudburst",
"stepped" => null
+ ],
+ [
+ "name" => $pages["s:history"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/history.svg",
+ "invert" => true,
+ "link" => "/cloudburst/-/history",
+ "stepped" => null
+ ],
+ [
+ "name" => $pages["s:compare"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/compare.svg",
+ "invert" => true,
+ "link" => "/cloudburst/-/compare",
+ "stepped" => null
+ ],
+ [
+ "name" => $pages["s:tree"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/tree.svg",
+ "invert" => true,
+ "link" => "/cloudburst/-/tree",
+ "stepped" => null
+ ],
+ [
+ "name" => $pages["s:species"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/species.svg",
+ "invert" => true,
+ "link" => "/cloudburst/-/species",
+ "stepped" => null
]
]
],
"subsystems" => [
- "name" => "Subsystems",
+ "name" => $lang["navigation"]["subsystems"],
"minimal" => false,
"items" => array_map(function ($subsystem) {
$ssData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/ynmuc-" . $subsystem['source'] . ".json"), true);
@@ -292,7 +315,7 @@ $navigation_cloudburst = [
}, $cloudburst_subsystemsNotMember)
],
"members" => [
- "name" => "Members",
+ "name" => $lang["navigation"]["members"],
"minimal" => false,
"items" => array_map(function ($member) {
return [
@@ -319,16 +342,44 @@ $navigation_raindrops = [
"minimal" => false,
"items" => [
[
- "name" => "About us",
+ "name" => $lang["navigation"]["about"],
"icon" => "/assets/icons/about.svg",
"invert" => true,
"link" => "/raindrops",
"stepped" => null
+ ],
+ [
+ "name" => $pages["s:history"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/history.svg",
+ "invert" => true,
+ "link" => "/raindrops/-/history",
+ "stepped" => null
+ ],
+ [
+ "name" => $pages["s:compare"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/compare.svg",
+ "invert" => true,
+ "link" => "/raindrops/-/compare",
+ "stepped" => null
+ ],
+ [
+ "name" => $pages["s:tree"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/tree.svg",
+ "invert" => true,
+ "link" => "/raindrops/-/tree",
+ "stepped" => null
+ ],
+ [
+ "name" => $pages["s:species"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/species.svg",
+ "invert" => true,
+ "link" => "/raindrops/-/species",
+ "stepped" => null
]
]
],
"subsystems" => [
- "name" => "Subsystems",
+ "name" => $lang["navigation"]["subsystems"],
"minimal" => false,
"items" => array_map(function ($subsystem) {
$ssData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/gdapd-" . $subsystem['source'] . ".json"), true);
@@ -343,7 +394,7 @@ $navigation_raindrops = [
}, $raindrops_subsystemsNotMember)
],
"members" => [
- "name" => "Members",
+ "name" => $lang["navigation"]["members"],
"minimal" => false,
"items" => array_map(function ($member) {
return [
diff --git a/includes/pages.json b/includes/pages.json
index 659de57..4c6fcf5 100644
--- a/includes/pages.json
+++ b/includes/pages.json
@@ -1,252 +1,369 @@
{
"about": {
- "name": "About Cold Haze",
+ "name": {
+ "en": "About Cold Haze",
+ "fr": "About Cold Haze"
+ },
"short": "About",
"admin": true,
"rail": true
},
"actions": {
- "name": "Actions database",
+ "name": {
+ "en": "Actions database",
+ "fr": "Actions database"
+ },
"short": "Actions",
"admin": true,
"rail": true
},
"alphabet": {
- "name": "Members by prefix letters",
+ "name": {
+ "en": "Members by prefix letters",
+ "fr": "Par lettre du préfixe"
+ },
"short": null,
"admin": false,
"rail": false
},
"api": {
- "name": "API",
+ "name": {
+ "en": "API",
+ "fr": "API"
+ },
"short": null,
"admin": false,
"rail": false
},
"app": {
- "name": "Mobile application",
+ "name": {
+ "en": "Mobile application",
+ "fr": "Application mobile"
+ },
"short": null,
"admin": false,
"rail": false
},
"bitset": {
- "name": "Bitset calculator",
+ "name": {
+ "en": "Bitset calculator",
+ "fr": "Bitset calculator"
+ },
"short": "Bitset",
"admin": true,
"rail": true
},
"byfront": {
- "name": "Members by last fronted",
+ "name": {
+ "en": "Members by last fronted",
+ "fr": "Members by last fronted"
+ },
"short": "Last fronts",
"admin": true,
"rail": true
},
"computers": {
- "name": "Computers",
+ "name": {
+ "en": "Computers",
+ "fr": "Computers"
+ },
"short": "PCs",
"admin": true,
"rail": true
},
"dashboard": {
- "name": "Dashboard",
+ "name": {
+ "en": "Dashboard",
+ "fr": "Dashboard"
+ },
"short": null,
"admin": true,
"rail": true
},
"debug": {
- "name": "Data updater debugging",
+ "name": {
+ "en": "Data updater debugging",
+ "fr": "Débogage des mises à jour"
+ },
"short": null,
"admin": false,
"rail": true
},
- "demo": {
- "name": "Demo interface",
- "short": null,
- "admin": false,
- "rail": false
- },
"docs": {
- "name": "Documents",
+ "name": {
+ "en": "Documents",
+ "fr": "Documents"
+ },
"short": "Docs",
"admin": true,
"rail": true
},
"disclaimers": {
- "name": "Disclaimers",
+ "name": {
+ "en": "Disclaimers",
+ "fr": "Avertissements"
+ },
"short": null,
"admin": false,
"rail": false
},
"edit": {
- "name": "Editor",
+ "name": {
+ "en": "Editor",
+ "fr": "Editor"
+ },
"short": null,
"admin": true,
"rail": false
},
"edit-private": {
- "name": "Editor (private)",
+ "name": {
+ "en": "Editor (private)",
+ "fr": "Editor (private)"
+ },
"short": null,
"admin": true,
"rail": false
},
"emergency": {
- "name": "Emergency alert",
+ "name": {
+ "en": "Emergency alert",
+ "fr": "Emergency alert"
+ },
"short": null,
"admin": true,
"rail": true
},
"fronting": {
- "name": "Front planner",
+ "name": {
+ "en": "Front planner",
+ "fr": "Front planner"
+ },
"short": null,
"admin": true,
"rail": true
},
"government": {
- "name": "Government",
+ "name": {
+ "en": "Government",
+ "fr": "Gouvernement"
+ },
"short": null,
"admin": false,
"rail": false
},
"home": {
- "name": "Home",
+ "name": {
+ "en": "Home",
+ "fr": "Accueil"
+ },
"short": null,
"admin": false,
"rail": false
},
"login": {
- "name": "Login",
+ "name": {
+ "en": "Login",
+ "fr": "Connexion"
+ },
"short": null,
"admin": false,
"rail": false
},
"logout": {
- "name": "Logout",
+ "name": {
+ "en": "Logout",
+ "fr": "Déconnexion"
+ },
"short": null,
"admin": false,
"rail": false
},
+ "metadata": {
+ "name": {
+ "en": "Metadata editor",
+ "fr": "Metadata editor"
+ },
+ "short": "Metadata",
+ "admin": true,
+ "rail": false
+ },
"nicknames": {
- "name": "Relations nicknames",
+ "name": {
+ "en": "Relations nicknames",
+ "fr": "Relations nicknames"
+ },
"short": "Nicknames",
"admin": true,
"rail": true
},
"page": {
- "name": "Member/system page",
- "short": null,
- "admin": false,
- "rail": false
- },
- "parser": {
- "name": "Message parser",
+ "name": {
+ "en": "Member/system page",
+ "fr": "Page de membre/système"
+ },
"short": null,
"admin": false,
"rail": false
},
"pleasure": {
- "name": "Pleasure alert",
+ "name": {
+ "en": "Pleasure alert",
+ "fr": "Pleasure alert"
+ },
"short": null,
"admin": true,
"rail": true
},
- "prefix": {
- "name": "Prefix generator",
+ "profiles": {
+ "name": {
+ "en": "Profile scores",
+ "fr": "Profile scores"
+ },
"short": null,
- "admin": false,
- "rail": false
+ "admin": true,
+ "rail": true
},
"relations": {
- "name": "Relations",
+ "name": {
+ "en": "Relations",
+ "fr": "Relations"
+ },
"short": null,
"admin": false,
"rail": false
},
"rules": {
- "name": "General rules",
+ "name": {
+ "en": "General rules",
+ "fr": "General rules"
+ },
"short": "Rules",
"admin": true,
"rail": true
},
"rules-old": {
- "name": "Systems rules (legacy)",
+ "name": {
+ "en": "Systems rules (legacy)",
+ "fr": "Systems rules (legacy)"
+ },
"short": "Rules (old)",
"admin": true,
"rail": true
},
"s:compare": {
- "name": "Compare members",
+ "name": {
+ "en": "Compare members",
+ "fr": "Comparer les membres"
+ },
"short": null,
"admin": false,
"rail": false
},
"s:history": {
- "name": "Front history",
+ "name": {
+ "en": "Front history",
+ "fr": "Historique de front"
+ },
"short": null,
"admin": false,
"rail": false
},
"s:species": {
- "name": "Members by species",
+ "name": {
+ "en": "Members by species",
+ "fr": "Membres par espèce"
+ },
"short": null,
"admin": false,
"rail": false
},
"s:tree": {
- "name": "System tree",
+ "name": {
+ "en": "System tree",
+ "fr": "Arbre du système"
+ },
"short": null,
"admin": false,
"rail": false
},
"score": {
- "name": "Score system testing",
+ "name": {
+ "en": "Score system testing",
+ "fr": "Score system testing"
+ },
"short": null,
"admin": true,
"rail": true
},
"splitting": {
- "name": "Members by splitting date",
+ "name": {
+ "en": "Members by splitting date",
+ "fr": "Members by splitting date"
+ },
"short": "Splits",
"admin": true,
"rail": true
},
"stats": {
- "name": "Statistics",
+ "name": {
+ "en": "Statistics",
+ "fr": "Statistics"
+ },
"short": "Stats",
"admin": true,
"rail": true
},
"terminology": {
- "name": "Terminology",
+ "name": {
+ "en": "Terminology",
+ "fr": "Terminologie"
+ },
"short": null,
"admin": false,
"rail": true
},
"together": {
- "name": "Watch Together",
+ "name": {
+ "en": "Watch Together",
+ "fr": "Watch Together"
+ },
"short": "Together",
"admin": true,
"rail": false
},
"together-dev": {
- "name": "Watch Together (dev)",
+ "name": {
+ "en": "Watch Together (dev)",
+ "fr": "Watch Together (dev)"
+ },
"short": null,
"admin": true,
"rail": false
},
"toys": {
- "name": "Toys database",
+ "name": {
+ "en": "Toys database",
+ "fr": "Toys database"
+ },
"short": "Toys",
"admin": true,
"rail": true
},
"travelling": {
- "name": "System travels manager",
+ "name": {
+ "en": "System travels manager",
+ "fr": "System travels manager"
+ },
"short": "Travels",
"admin": true,
"rail": true
},
"wakeup": {
- "name": "Wake-up alert",
+ "name": {
+ "en": "Wake-up alert",
+ "fr": "Wake-up alert"
+ },
"short": null,
"admin": true,
"rail": true
diff --git a/includes/pane.inc b/includes/pane.inc
index 6aa7f98..e95747e 100644
--- a/includes/pane.inc
+++ b/includes/pane.inc
@@ -1,5 +1,27 @@
-<?php global $isLoggedIn; global $isUserLoggedIn; global $pages; global $navigation; $byColor = getMembersByColor(); ?>
+<?php global $isLoggedIn; global $isUserLoggedIn; global $pages; global $navigation; $byColor = getMembersByColor($_SERVER['HTTP_HOST'] === "fr.equestria.horse"); global $lang; global $pages; ?>
+<?php if ($_SERVER['HTTP_HOST'] === "fr.equestria.horse"): ?>
+<div id="pane-header-background" style="background-image: linear-gradient(90deg, <?php
+
+$index = 0;
+$list = array_map(function ($i) { return $i["color"]; }, $byColor);
+$length = count($list);
+
+foreach ($list as $color) {
+ $perc = ($index / $length) * 100;
+ echo("#${color}33 $perc%");
+
+ $index++;
+ if ($index < $length) echo(", ");
+}
+
+?>)">
+ <a href="/" id="pane-header" class="login-link-clickable" style="color: white; text-decoration: none; padding: 20px; display: block; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, .25);">
+ <img src="/assets/logo/newlogo2.png" alt="" style="width:32px;vertical-align: middle;margin-right:5px;">
+ <span style="vertical-align: middle; font-weight: bold;">Cold Haze</span>
+ </a>
+</div>
+<?php else: ?>
<div id="pane-header-background" style="background-image: linear-gradient(90deg, <?php
$index = 0;
@@ -23,15 +45,16 @@ foreach ($list as $color) {
<?php if ($isLoggedIn || $isUserLoggedIn): ?>
<a onclick="toggleGlobalSearch();" id="login-link" class="login-link-clickable">
- Search in the website...
+ <?= $lang["navigation"]["search"] ?>
</a>
<?php elseif (!$isLoggedIn && !$isUserLoggedIn): ?>
<a href="/-/login" id="login-link" class="login-link-clickable">
<?php global $_PROFILE; ?>
<img alt="" src="/assets/icons/login.svg" style="filter:invert(1);width:24px;vertical-align: middle;">
- <span style="vertical-align: middle;">Not logged in</span>
+ <span style="vertical-align: middle;"><?= $lang["navigation"]["login"] ?></span>
</a>
<?php endif; ?>
+<?php endif; ?>
<?php foreach ($navigation as $id => $item): if (!$item["admin"] || $isLoggedIn): ?>
@@ -46,12 +69,12 @@ foreach ($list as $color) {
<?php if (isset($category["name"])): ?>
<div class="pane-group-category-title"><?= $category["name"] ?></div>
<?php endif; ?>
- <?php foreach ($category["items"] as $link): ?>
+ <?php foreach ($category["items"] as $link): if (isset($link)): ?>
<a class="pane-group-item" href="<?= $link["link"] ?>">
<img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px; border-radius: 5px; vertical-align: middle;">
<?php if (!$category["minimal"]): ?><span style="vertical-align: middle;<?= isset($link["stepped"]) ? "color: $link[stepped];" : "" ?>"><?= isset($link["stepped"]) ? "<b>$link[name]</b>" : $link["name"] ?></span><?php endif; ?>
</a>
- <?php endforeach; ?>
+ <?php endif; endforeach; ?>
</div>
<?php endforeach; ?>
</div>
diff --git a/includes/profiles.inc b/includes/profiles.inc
new file mode 100644
index 0000000..66274c7
--- /dev/null
+++ b/includes/profiles.inc
@@ -0,0 +1,97 @@
+<?php
+
+function calculateProfileScore($member) {
+ $values = [
+ ((isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] > 0) || isset($member["_metadata"]["birth"]["year"]) && $member["_metadata"]["birth"]["year"] > 1900) || ((isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] === -1) && in_array("alicorn", $member["_metadata"]["species"])),
+ isset($member["_metadata"]["birth"]["date"]) && trim($member["_metadata"]["birth"]["date"]) !== "" && $member["_metadata"]["birth"]["date"] !== "01-01",
+ file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) > 200,
+ file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) > 200,
+ isset($member["banner"]),
+ file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png"),
+ isset($member["color"])
+ ];
+
+ $result = [
+ "values" => $values,
+ "pages" => [],
+ "characters" => [],
+ "score" => (float)array_reduce($values, function ($a, $b) {
+ return $a + $b;
+ }),
+ "score2" => (float)array_reduce($values, function ($a, $b) {
+ return $a + $b;
+ }),
+ "actions" => []
+ ];
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) <= 200) {
+ $result["pages"][] = true;
+ $result["score"] += strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) / 201;
+ } else {
+ $result["pages"][] = false;
+ }
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) <= 200) {
+ $result["pages"][] = true;
+ $result["score"] += strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) / 201;
+ } else {
+ $result["pages"][] = false;
+ }
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html")) {
+ $result["characters"][] = strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html")));
+ } else {
+ $result["characters"][] = -1;
+ }
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html")) {
+ $result["characters"][] = strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html")));
+ } else {
+ $result["characters"][] = -1;
+ }
+
+ if (!((isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] > 0) || isset($member["_metadata"]["birth"]["year"]) && $member["_metadata"]["birth"]["year"] > 1900) && !(isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] === -1) && in_array("alicorn", $member["_metadata"]["species"])) {
+ $result["score"] += 0.5;
+ }
+
+ $result["progress"] = $result["score"] / 7;
+ $result["sortable"] = (int)($result["progress"] * 100000000000000);
+
+ if (!$result["values"][5]) {
+ $result["actions"][] = "a Pony Town character";
+ }
+
+ if (!$result["values"][6]) {
+ $result["actions"][] = "a color";
+ }
+
+ if (!$result["values"][2]) {
+ if ($result["characters"][0] === -1) {
+ $result["actions"][] = "a public page";
+ } else {
+ $result["actions"][] = (200 - $result["characters"][0]) . " characters to the public page";
+ }
+ }
+
+ if (!$result["values"][3]) {
+ if ($result["characters"][1] === -1) {
+ $result["actions"][] = "a private page";
+ } else {
+ $result["actions"][] = (200 - $result["characters"][1]) . " characters to the private page";
+ }
+ }
+
+ if (!$result["values"][4]) {
+ $result["actions"][] = "a banner";
+ }
+
+ if (!$result["values"][0]) {
+ $result["actions"][] = "an age";
+ }
+
+ if (!$result["values"][1]) {
+ $result["actions"][] = "a birthdate";
+ }
+
+ return $result;
+} \ No newline at end of file
diff --git a/includes/rainbow.inc b/includes/rainbow.inc
index 470f288..fba960e 100644
--- a/includes/rainbow.inc
+++ b/includes/rainbow.inc
@@ -4,8 +4,15 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
-function rainbow(): array {
+function rainbow($hideCloudburst = false): array {
$members = scoreOrderGlobal();
+
+ if ($hideCloudburst) {
+ $members = array_filter($members, function ($i) {
+ return $i["_system"] === "gdapd";
+ });
+ }
+
$data = [];
foreach ($members as $member) {
@@ -33,8 +40,8 @@ function rainbow(): array {
return $data;
}
-function getMembersByColor(): array {
- $members = rainbow();
+function getMembersByColor($hideCloudburst = false): array {
+ $members = rainbow($hideCloudburst);
uasort($members, function ($a, $b) {
return $a['hsl'][0] - $b['hsl'][0];
});
diff --git a/includes/score.inc b/includes/score.inc
index 21baf67..703b9cc 100644
--- a/includes/score.inc
+++ b/includes/score.inc
@@ -1,7 +1,6 @@
<?php
function calculateScore($metadata, $name) {
- $scoreHost = $metadata["host"] ? 10000 : 0;
$scoreFictive = $metadata["fictive"] ? 200 : 0;
$scoreLittle = $metadata["little"] === 2 ? 100 : ($metadata["little"] === 1 ? 50 : ($metadata["little"] === 3 ? 75 : 0));
$scoreNotTalking = $metadata["not_talking"] ? -200 : 0;
@@ -13,16 +12,17 @@ function calculateScore($metadata, $name) {
$relations = (count($metadata["marefriends"]) * ($metadata["little"] ? 1 : 2)) + count($metadata["sisters"]);
$scoreRelations = $relations * 50;
+ $scoreLeader = $metadata["leader"] ? 10000 : 0;
+ $scorePersecutor = $metadata["persecutor"] ? -10000 : 0;
+
$scoreAdd = 0;
if ($name === "Cloudy Dreams") $scoreAdd += 250;
- if ($name === "Zoom Zephyrwing") $scoreAdd += 2500;
- if ($name === "Thunder") $scoreAdd += 2500;
- if ($name === "Scoots/Mia") $scoreAdd -= 495;
+ if ($name === "Scootaloo") $scoreAdd -= 235;
- $score = $scoreHost + $scoreFictive + $scoreLittle + $scoreNotTalking + $scoreProtector + $scoreSharedMemory + $scoreRelations + $scoreSpecies + $scoreName + $scoreMedian + $scoreAdd;
+ $score = $scoreLeader + $scorePersecutor + $scoreFictive + $scoreLittle + $scoreNotTalking + $scoreProtector + $scoreSharedMemory + $scoreRelations + $scoreSpecies + $scoreName + $scoreMedian + $scoreAdd;
return [
- "host" => $scoreHost,
+ "leader" => $scoreLeader,
"fictive" => $scoreFictive,
"little" => $scoreLittle,
"median" => $scoreMedian,
@@ -32,6 +32,7 @@ function calculateScore($metadata, $name) {
"shared_memory" => $scoreSharedMemory,
"relations" => $scoreRelations,
"species" => $scoreSpecies,
+ "persecutor" => $scorePersecutor,
"additional" => $scoreAdd,
"total" => $score
];
diff --git a/includes/search.inc b/includes/search.inc
index f240363..c125556 100644
--- a/includes/search.inc
+++ b/includes/search.inc
@@ -1,13 +1,15 @@
+<?php global $lang; global $pages; ?>
+
<div id="global-search-container" style="display: none; position: fixed; z-index: 99999999;background-color: rgba(0, 0, 0, .75); inset: 0; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); align-items: center; justify-content: center;">
<div id="global-search-box" style="background: rgba(50, 50, 50, .5); color: white; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border-radius: 15px; width: 768px; max-width: 90vw;">
<div id="global-search-input-container" onclick="document.getElementById('global-search-input').focus();" style="cursor:text;padding: 10px 50px; font-size: 22px; border: 1px solid rgba(100, 100, 100, .5); border-top-left-radius: 15px; border-top-right-radius: 15px; width: 768px; max-width: 90vw;">
- <span onchange="globalSearchPlaceholder(); globalSearch();" onkeyup="globalSearchPlaceholder(); globalSearch();" onkeydown="globalSearchPlaceholder(); globalSearch();" type="text" id="global-search-input" style="vertical-align: middle; display:inline-block; background: transparent; color: white; border: none;" spellcheck="false" contenteditable="true"></span><span id="global-search-placeholder" style="opacity:.5;">Website Search</span><span id="global-search-autocomplete" style="vertical-align: middle; opacity:.5;"></span><span id="global-search-action" style="vertical-align: middle; opacity:.5;font-size:16px;"></span>
+ <span onchange="globalSearchPlaceholder(); globalSearch();" onkeyup="globalSearchPlaceholder(); globalSearch();" onkeydown="globalSearchPlaceholder(); globalSearch();" type="text" id="global-search-input" style="vertical-align: middle; display:inline-block; background: transparent; color: white; border: none;" spellcheck="false" contenteditable="true"></span><span id="global-search-placeholder" style="opacity:.5;"><?= $lang["search"]["title"] ?></span><span id="global-search-autocomplete" style="vertical-align: middle; opacity:.5;"></span><span id="global-search-action" style="vertical-align: middle; opacity:.5;font-size:16px;"></span>
</div>
<div id="global-search-results" style="border-bottom-left-radius: 15px; border-bottom-right-radius: 15px; border-top-style: none; border-right: 1px solid rgba(100, 100, 100, .5); border-bottom: 1px solid rgba(100, 100, 100, .5); border-left: 1px solid rgba(100, 100, 100, .5); width: 768px; max-width: 90vw; height: 400px; max-height: calc(90vh - 60px);">
<div id="global-search-intro" style="display: flex; align-items: center; justify-content: center; height: 100%; text-align: center;">
<div style="opacity: .5;">
<img src="/assets/logo/logo.png" style="width: 64px; height: 64px; margin-bottom: 10px;">
- <p>Start typing to search for something on the entire website.</p>
+ <p><?= $lang["search"]["placeholder"] ?></p>
</div>
</div>
<div id="global-search-list" style="overflow: auto; display: flex; align-items: center; justify-content: center; height: 100%; text-align: center;"></div>
@@ -22,9 +24,9 @@
const pages_list = JSON.parse(atob(`<?php
$base = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/pages"), function ($i) {
- return !str_starts_with($i, ".") && $i !== "page.inc" && $i !== "api.inc" && $i !== "demo.inc" && $i !== "logout.inc" && $i !== "edit.inc" && $i !== "edit-private.inc" && $i !== "app.inc" && !str_ends_with($i, ".bak.php") && !str_ends_with($i, ".old.php") && !str_ends_with($i, "-dev.php") && !str_ends_with($i, ".bak.inc") && !str_ends_with($i, ".old.inc") && !str_ends_with($i, "-dev.inc");
+ return !str_starts_with($i, ".") && $i !== "page.inc" && $i !== "api.inc" && $i !== "demo.inc" && $i !== "logout.inc" && $i !== "edit.inc" && $i !== "metadata.inc" && $i !== "edit-private.inc" && $i !== "app.inc" && !str_ends_with($i, ".bak.php") && !str_ends_with($i, ".old.php") && !str_ends_with($i, "-dev.php") && !str_ends_with($i, ".bak.inc") && !str_ends_with($i, ".old.inc") && !str_ends_with($i, "-dev.inc");
}));
- $list = array_values(array_filter(array_map(function ($i) {
+ $list = array_values(array_filter(array_map(function ($i) use ($lang) {
global $pages;
global $isLoggedIn;
@@ -32,8 +34,8 @@
return null;
} else {
return [
- 'name' => in_array(substr($i, 0, strlen($i) - 4), array_keys($pages)) ? $pages[substr($i, 0, strlen($i) - 4)]["name"] : substr($i, 0, strlen($i) - 4),
- 'description' => in_array(substr($i, 0, strlen($i) - 4), array_keys($pages)) ? ($pages[substr($i, 0, strlen($i) - 4)]["short"] ?? $pages[substr($i, 0, strlen($i) - 4)]["name"]) : substr($i, 0, strlen($i) - 4),
+ 'name' => in_array(substr($i, 0, strlen($i) - 4), array_keys($pages)) ? $pages[substr($i, 0, strlen($i) - 4)]["name"][$lang["_name"]] : substr($i, 0, strlen($i) - 4),
+ 'description' => in_array(substr($i, 0, strlen($i) - 4), array_keys($pages)) ? ($pages[substr($i, 0, strlen($i) - 4)]["short"] ?? $pages[substr($i, 0, strlen($i) - 4)]["name"][$lang["_name"]]) : substr($i, 0, strlen($i) - 4),
'url' => "/-/" . substr($i, 0, strlen($i) - 4),
'icon' => "/assets/icons/" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/icons/" . substr($i, 0, strlen($i) - 4) . ".svg") ? substr($i, 0, strlen($i) - 4) : "") . ".svg",
'invert' => true
@@ -279,7 +281,7 @@
if (isAutocomplete) {
document.getElementById("global-search-autocomplete").innerText = firstResult.name.substring(count);
- document.getElementById("global-search-action").innerText = " — View page";
+ document.getElementById("global-search-action").innerText = " — <?= $lang["search"]["view"] ?>";
} else {
document.getElementById("global-search-autocomplete").innerText = "";
document.getElementById("global-search-action").innerText = " — " + firstResult.name;
@@ -319,7 +321,7 @@
scores = results.map((i) => { return i.score; });
let results_ponies = {
category: {
- name: "Ponies",
+ name: "<?= $lang["search"]["categories"][0] ?>",
id: "ponies"
},
average: scores.length > 0 ? scores.reduce((a, b) => { return a + b; }) / results.length : 1,
@@ -333,7 +335,7 @@
scores = results.map((i) => { return i.score; });
let results_pages = {
category: {
- name: "Pages",
+ name: "<?= $lang["search"]["categories"][1] ?>",
id: "pages"
},
average: scores.length > 0 ? scores.reduce((a, b) => { return a + b; }) / results.length : 1,
@@ -347,7 +349,7 @@
scores = results.map((i) => { return i.score; });
let results_actions = {
category: {
- name: "Actions",
+ name: "<?= $lang["search"]["categories"][2] ?>",
id: "actions"
},
average: scores.length > 0 ? scores.reduce((a, b) => { return a + b; }) / results.length : 1,
@@ -361,7 +363,7 @@
scores = results.map((i) => { return i.score; });
let results_documents = {
category: {
- name: "Documents",
+ name: "<?= $lang["search"]["categories"][3] ?>",
id: "docs"
},
average: scores.length > 0 ? scores.reduce((a, b) => { return a + b; }) / results.length : 1,
@@ -375,7 +377,7 @@
scores = results.map((i) => { return i.score; });
let results_toys = {
category: {
- name: "Toys",
+ name: "<?= $lang["search"]["categories"][4] ?>",
id: "toys"
},
average: scores.length > 0 ? scores.reduce((a, b) => { return a + b; }) / results.length : 1,
diff --git a/includes/short.inc b/includes/short.inc
index 6883cc7..98efd20 100644
--- a/includes/short.inc
+++ b/includes/short.inc
@@ -4,7 +4,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
-global $toplevel;
+global $toplevel; global $lang; global $pages;
header("Content-Type: text/plain");
$members = scoreOrderGlobal();
@@ -45,8 +45,8 @@ if (in_array($toplevel, array_keys($list)) && $list[$toplevel]) {
if ($toplevel !== "unknown") {
header("Location: " . $list[$toplevel]);
} else {
- header("Location: /?error=Page not found: " . strip_tags($toplevel)) and die();
+ header("Location: /?error=" . $lang["app"]["page"] . " " . strip_tags($toplevel)) and die();
}
} else {
- header("Location: /?error=Page not found: " . strip_tags($toplevel)) and die();
+ header("Location: /?error=" . $lang["app"]["page"] . " " . strip_tags($toplevel)) and die();
} \ No newline at end of file
diff --git a/includes/subsysbanner.inc b/includes/subsysbanner.inc
index 176380f..2f85dc3 100644
--- a/includes/subsysbanner.inc
+++ b/includes/subsysbanner.inc
@@ -9,6 +9,7 @@ global $system;
global $subsystemData;
global $subsystemID;
global $subsystem;
+global $lang; global $pages;
$fronters = array_map(function ($item) {
return $item["id"];
@@ -23,7 +24,7 @@ $fronters = array_map(function ($item) {
<h3 style="height:max-content;"><?= $subsystemData["name"] ?></h3>
<div style="height:max-content;display:grid;grid-template-columns: repeat(4, 1fr);" id="member-card">
<span>
- <b>Fronter:</b>
+ <b><?= $lang["subsystem"]["fronter"] ?></b>
<?php if (in_array($fronters[0], $subsystem["members"])): $member = getMember($fronters[0]); ?>
<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 else: ?>
@@ -49,14 +50,14 @@ $fronters = array_map(function ($item) {
}
?>
- <b>Last fronter: </b><a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID
+ <b><?= $lang["subsystem"]["last"] ?> </b><a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID
, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a>
</span>
<span>
- <b>Members:</b> <?= count($subsystem["members"]) ?>
+ <b><?= $lang["subsystem"]["members"] ?></b> <?= count($subsystem["members"]) ?>
</span>
<span>
- <b>Parent system:</b> <a class="member-link" href="/<?= $system ?>"><img style="width:24px;border-radius:5px;" src="/assets/uploads/<?= $system ?>.png"> <?= getMiniName($systemCommonName) ?></a>
+ <b><?= $lang["subsystem"]["parent"] ?></b> <a class="member-link" href="/<?= $system ?>"><img style="width:24px;border-radius:5px;" src="/assets/uploads/<?= $system ?>.png"> <?= getMiniName($systemCommonName) ?></a>
</span>
</div>
</div>
@@ -65,6 +66,6 @@ $fronters = array_map(function ($item) {
<div id="system-actions" style="margin-top:10px;padding:5px 10px;background:rgba(255, 255, 255, .1);border-radius:10px;">
<div style="padding: 5px 10px;text-align: center;">
- You are viewing the page of a subsystem of the <b><a style="color:white;text-decoration: none;" href="/<?= $system ?>"><?= $systemCommonName ?></a></b>.
+ <?= $lang["subsystem"]["intro"] ?> <b><a style="color:white;text-decoration: none;" href="/<?= $system ?>"><?= $systemCommonName ?></a></b>.
</div>
</div> \ No newline at end of file
diff --git a/includes/sysbanner.inc b/includes/sysbanner.inc
index e1789f7..5c85a20 100644
--- a/includes/sysbanner.inc
+++ b/includes/sysbanner.inc
@@ -6,6 +6,7 @@ global $memberID;
global $systemCommonName;
global $systemID;
global $system;
+global $lang; global $pages;
$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true);
@@ -44,17 +45,17 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
</span>-->
<span>
<?php $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true); ?>
- <b>Fronter: </b>
+ <b><?= $lang["system"]["fronter"] ?> </b>
<?php if (isset($fronters["members"][0])): ?>
<?php $member = $fronters["members"][0]; ?>
- <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a>
+ <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member["name"])) ?></a>
<?php if (count($fronters["members"]) > 1): ?>
- <br>(with
- <?php if (isset($fronters["members"][1])): ?><?php $member2 = $fronters["members"][1]; ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($fronters["members"][2])): ?><?php $member2 = $fronters["members"][2]; ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($fronters["members"][3])): ?><?php $member2 = $fronters["members"][3]; ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a><?php endif; ?>)<?php endif; ?>
+ <br>(<?= $lang["system"]["with"] ?>
+ <?php if (isset($fronters["members"][1])): ?><?php $member2 = $fronters["members"][1]; ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($fronters["members"][2])): ?><?php $member2 = $fronters["members"][2]; ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($fronters["members"][3])): ?><?php $member2 = $fronters["members"][3]; ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?>)<?php endif; ?>
<?php else: ?>-<?php endif; ?>
</span>
<span>
- <b>Last fronter: </b>
+ <b><?= $lang["system"]["last"] ?> </b>
<?php
$previous = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/switches.json"), true)[1]["members"];
@@ -71,9 +72,9 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
}
?>
- <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a>
+ <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member["name"])) ?></a>
<?php if (count($previous) > 1): ?>
- <br>(with <?php if (isset($previous[1])): ?><?php $member2 = getMemberWithoutSystem($previous[1]); ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($previous[2])): ?><?php $member2 = getMemberWithoutSystem($previous[2]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($previous[3])): ?><?php $member2 = getMemberWithoutSystem($previous[3]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a><?php endif; ?>)
+ <br>(<?= $lang["system"]["with"] ?> <?php if (isset($previous[1])): ?><?php $member2 = getMemberWithoutSystem($previous[1]); ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($previous[2])): ?><?php $member2 = getMemberWithoutSystem($previous[2]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($previous[3])): ?><?php $member2 = getMemberWithoutSystem($previous[3]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?>)
<?php endif; ?>
<?php else: ?>-<?php endif; ?>
</span>
@@ -85,16 +86,16 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
});
?>
- <b>Members: </b><?= count(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true), $systemID)) ?><?php
+ <b><?= $lang["system"]["members"] ?> </b><?= count(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true), $systemID)) ?><?php
if (count($travellers) > 0) {
- echo("<br>+ " . count($travellers) . " traveller" . (count($travellers) > 1 ? "s" : ""));
+ echo("<br>+ " . count($travellers) . " " . (count($travellers) > 1 ? $lang["system"]["traveller"] : $lang["system"]["travellers"]));
}
?>
</span>
<span>
- <b>Last switch: </b><span data-bs-toggle="tooltip" title="<?= date("D j M Y, G:i:s (e)", strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true)["timestamp"])) ?>"><?= timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true)["timestamp"]) ?></span>
+ <b><?= $lang["system"]["switch"] ?> </b><span data-bs-toggle="tooltip" title="<?= date("D j M Y, G:i:s (e)", strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true)["timestamp"])) ?>"><?= timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true)["timestamp"]) ?></span>
</span>
</div>
</div>
@@ -102,20 +103,20 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
</div>
<div id="system-actions" style="padding:5px 30px;display:grid;grid-template-columns: 1fr 1fr 1fr 1fr;background-color:rgba(255, 255, 255, .025);margin-left: -20px; margin-right: -20px;">
- <a title="Front history" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/history">
+ <a title="<?= $pages["s:history"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/history">
<img src="/assets/icons/history.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
- <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:history"]["name"] ?></span>
+ <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:history"]["name"][$lang["_name"]] ?></span>
</a>
- <a title="Compare members" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/compare">
+ <a title="<?= $pages["s:compare"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/compare">
<img src="/assets/icons/compare.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
- <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:compare"]["name"] ?></span>
+ <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:compare"]["name"][$lang["_name"]] ?></span>
</a>
- <a title="System tree" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/tree">
+ <a title="<?= $pages["s:tree"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/tree">
<img src="/assets/icons/tree.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
- <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:tree"]["name"] ?></span>
+ <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:tree"]["name"][$lang["_name"]] ?></span>
</a>
- <a title="Members by species" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/species">
+ <a title="Members <?= $pages["s:species"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/species">
<img src="/assets/icons/species.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
- <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:species"]["name"] ?></span>
+ <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:species"]["name"][$lang["_name"]] ?></span>
</a>
</div> \ No newline at end of file
diff --git a/includes/system/compare.inc b/includes/system/compare.inc
index d7fbdc6..4f9711d 100644
--- a/includes/system/compare.inc
+++ b/includes/system/compare.inc
@@ -1,4 +1,4 @@
-<?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;
+<?php global $system; global $lang; global $pages; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:compare"]["name"][$lang["_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);
@@ -19,75 +19,69 @@ function getMember(string $id) {
<br>
<div class="container">
- <h2>Compare members of the <?= $systemCommonName ?></h2>
+ <h2><?= $lang["compare"]["title"] ?> <?= $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 class="comparison-header-l0"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][5] ?></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 class="comparison-header-l0"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][5] ?></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 class="comparison-header-l0"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][5] ?></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 class="comparison-header-l0"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][5] ?></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 class="comparison-header-l0"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][5] ?></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 class="comparison-header-l0"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][5] ?></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 class="comparison-header-l0"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][5] ?></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>
@@ -97,27 +91,27 @@ function getMember(string $id) {
<?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";
+ if ($metadata["robot"]) echo $lang["species"]["earth"][0]; else if ($metadata["plush"]) echo $lang["species"]["earth"][1]; else echo $lang["species"]["earth"][2];
break;
case "alicorn":
- if ($metadata["robot"]) echo "Robot alicorn"; else if ($metadata["plush"]) echo "Alicorn plush"; else echo "Alicorn";
+ if ($metadata["robot"]) echo $lang["species"]["alicorn"][0]; else if ($metadata["plush"]) echo $lang["species"]["alicorn"][1]; else echo $lang["species"]["alicorn"][2];
break;
case "crystal":
- if ($metadata["robot"]) echo "Robot crystal pony"; else if ($metadata["plush"]) echo "Crystal pony plush"; else echo "Crystal pony";
+ if ($metadata["robot"]) echo $lang["species"]["crystal"][0]; else if ($metadata["plush"]) echo $lang["species"]["crystal"][1]; else echo $lang["species"]["crystal"][2];
break;
case "pegasus":
- if ($metadata["robot"]) echo "Robot pegasus"; else if ($metadata["plush"]) echo "Pegasus plush"; else echo "Pegasus";
+ if ($metadata["robot"]) echo $lang["species"]["pegasus"][0]; else if ($metadata["plush"]) echo $lang["species"]["pegasus"][1]; else echo $lang["species"]["pegasus"][2];
break;
case "batpony":
- if ($metadata["robot"]) echo "Robot bat pony"; else if ($metadata["plush"]) echo "Bat pony plush"; else echo "Bat pony";
+ if ($metadata["robot"]) echo $lang["species"]["batpony"][0]; else if ($metadata["plush"]) echo $lang["species"]["batpony"][1]; else echo $lang["species"]["batpony"][2];
break;
case "unicorn":
- if ($metadata["robot"]) echo "Robot unicorn"; else if ($metadata["plush"]) echo "Unicorn plush"; else echo "Unicorn";
+ if ($metadata["robot"]) echo $lang["species"]["unicorn"][0]; else if ($metadata["plush"]) echo $lang["species"]["unicorn"][1]; else echo $lang["species"]["unicorn"][2];
break;
default:
@@ -135,51 +129,51 @@ 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 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) {
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][0] ?>" 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) {
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][1] ?>" 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; ?>
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][2] ?>" 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;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][1] ?>" src="/assets/icons/partial.svg" alt="<?= $lang["compare"]["state"][1] ?>" style="width:24px;">
<?php else: ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][0] ?>" src="/assets/icons/complete.svg" alt="<?= $lang["compare"]["state"][0] ?>" style="width:24px;">
<?php endif; ?>
<?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][2] ?>" src="/assets/icons/none.svg" alt="<?= $lang["compare"]["state"][2] ?>" 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;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][0] ?>" src="/assets/icons/complete.svg" alt="<?= $lang["compare"]["state"][0] ?>" style="width:24px;">
<?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][2] ?>" src="/assets/icons/none.svg" alt="<?= $lang["compare"]["state"][2] ?>" 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 if ($metadata["little"] === 2): ?>
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][0] ?>" src="/assets/icons/complete.svg" alt="<?= $lang["compare"]["state"][0] ?>" style="width:24px;">
+ <?php elseif ($metadata["little"] === 3): ?>
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][3] ?>" src="/assets/icons/partial.svg" alt="<?= $lang["compare"]["state"][1] ?>" style="width:24px;">
<?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][2] ?>" src="/assets/icons/none.svg" alt="<?= $lang["compare"]["state"][2] ?>" 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;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][4] ?>" src="/assets/icons/partial.svg" alt="<?= $lang["compare"]["state"][4] ?>" style="width:24px;">
<?php else: ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][0] ?>" src="/assets/icons/complete.svg" alt="<?= $lang["compare"]["state"][0] ?>" style="width:24px;">
<?php endif; ?>
<?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][2] ?>" src="/assets/icons/none.svg" alt="<?= $lang["compare"]["state"][2] ?>" style="width:24px;">
<?php endif; ?>
</span>
<?php endforeach; ?>
diff --git a/includes/system/history.inc b/includes/system/history.inc
index 31a7c73..b66b8c4 100644
--- a/includes/system/history.inc
+++ b/includes/system/history.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"] . " · " . $systemCommonName; global $systemID; $title = "Front history · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $lang; global $pages; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"][$lang["_name"]] . " · " . $systemCommonName; global $systemID; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
function getMember(string $id) {
global $systemID;
@@ -28,6 +28,40 @@ function getMember(string $id) {
}
});
+ function frenchIfRequired($original) {
+ global $lang;
+
+ if ($lang["_french"]) {
+ if ($original === "Today") return "Aujourd'hui";
+ if ($original === "Yesterday") return "Hier";
+
+ $original = str_replace("Jan", "janv.", $original);
+ $original = str_replace("Feb", "fév.", $original);
+ $original = str_replace("Mar", "mars", $original);
+ $original = str_replace("Apr", "avr.", $original);
+ $original = str_replace("May", "mai", $original);
+ $original = str_replace("Jun", "juin", $original);
+ $original = str_replace("Jul", "juil.", $original);
+ $original = str_replace("Aug", "août", $original);
+ $original = str_replace("Sep", "sept.", $original);
+ $original = str_replace("Oct", "oct.", $original);
+ $original = str_replace("Nov", "nov.", $original);
+ $original = str_replace("Dec", "déc.", $original);
+
+ $original = str_replace("Mon", "Lun.", $original);
+ $original = str_replace("Tue", "Mar.", $original);
+ $original = str_replace("Wed", "Mer.", $original);
+ $original = str_replace("Thu", "Jeu.", $original);
+ $original = str_replace("Fri", "Ven.", $original);
+ $original = str_replace("Sat", "Sam.", $original);
+ $original = str_replace("Sun", "Dim.", $original);
+
+ return $original;
+ } else {
+ return $original;
+ }
+ }
+
function getSwitchesForDay(int $day) {
global $switches;
@@ -76,9 +110,9 @@ function getMember(string $id) {
}
?>
- <h2>Front history in the <?= $systemCommonName ?></h2>
+ <h2><?= $lang["history"]["title"] ?> <?= $systemCommonName ?></h2>
<div class="alert alert-warning" id="timezone" style="display: none;">
- Times on this page are now shown using your local timezone (<span id="timezone-name">-</span>). Days start at <span id="day-start">-</span> (00:00 on UTC).
+ <?= str_replace("%1", '<span id="timezone-name">-</span>', str_replace("%2", '<span id="day-start">-</span>', $lang["history"]["timezone"])) ?>
<script>
document.getElementById("day-start").innerText = new Date(<?= strtotime(date('Y-m-d')) ?> * 1000).toTimeString().substring(0, 5);
document.getElementById("timezone-name").innerText = new Date().toTimeString().split("(")[1].split(")")[0];
@@ -99,7 +133,7 @@ function getMember(string $id) {
$switchesDay = getSwitchesForDay($day[1]);
$switchesDay[] = getSwitchBefore($switchesDay[count($switchesDay) - 1]["id"]);
?>
- <h4 style="margin-top:15px;"><?= $day[0] ?></h4>
+ <h4 style="margin-top:15px;"><?= frenchIfRequired($day[0]) ?></h4>
<?php foreach ($switchesDay as $switch): $switch["timestamp"] = strtotime($switch["timestamp"]); ?>
<?php if (isset($switch["members"][0])): $member = getMemberWithoutSystem($switch["members"][0]); ?>
<div class="fronter">
@@ -111,7 +145,7 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (count($switch["members"]) > 1): ?>
- (with
+ (<?= $lang["system"]["with"] ?>
<?php if (isset($switch["members"][1])): $member2 = getMember($switch["members"][1]); ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?><?php if (isset($switch["members"][2])): $member2 = getMember($switch["members"][2]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?><?php if (isset($switch["members"][3])): $member2 = getMember($switch["members"][3]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?>)
<?php endif; ?>
</span>
@@ -122,7 +156,7 @@ function getMember(string $id) {
<?= isNotToday($switch["timestamp"], $day[1]) ? "00:00" : date('H:i', $switch["timestamp"]) ?>
</span>
<span class="fronter-profile" style="vertical-align: middle;">
- <span class="text-muted">Fallback pony</span>
+ <span class="text-muted"><?= $lang["history"]["fallback"] ?></span>
</span>
</div>
<?php endif; ?>
diff --git a/includes/system/species.inc b/includes/system/species.inc
index fb1ba69..45a0178 100644
--- a/includes/system/species.inc
+++ b/includes/system/species.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:species"]["name"] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling;
+<?php global $system; global $systemCommonName; global $lang; global $pages; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:species"]["name"][$lang["_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);
$members = scoreOrder($members, $systemID);
@@ -36,7 +36,7 @@ function species(array $members, string $id, string $name) { global $systemID; g
<br>
<div class="container" id="page-content">
- <h2><?= $systemCommonName ?> members by species</h2>
+ <h2><?= str_replace("%1", $systemCommonName, $lang["species_compare"]["title"]) ?></h2>
<?php
$earth = [];
@@ -59,12 +59,12 @@ function species(array $members, string $id, string $name) { global $systemID; g
?>
- <?php species($earth, "earth", "Earth ponies"); ?>
- <?php species($pegasus, "pegasus", "Pegasi"); ?>
- <?php species($unicorn, "unicorn", "Unicorns"); ?>
- <?php species($alicorn, "alicorn", "Alicorns"); ?>
- <?php species($batpony, "batpony", "Bat ponies"); ?>
- <?php species($crystal, "crystal", "Crystal ponies"); ?>
+ <?php species($earth, "earth", $lang["species"]["earth"][3]); ?>
+ <?php species($pegasus, "pegasus", $lang["species"]["pegasus"][3]); ?>
+ <?php species($unicorn, "unicorn", $lang["species"]["unicorn"][3]); ?>
+ <?php species($alicorn, "alicorn", $lang["species"]["alicorn"][3]); ?>
+ <?php species($batpony, "batpony", $lang["species"]["batpony"][3]); ?>
+ <?php species($crystal, "crystal", $lang["species"]["crystal"][3]); ?>
</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/system/subsystem.inc b/includes/system/subsystem.inc
index b7d73f1..3269df7 100644
--- a/includes/system/subsystem.inc
+++ b/includes/system/subsystem.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $parts; global $systemID;
+<?php global $system; global $systemCommonName; global $lang; global $pages; global $parts; global $systemID;
if (str_ends_with($_GET['_'], "/subsystem")) header("Location: /?error=Invalid subsystem ID") and die();
diff --git a/includes/system/tree.inc b/includes/system/tree.inc
index 92e7c08..6a2d1cc 100644
--- a/includes/system/tree.inc
+++ b/includes/system/tree.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:tree"]["name"] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $systemCommonName; global $lang; global $pages; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:tree"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true);
$members = scoreOrder($members, $systemID);
@@ -61,16 +61,16 @@ function getMemberSubsystem(array $member) {
<br>
<div class="container" id="page-content">
- <h2>System tree for the <?= $systemCommonName ?></h2>
+ <h2><?= $lang["tree"]["title"] ?> <?= $systemCommonName ?></h2>
<a class="tree-root member-link" href="/<?= $system ?>">
- <img src="/assets/uploads/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/" . $system . ".png") ? $system : "" ?>.png" style="width:24px;"> <span style="vertical-align: middle;"><?= $systemCommonName ?></span></a>
+ <img src="/assets/uploads/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/" . $system . ".png") ? $system : "" ?>.png" style="height:24px;"> <span style="vertical-align: middle;"><?= $systemCommonName ?></span></a>
<?php $first = true; ?>
<?php foreach ($subsystems as $subsystem): if ($subsystem["source_type"] === "trait"): ?>
<div class="tree-l0">
<div class="tree-l0-separator<?= $first ? " tree-first-separator" : "" ?>">&nbsp;</div>
<div class="tree-inner">
<a class="member-link" href="/<?= $systemID === "gdapd" ? "raindrops" : "cloudburst" ?>/-/subsystem/<?= $subsystem["source"] ?>">
- <img src="/assets/uploads/ss-<?= $subsystem["source"] ?>.png" style="width:24px;border-radius:5px;"> <span style="vertical-align: middle;"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json"), true)["name"] : $subsystem["source"] ?></span>
+ <img src="/assets/uploads/ss-<?= $subsystem["source"] ?>.png" style="height:24px;border-radius:5px;"> <span style="vertical-align: middle;"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json"), true)["name"] : $subsystem["source"] ?></span>
</a>
</div>
<?php $ssfirst = true; foreach ($subsystem["members"] as $ssm): $ssmember = getMember($ssm); ?>
@@ -79,7 +79,7 @@ function getMemberSubsystem(array $member) {
<div class="tree-l1-separator<?= $ssfirst ? " tree-first-separator" : "" ?>">&nbsp;</div>
<div class="tree-inner">
<a class="member-link" href="/<?= $ssmember["name"] ?>">
- <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
+ <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
</a>
</div>
</div>
@@ -91,7 +91,7 @@ function getMemberSubsystem(array $member) {
<div class="tree-l0-separator<?= $first ? " tree-first-separator" : "" ?>">&nbsp;</div>
<div class="tree-inner">
<a class="member-link" href="/<?= $member["name"] ?>">
- <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $member["display_name"] ?? $member["name"] ?></span>
+ <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $member["display_name"] ?? $member["name"] ?></span>
</a>
</div>
<?php if (memberHasSubsystem($member)): ?>
@@ -101,7 +101,7 @@ function getMemberSubsystem(array $member) {
<div class="tree-l1-separator<?= $ssfirst ? " tree-first-separator" : "" ?>">&nbsp;</div>
<div class="tree-inner">
<a class="member-link" href="/<?= $ssmember["name"] ?>">
- <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
+ <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
</a>
</div>
</div>
diff --git a/includes/titlebar.inc b/includes/titlebar.inc
index 5166f08..b0c1e8b 100644
--- a/includes/titlebar.inc
+++ b/includes/titlebar.inc
@@ -1,4 +1,4 @@
-<?php global $toplevel; global $system; global $isLoggedIn; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); ?>
+<?php global $toplevel; global $system; global $isLoggedIn; global $lang; global $pages; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); global $lang; global $pages; ?>
<span>
<?php
@@ -16,7 +16,7 @@ $part3 = null;
if (isset($pages[$name])) {
if (($name === "docs" || $name === "toys" || $name === "actions" || $name === "computers") && isset($parts[2])) {
$part3 = "<a class='title-bar-backlink' href='/-/dashboard'>Dashboard</a>";
- $part2 = "<a class='title-bar-backlink' href='/-/$name'>" . $pages[$name]['name'] . "</a>";
+ $part2 = "<a class='title-bar-backlink' href='/-/$name'>" . $pages[$name]['name'][$lang["_name"]] . "</a>";
if ($name === "docs") {
$actionsProfile = "docs-item";
@@ -32,10 +32,10 @@ if (isset($pages[$name])) {
}
} else {
if ($pages[$name]["admin"]) {
- $part1 = $pages[$name]['name'];
+ $part1 = $pages[$name]['name'][$lang["_name"]];
$part2 = "<a class='title-bar-backlink' href='/-/dashboard'>Dashboard</a>";
} else {
- $part1 = $pages[$name]['name'];
+ $part1 = $pages[$name]['name'][$lang["_name"]];
}
}
} elseif ($name === "cloudburst") {
@@ -46,7 +46,7 @@ if (isset($pages[$name])) {
$actionsProfile = "subsystem";
$part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/ynmuc-$parts[3].json"), true)["name"];
} else {
- $part1 = $pages["s:" . $parts[2]]['name'] ?? $parts[2];
+ $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2];
}
} else {
$actionsProfile = "system";
@@ -60,7 +60,7 @@ if (isset($pages[$name])) {
$actionsProfile = "subsystem";
$part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/gdapd-$parts[3].json"), true)["name"];
} else {
- $part1 = $pages["s:" . $parts[2]]['name'] ?? $parts[2];
+ $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2];
}
} else {
$actionsProfile = "system";
@@ -147,7 +147,7 @@ echo("</span>");
$links = [
"default" => [
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -185,7 +185,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -234,7 +234,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -254,7 +254,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -274,7 +274,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -285,7 +285,7 @@ $links = [
],
"member" => [
[
- "name" => "System",
+ "name" => $lang["titlebar"]["member"],
"link" => [
"type" => "url",
"text" => "/$system"
@@ -294,7 +294,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["edit-private"]["name"],
+ "name" => $pages["edit-private"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/-/edit-private/$system/$name"
@@ -304,7 +304,7 @@ $links = [
"show" => $isLoggedIn
],
[
- "name" => $pages["edit"]["name"],
+ "name" => $pages["edit"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/-/edit/$system/$name"
@@ -314,7 +314,7 @@ $links = [
"show" => $isLoggedIn
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -325,7 +325,7 @@ $links = [
],
"subsystem" => [
[
- "name" => "Parent system",
+ "name" => $lang["titlebar"]["subsystem"],
"link" => [
"type" => "url",
"text" => "/$parts[0]"
@@ -334,7 +334,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["edit"]["name"],
+ "name" => $pages["edit"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/-/edit/$system/" . ($parts[3] ?? null)
@@ -344,7 +344,7 @@ $links = [
"show" => $isLoggedIn
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -355,15 +355,6 @@ $links = [
],
"home" => [
[
- "name" => "Cloudburst System",
- "link" => [
- "type" => "url",
- "text" => "/cloudburst"
- ],
- "icon" => "/assets/avatars/ade46823206b4b0cad3ccaae934a5f3b.webp",
- "invert" => false
- ],
- [
"name" => "Raindrops System",
"link" => [
"type" => "url",
@@ -373,7 +364,7 @@ $links = [
"invert" => false
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -442,7 +433,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -462,7 +453,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -473,7 +464,7 @@ $links = [
],
"debug" => [
[
- "name" => "Reported failures",
+ "name" => $lang["titlebar"]["debug"][0],
"link" => [
"type" => "url",
"text" => "#failures"
@@ -482,7 +473,7 @@ $links = [
"invert" => true
],
[
- "name" => "Processing times",
+ "name" => $lang["titlebar"]["debug"][1],
"link" => [
"type" => "url",
"text" => "#times"
@@ -491,7 +482,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -542,7 +533,7 @@ $links = [
],
"system" => [
[
- "name" => $pages["s:history"]["name"],
+ "name" => $pages["s:history"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/$name/-/history"
@@ -551,7 +542,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["s:compare"]["name"],
+ "name" => $pages["s:compare"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/$name/-/compare"
@@ -560,7 +551,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["s:tree"]["name"],
+ "name" => $pages["s:tree"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/$name/-/tree"
@@ -569,7 +560,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["s:species"]["name"],
+ "name" => $pages["s:species"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/$name/-/species"
@@ -578,7 +569,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["edit"]["name"],
+ "name" => $pages["edit"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/-/edit/$name"
@@ -588,7 +579,7 @@ $links = [
"show" => $isLoggedIn
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -599,6 +590,18 @@ $links = [
]
];
+if ($_SERVER['HTTP_HOST'] !== "fr.equestria.horse") {
+ array_unshift($links["home"], [
+ "name" => "Cloudburst System",
+ "link" => [
+ "type" => "url",
+ "text" => "/cloudburst"
+ ],
+ "icon" => "/assets/avatars/ade46823206b4b0cad3ccaae934a5f3b.webp",
+ "invert" => false
+ ]);
+}
+
$linksList = $links[isset($links[$actionsProfile]) ? $actionsProfile : "default"];
?><!-- (<code><?= $actionsProfile ?></code>)--><!--<pre><?php var_dump($parts); ?></pre>-->
diff --git a/includes/travelling.inc b/includes/travelling.inc
index b0b58f0..18bf22e 100644
--- a/includes/travelling.inc
+++ b/includes/travelling.inc
@@ -25,6 +25,10 @@ foreach ($members as $member) {
@file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT)));
}
+
+ if (!isset($travelling[$member["id"]]["equestria"])) {
+ $travelling[$member["id"]]["equestria"] = false;
+ }
}
function withTravelers(array $members, string $system): array {
@@ -35,13 +39,13 @@ function withTravelers(array $members, string $system): array {
$i['system'] = $system;
return $i;
}, array_filter($members, function ($i) use ($travelling) {
- return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']);
+ return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']));
})),
...array_filter(array_map(function ($i) use ($system) {
$i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd";
return $i;
}, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true)), function ($i) use ($travelling) {
- return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'];
+ return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']);
})
];
} \ No newline at end of file