diff options
Diffstat (limited to 'includes/util/banner.inc')
-rw-r--r-- | includes/util/banner.inc | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/includes/util/banner.inc b/includes/util/banner.inc index ea8a1eb..72656ca 100644 --- a/includes/util/banner.inc +++ b/includes/util/banner.inc @@ -1,31 +1,9 @@ <?php -function getAge($metadata) { - if (!isset($metadata["birth"]["year"]) || $metadata["birth"]["age"] > 0 || $metadata["birth"]["age"] === -1) { - if ($metadata["birth"]["age"] === -1) { - return "Eternal"; - } elseif ($metadata["birth"]["age"] <= 0) { - return "-"; - } elseif (is_numeric($metadata["birth"]["age"])) { - return $metadata["birth"]["age"] . "* years old"; - } - } else { - if ($metadata["birth"]["year"] <= 1900) { - return "-"; - } else { - $age = (int)date('Y') - $metadata["birth"]["year"] + (strtotime(date('Y') . "-" . $metadata["birth"]["date"]) <= time() ? 0 : -1); - return $age . " years old"; - } - } - - return "-"; -} - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $lang; global $pages; global $isLowerLoggedIn; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/Parsedown.php"; $Parsedown = new Parsedown(); -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); +$travelling = []; function _header_getMember(string $id, $system) { $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/members.json"), true); @@ -43,7 +21,6 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { global $isLoggedIn; global $isLowerLoggedIn; global $lang; - global $Parsedown; global $use2023UI; $french = $lang["_french"]; @@ -404,7 +381,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { 'median' => $metadata["median"], 'little' => $metadata["little"] >= 2, 'name' => $member["display_name"] ?? $member["name"], - 'gender' => isset($metadata["show_gender"]) && $metadata["show_gender"] ? (isset($metadata["gender"]) && trim($metadata["gender"]) !== "" ? $Parsedown->text($metadata["gender"]) : "Agender") : null, + 'gender' => "Agender", 'badges' => $badges, 'prefixes' => $prefixes, 'pronouns' => isset($member["pronouns"]) && trim($member["pronouns"]) !== "" ? $member["pronouns"] : "<i>they/them</i>", @@ -412,7 +389,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { 'last_fronted' => $lastFronted, 'species' => $speciesList, 'system' => $systemData, - 'age' => getAge($metadata), + 'age' => -1, 'relations' => [ 'marefriends' => $marefriends ?? [], 'sexfriends' => $sexfriends ?? null, |