diff options
author | RaindropsSys <contact@minteck.org> | 2023-04-13 22:07:44 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-04-13 22:07:44 +0200 |
commit | eb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce (patch) | |
tree | c15e12e96e0e83b665e4931df50bc034620fde3e /includes/util | |
parent | eafc2b02a66838fdadb2da70d5b1a9aa04051de6 (diff) | |
download | pluralconnect-eb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce.tar.gz pluralconnect-eb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce.tar.bz2 pluralconnect-eb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce.zip |
Updated 13 files and added 2 files (automated)
Diffstat (limited to 'includes/util')
-rw-r--r-- | includes/util/banner.inc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/includes/util/banner.inc b/includes/util/banner.inc index 947e5c6..0db683f 100644 --- a/includes/util/banner.inc +++ b/includes/util/banner.inc @@ -132,6 +132,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "batpony" => $metadata["robot"] ? "Robot Poney chauve souris" : (!$metadata["plush"] ? "Poney chauve souris" : "Poney chauve souris en peluche"), "unicorn" => $metadata["robot"] ? "Robot licorne" : (!$metadata["plush"] ? "Licorne" : "Licorne en peluche"), "changeling" => "Changelin", + "merpony" => "Poney sirène", default => $species . "_" . $metadata["robot"] }; } else { @@ -143,6 +144,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "batpony" => $metadata["robot"] ? "Robot bat pony" : (!$metadata["plush"] ? "Bat pony" : "Bat pony plush"), "unicorn" => $metadata["robot"] ? "Robot unicorn" : (!$metadata["plush"] ? "Unicorn" : "Unicorn plush"), "changeling" => "Changeling", + "merpony" => "Merpony", default => $species . "_" . $metadata["robot"] }; } @@ -242,6 +244,25 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { ]; } + $friends = []; + foreach ($metadata["friends"] ?? [] as $marefriend) { + $mfSystem = explode("/", $marefriend)[0]; + $mfMemberID = explode("/", $marefriend)[1]; + $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfMemberID) { + return $item["id"] === $mfMemberID; + }); + sort($mfMember); + $mfMember = $mfMember[0]; + + if (!($mfSystem === $app["other"]["id"] && !$isLoggedIn && !$isLowerLoggedIn)) $friends[] = [ + "id" => $marefriend, + "link" => "/" . ($mfMember["name"]), + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), + "name" => $mfMember["display_name"] ?? $mfMember["name"], + "full_name" => $mfMember["display_name"] ?? $mfMember["name"] + ]; + } + $caretakers = null; if ($metadata["little"] >= 2) { @@ -479,7 +500,8 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { 'marefriends' => $marefriends ?? [], 'sexfriends' => $sexfriends ?? null, 'sisters' => $sisters ?? [], - 'caretakers' => $caretakers ?? [] + 'caretakers' => $caretakers ?? [], + 'friends' => $friends ?? [] ] ]; }
\ No newline at end of file |