From eb89b15c0f044673c1206a418a21d0baba1a675e Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 12 Mar 2023 19:16:53 +0100 Subject: Updated 104 files, added 3 files, deleted 4 files and renamed 36 files (automated) --- includes/travelling.inc | 62 ------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 includes/travelling.inc (limited to 'includes/travelling.inc') diff --git a/includes/travelling.inc b/includes/travelling.inc deleted file mode 100644 index 0d1696a..0000000 --- a/includes/travelling.inc +++ /dev/null @@ -1,62 +0,0 @@ - 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']); - }) - ]; - } -} \ No newline at end of file -- cgit