diff options
Diffstat (limited to 'includes/util/banner.inc')
-rw-r--r-- | includes/util/banner.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/util/banner.inc b/includes/util/banner.inc index 46d9ce5..1657233 100644 --- a/includes/util/banner.inc +++ b/includes/util/banner.inc @@ -3,6 +3,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $lang; global $pages; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/pronouns.inc"; 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); @@ -21,11 +22,13 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { global $travelling; global $isLoggedIn; global $lang; + global $Parsedown; $french = $lang["_french"]; $member = getSystemMember($system, $id); $metadata = file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$id.json") ? parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$id.json"), true)) : parseMetadata([ + // FIXME: This doesn't work now that bitset functionality is removed "bitset" => 4196352, "regression" => null, "median" => null, @@ -463,9 +466,10 @@ 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["gender"]) && trim($metadata["gender"]) !== "" ? $Parsedown->text($metadata["gender"]) : "Agender", 'badges' => $badges, 'prefixes' => $prefixes, - 'pronouns' => getTooltipsFromMark($member["pronouns"], $french) ?? "<span data-bs-toggle='tooltip' title='Pronouns not specified' class='text-muted'>they/them</span>", + 'pronouns' => isset($member["pronouns"]) && trim($member["pronouns"]) !== "" ? $member["pronouns"] : "<i>they/them</i>", 'pronouns_usage' => getMemberPronouns($member['pronouns']), 'last_fronted' => $lastFronted, 'species' => $speciesList, |