diff options
author | Minteck <contact@minteck.org> | 2022-12-10 22:27:08 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-12-10 22:27:08 +0100 |
commit | 30303a3ad0d0f31d93c25f42bfd10d70e8277b72 (patch) | |
tree | 622964e7895c759232aff28230394aa5cc747be9 /includes/travelling.inc | |
parent | f850a8a53efd719fef6c8784c5af7b89dd9a6a2f (diff) | |
download | pluralconnect-30303a3ad0d0f31d93c25f42bfd10d70e8277b72.tar.gz pluralconnect-30303a3ad0d0f31d93c25f42bfd10d70e8277b72.tar.bz2 pluralconnect-30303a3ad0d0f31d93c25f42bfd10d70e8277b72.zip |
Update
Diffstat (limited to 'includes/travelling.inc')
-rw-r--r-- | includes/travelling.inc | 8 |
1 files changed, 6 insertions, 2 deletions
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 |