From abd342282b48d742cca1740f76d220037fd13800 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 5 Feb 2023 13:00:59 +0100 Subject: Updated 6 files, added 2 files and renamed assets/uploads/pt-twilight.png (automated) --- api/pluralkit-integration.php | 26 ++++++++++++++++++++++++-- api/test1.php | 9 +++------ 2 files changed, 27 insertions(+), 8 deletions(-) (limited to 'api') diff --git a/api/pluralkit-integration.php b/api/pluralkit-integration.php index 6d1166c..b3badd7 100644 --- a/api/pluralkit-integration.php +++ b/api/pluralkit-integration.php @@ -1,5 +1,7 @@ 0) { + foreach ($fronters["members"] as $member) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member["id"] . ".json")) { + $metadata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member["id"] . ".json"), true); + + if (!isset($metadata["birth"])) { + showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); + } else if (isset($metadata['birth']["age"]) && $metadata["birth"]["age"] === 0 && (!isset($metadata['birth']["year"]) || $metadata["birth"]["year"] < 1900)) { + showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); + } else if (isset($metadata['birth']["year"]) && $metadata["birth"]["year"] < 1900) { + showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); + } else if (!isset($metadata['birth']["year"]) && !isset($metadata['birth']["age"])) { + showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); + } + } + } + } + if (count($fronters["members"]) > 1) { $context = stream_context_create([ 'http' => [ diff --git a/api/test1.php b/api/test1.php index 6d25f85..a8c9c97 100644 --- a/api/test1.php +++ b/api/test1.php @@ -1,8 +1,5 @@