summaryrefslogtreecommitdiff
path: root/includes/util
diff options
context:
space:
mode:
Diffstat (limited to 'includes/util')
-rw-r--r--includes/util/agewarning.inc4
-rw-r--r--includes/util/banner.inc22
-rw-r--r--includes/util/functions.inc58
-rw-r--r--includes/util/homepage.inc9
-rw-r--r--includes/util/rainbow.inc12
-rw-r--r--includes/util/score.inc28
-rw-r--r--includes/util/session.inc5
-rw-r--r--includes/util/short.inc3
-rw-r--r--includes/util/travelling.inc61
9 files changed, 25 insertions, 177 deletions
diff --git a/includes/util/agewarning.inc b/includes/util/agewarning.inc
index 66a163c..8f3753c 100644
--- a/includes/util/agewarning.inc
+++ b/includes/util/agewarning.inc
@@ -12,7 +12,7 @@ function showWarning($name, $id, $system) {
"Title: " . formatPonypush("⚠️ $name does not have an age or birth year set") . "\r\n" .
"Priority: max\r\n" .
"Tags: switch\r\n" .
- "Actions: view, Edit on Ponycule, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
+ "Actions: view, Edit on Ponycule, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : ($system === "hrbom" ? "moonglow" : $GLOBALS["ColdHazeApp"]["other"]["slug"])) . "/" . $id . "/, clear=true\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
'content' => formatPonypush("To make sure they appear on the fronting schedule (and to make sure they can front again), they need to set an age or birth year now.")
]
@@ -26,7 +26,7 @@ function showWarning($name, $id, $system) {
"Title: " . formatPonypush("⚠️ $name does not have an age or birth year set") . "\r\n" .
"Priority: max\r\n" .
"Tags: switch\r\n" .
- "Actions: view, Edit on Ponycule, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
+ "Actions: view, Edit on Ponycule, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : ($system === "hrbom" ? "moonglow" : $GLOBALS["ColdHazeApp"]["other"]["slug"])) . "/" . $id . "/, clear=true\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
'content' => formatPonypush("To make sure they still appear on the fronting schedule after March 1st, they need to set an age or birth year now.")
]
diff --git a/includes/util/banner.inc b/includes/util/banner.inc
index 955b93d..ea8a1eb 100644
--- a/includes/util/banner.inc
+++ b/includes/util/banner.inc
@@ -187,28 +187,12 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
$app = $GLOBALS["ColdHazeApp"];
$systemData = [];
- $systemData['page'] = "/" . ($system === "gdapd" ? "raindrops" : ($system === $app["other"]["id"] ? $app["other"]["slug"] : ($system === "hrbom" ? "moonglow" : "cloudburst")));
+ $systemData['page'] = "/" . ($system === "gdapd" ? "raindrops" : ($system === $app["other"]["id"] ? $app["other"]["slug"] : "moonglow"));
$systemData['icon'] = getAsset($system);
- $systemData['name'] = $system === "gdapd" ? "Raindrops" : ($system === $app["other"]["id"] ? $app["other"]["short"] : ($system === "hrbom" ? "Moonglow" : "Cloudburst"));
- $systemData['full_name'] = $system === "gdapd" ? "Raindrops System" : ($system === $app["other"]["id"] ? $app["other"]["name"] : ($system === "hrbom" ? "Moonglow" : "Cloudburst System"));
+ $systemData['name'] = $system === "gdapd" ? "Raindrops" : ($system === $app["other"]["id"] ? $app["other"]["short"] : "Moonglow");
+ $systemData['full_name'] = $system === "gdapd" ? "Raindrops System" : ($system === $app["other"]["id"] ? $app["other"]["name"] : "Moonglow");
$systemData['temporary'] = false;
- if (isset($travelling[$member['id']]) && $travelling[$member['id']]["travelling"] && !$travelling[$member['id']]["equestria"]) {
- $systemData['page'] = "/" . ($system === "gdapd" ? "cloudburst" : "raindrops");
- $systemData['icon'] = getAsset($system === "gdapd" ? "ynmuc" : "gdapd");
- $systemData['name'] = $system === "gdapd" ? "Cloudburst" : "Raindrops";
- $systemData['full_name'] = $system === "gdapd" ? "Cloudburst System" : "Raindrops System";
- $systemData['temporary'] = true;
- }
-
- if (isset($travelling[$member['id']]) && $travelling[$member['id']]["travelling"] && $travelling[$member['id']]["equestria"]) {
- $systemData['page'] = null;
- $systemData['icon'] = "/assets/logo/equestria.png";
- $systemData['name'] = "Equestria";
- $systemData['full_name'] = "Equestria";
- $systemData['temporary'] = true;
- }
-
$marefriends = [];
foreach ($metadata["marefriends"] as $marefriend) {
$mfSystem = explode("/", $marefriend)[0];
diff --git a/includes/util/functions.inc b/includes/util/functions.inc
index 67b1786..87954ea 100644
--- a/includes/util/functions.inc
+++ b/includes/util/functions.inc
@@ -127,9 +127,9 @@ if (!function_exists("getAsset")) {
$id = $id1 . $id2;
if (str_ends_with((getMemberWithoutSystem($memberID) ?? ['name' => ''])["name"], "-travelling")) {
- $id1 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/general.json"), true)["uuid"]);
+ $id1 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "hrbom" : "gdapd") . "/general.json"), true)["uuid"]);
- $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true);
+ $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "hrbom" : "gdapd") . "/members.json"), true);
$list = array_map(function ($i) {
return $i["name"];
}, $members);
@@ -322,13 +322,6 @@ if (!function_exists("getMemberWithoutSystem")) {
global $isLowerLoggedIn; global $isLoggedIn;
$member = null;
- $members1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true);
- foreach ($members1 as $m) {
- $m["_system"] = "ynmuc";
- $m["system"] = "ynmuc";
- if ($m["id"] === $id) $member = $m;
- }
-
$members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true);
foreach ($members2 as $m) {
$m["_system"] = "gdapd";
@@ -345,9 +338,9 @@ if (!function_exists("getMemberWithoutSystem")) {
if ($isLowerLoggedIn || $isLoggedIn) {
$app = $GLOBALS["ColdHazeApp"] ?? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
- $members3 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true);
+ $members4 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true);
- foreach ($members3 as $m) {
+ foreach ($members4 as $m) {
$m["_system"] = $app["other"]["id"];
$m["system"] = $app["other"]["id"];
if ($m["id"] === $id) $member = $m;
@@ -396,11 +389,11 @@ if (!function_exists("showSystem")) {
$global = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/general.json"), true);
if ($hideTitle) {
- echo('<div id="hpd-' . ($id === "gdapd" ? "raindrops" : ($id === "ynmuc" ? "cloudburst" : "other")) . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px;display:grid;grid-template-columns: 1fr;margin-bottom:10px;">');
+ echo('<div id="hpd-' . ($id === "gdapd" ? "raindrops" : ($id === "hrbom" ? "moonglow" : "other")) . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px;display:grid;grid-template-columns: 1fr;margin-bottom:10px;">');
} else {
- echo('<div id="hpd-' . ($id === "gdapd" ? "raindrops" : ($id === "ynmuc" ? "cloudburst" : "other")) . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px 10px 10px 20px;display:grid;grid-template-columns: 128px 1fr;margin-bottom:10px;">');
+ echo('<div id="hpd-' . ($id === "gdapd" ? "raindrops" : ($id === "hrbom" ? "moonglow" : "other")) . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px 10px 10px 20px;display:grid;grid-template-columns: 128px 1fr;margin-bottom:10px;">');
}
- if (!$hideTitle) echo('<a style="display:flex;margin: -10px -20px;align-items:center;justify-content:center;text-align:center;padding: 10px 20px;border-radius: 10px;background: #' . $global['color'] . '55;width: 148px;text-decoration:none;color:white;filter:none !important;" href="/' . ($id === "gdapd" ? "raindrops" : ($id === $app["other"]["id"] ? $app["other"]["slug"] : "cloudburst")) . '" class="hpd-system">
+ if (!$hideTitle) echo('<a style="display:flex;margin: -10px -20px;align-items:center;justify-content:center;text-align:center;padding: 10px 20px;border-radius: 10px;background: #' . $global['color'] . '55;width: 148px;text-decoration:none;color:white;filter:none !important;" href="/' . ($id === "gdapd" ? "raindrops" : ($id === $app["other"]["id"] ? $app["other"]["slug"] : "moonglow")) . '" class="hpd-system">
<div style="text-align:center;"><img src="' . getAsset($id) . '" style="width:64px;"><br>' . $name . '</div>
</a>');
@@ -410,29 +403,12 @@ if (!function_exists("showSystem")) {
echo(' <div style="display:grid;grid-template-columns:repeat(6, 1fr);padding-left:10px;grid-gap:10px;">');
}
- if ($id === $app["other"]["id"]) {
- showMembersFromList(scoreOrder([...array_map(function ($i) use ($id, $travelling) {
- $i["travelling"] = false;
- $i["system"] = $id;
- $i["equestria"] = false;
- return $i;
- }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/members.json"), true))], $id));
- } else {
- showMembersFromList(scoreOrder([...array_map(function ($i) use ($id, $travelling) {
- $i["travelling"] = false;
- $i["system"] = $id;
- if (isset($travelling[$i['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/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/members.json"), true), function ($i) use ($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'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']);
- }))], $id));
- }
+ showMembersFromList(scoreOrder([...array_map(function ($i) use ($id, $travelling) {
+ $i["travelling"] = false;
+ $i["system"] = $id;
+ $i["equestria"] = false;
+ return $i;
+ }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/members.json"), true))], $id));
echo('</div>
@@ -440,12 +416,6 @@ if (!function_exists("showSystem")) {
}
}
-if (!function_exists("cloudburst")) {
- function cloudburst(bool $hideTitle): void {
- showSystem("ynmuc", "Cloudburst System", "#5f08a9a6", $hideTitle);
- }
-}
-
if (!function_exists("raindrops")) {
function raindrops(bool $hideTitle): void {
showSystem("gdapd", "Raindrops System", "#a95f08a6", $hideTitle);
@@ -647,7 +617,7 @@ if (!function_exists("getMemberSystem")) {
if (!function_exists("getMemberFromName")) {
function getMemberFromName(string $name) {
- $list = [...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true)];
+ $list = [...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/hrbom/members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true)];
foreach ($list as $item) {
if ($item["name"] === $name) return getMemberWithoutSystem($item["id"]);
diff --git a/includes/util/homepage.inc b/includes/util/homepage.inc
index a78c28d..45f91b6 100644
--- a/includes/util/homepage.inc
+++ b/includes/util/homepage.inc
@@ -20,15 +20,8 @@ function newHomepage($id, $page, $title) {
<div class="new-homepage-system-list" id="new-homepage-system-<?= $id ?>-list">
<?php $list = array_values(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $id . "/members.json"), true), $id), $id)); foreach ($list as $index => $member): ?>
<a href="/<?= $member["name"] ?>" class="new-homepage-link <?= $index === count($list) - 1 ? "new-homepage-link-last" : "" ?>" style="color: white; text-decoration: none !important; display: block; background-color: #<?= $member["color"] ?>22; padding: 5px 10px;">
- <img src="<?= getAsset(isset($travelling[$member["id"]]) && ($travelling[$member["id"]]["travelling"] && !$travelling[$member["id"]]["equestria"]) ? ($id === "gdapd" ? "ynmuc" : "gdapd") : $id, $member["id"]) ?>" style="width: 32px; height: 32px; vertical-align: middle; background-color: rgba(0, 0, 0, .25); border-radius: 999px;">
+ <img src="<?= getAsset($id, $member["id"]) ?>" style="width: 32px; height: 32px; vertical-align: middle; background-color: rgba(0, 0, 0, .25); border-radius: 999px;">
<span style="width: calc(100% - 37px); vertical-align: middle; margin-left: 5px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;"><?= $member["display_name"] ?? $member["name"] ?></span>
- <span style="vertical-align: middle; float:right;">
- <?php if (isset($travelling[$member["id"]]) && $travelling[$member["id"]]["travelling"] && $travelling[$member["id"]]["equestria"]): ?>
- <img src="/assets/logo/<?= $member["_metadata"]["fictive"] ? "equestria" : ($member["_metadata"]["fictive2"] ? "celeste" : "") ?>.png" style="width: 24px; height: 24px; margin-top: 5px;">
- <?php elseif (isset($travelling[$member["id"]]) && $travelling[$member["id"]]["travelling"]): ?>
- <img src="<?= getAsset($id === "gdapd" ? "ynmuc" : "gdapd") ?>" style="width: 24px; height: 24px; margin-top: 5px;">
- <?php endif; ?>
- </span>
</a>
<?php endforeach; ?>
</div>
diff --git a/includes/util/rainbow.inc b/includes/util/rainbow.inc
index 3dc9480..027c771 100644
--- a/includes/util/rainbow.inc
+++ b/includes/util/rainbow.inc
@@ -3,15 +3,9 @@
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc";
-function rainbow($hideCloudburst = false): array {
+function rainbow(): array {
$members = scoreOrderGlobal();
- if ($hideCloudburst) {
- $members = array_filter($members, function ($i) {
- return $i["_system"] === "gdapd";
- });
- }
-
$data = [];
foreach ($members as $member) {
@@ -39,8 +33,8 @@ function rainbow($hideCloudburst = false): array {
return $data;
}
-function getMembersByColor($hideCloudburst = false, $ignoreHumans = false): array {
- $members = rainbow($hideCloudburst);
+function getMembersByColor($_ = false, $ignoreHumans = false): array {
+ $members = rainbow();
uasort($members, function ($a, $b) {
return $a['hsl'][0] - $b['hsl'][0];
diff --git a/includes/util/score.inc b/includes/util/score.inc
index b70f866..622f057 100644
--- a/includes/util/score.inc
+++ b/includes/util/score.inc
@@ -113,34 +113,6 @@ function scoreOrderGlobal() {
}
}
- foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) {
- if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_starts_with($member["name"], "smol") && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) {
- if (isset($member["color"])) {
- $rgb = [
- hexdec(substr($member["color"], 0, 2)),
- hexdec(substr($member["color"], 2, 2)),
- hexdec(substr($member["color"], 4, 2))
- ];
- $hsl = rgbToHsl(
- $rgb[0],
- $rgb[1],
- $rgb[2]
- );
- } else {
- $rgb = [255, 255, 255];
- $hsl = rgbToHsl(255, 255, 255);
- }
- $member["_score"] = $hsl[0];
- $member["_system"] = "ynmuc";
- $member["system"] = "ynmuc";
- $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true));
-
- if (!isset($member["_metadata"]["private"]) || !$member["_metadata"]["private"] || $isLoggedIn || $isLowerLoggedIn) {
- $ordered[] = $member;
- }
- }
- }
-
if ($isLowerLoggedIn || $isLoggedIn) {
$app = $GLOBALS["ColdHazeApp"] ?? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true) as $member) {
diff --git a/includes/util/session.inc b/includes/util/session.inc
index 6449ee9..867b306 100644
--- a/includes/util/session.inc
+++ b/includes/util/session.inc
@@ -66,11 +66,6 @@ if (isset($token)) {
$_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true);
}
- if (isset($_GET['invert'])) {
- $_PROFILE["login"] = $_PROFILE["login"] === "raindrops" ? "cloudburst" : "raindrops";
- $_PROFILE["name"] = $_PROFILE["name"] === "Raindrops System" ? "Cloudburst System" : "Raindrops System";
- }
-
$isLoggedIn = true;
} elseif (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . str_replace("/", "", $token))) {
$data = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . str_replace("/", "", $token))), true);
diff --git a/includes/util/short.inc b/includes/util/short.inc
index 81c389d..1654d93 100644
--- a/includes/util/short.inc
+++ b/includes/util/short.inc
@@ -9,11 +9,8 @@ header("Content-Type: text/plain");
$members = scoreOrderGlobal();
$list = [
"rd" => "/raindrops",
- "cb" => "/cloudburst",
"minty" => "/cloudydreams",
"violetdawn" => "/sandydawn",
- "twilight" => "/twi",
- "luna" => "/princessluna",
"cloudy" => "/cloudydreams",
"zipp" => "/zippstorm",
"babs" => "/fleurheartseed",
diff --git a/includes/util/travelling.inc b/includes/util/travelling.inc
index eced4f2..b1479fb 100644
--- a/includes/util/travelling.inc
+++ b/includes/util/travelling.inc
@@ -1,62 +1,5 @@
<?php
-$app = $GLOBALS["ColdHazeApp"] ?? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
-$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
-
-$json_cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true);
-$json_raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true);
-$json_other = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true);
-
-if (!isset($json_cloudburst)) $json_cloudburst = [];
-if (!isset($json_raindrops)) $json_raindrops = [];
-if (!isset($json_other)) $json_other = [];
-
-$members = [...array_map(function ($i) {
- $i["_system"] = "ynmuc";
- return $i;
-}, $json_cloudburst), ...array_map(function ($i) {
- $i["_system"] = "gdapd";
- return $i;
-}, $json_raindrops), ...array_map(function ($i) use ($app) {
- $i["_system"] = $app["other"]["id"];
- return $i;
-}, $json_other)];
-
-foreach ($members as $member) {
- if (!isset($travelling[$member["id"]])) {
- $travelling[$member["id"]] = [
- "travelling" => false,
- "history" => []
- ];
-
- @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 {
- global $travelling;
- global $app;
-
- if ($system === $app["other"]["id"]) {
- return $members;
- } else {
- return [
- ...array_map(function ($i) use ($system) {
- $i['system'] = $system;
- return $i;
- }, array_filter($members, function ($i) use ($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'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']);
- })
- ];
- }
+function withTravelers(array $members): array {
+ return $members;
} \ No newline at end of file