From b5f589c323f415bb42ea7069cb4d1a8a2233dd69 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 31 Aug 2022 22:03:07 +0200 Subject: Update I guess - Stuffie --- pages/nicknames.php | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 pages/nicknames.php (limited to 'pages/nicknames.php') diff --git a/pages/nicknames.php b/pages/nicknames.php new file mode 100644 index 0000000..050c275 --- /dev/null +++ b/pages/nicknames.php @@ -0,0 +1,117 @@ + $i + ]; + $r["type"] = "marefriends"; + return $r; + }, $member["_metadata"]["marefriends"] ?? []), + ...array_map(function ($i) { + $r = [ + "name" => $i + ]; + $r["type"] = "sisters"; + return $r; + }, $member["_metadata"]["sisters"] ?? []), + ...array_map(function ($i) { + $r = [ + "name" => $i + ]; + $r["type"] = "caretaking"; + return $r; + }, $member["_metadata"]["caretakers"] ?? []) + ] as $rel) { + $id = $rel["name"]; + $otherMember = getSystemMember(explode("/", $id)[0], explode("/", $id)[1]); + + $parts = [ + $member["id"], + $otherMember["id"] + ]; + + asort($parts); + + $relations[implode("-", $parts)] = [ + "id" => implode("", $parts), + "name" => getMiniName($member["display_name"] ?? $member["name"]) . " and " . getMiniName($otherMember["display_name"] ?? $otherMember["name"]), + "type" => $rel["type"], + "images" => [ + file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-$member[name].png") ? "/assets/uploads/pt-$member[name].png" : "/assets/uploads/pt.png", + file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-$otherMember[name].png") ? "/assets/uploads/pt-$otherMember[name].png" : "/assets/uploads/pt.png", + ] + ]; + } +} + +$nicknames = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/nicknames.json"), true); + +?> + +
+
+ +
+ + + + -- cgit