diff options
Diffstat (limited to 'includes/banner.inc')
-rw-r--r-- | includes/banner.inc | 83 |
1 files changed, 62 insertions, 21 deletions
diff --git a/includes/banner.inc b/includes/banner.inc index e1b06be..d62ba97 100644 --- a/includes/banner.inc +++ b/includes/banner.inc @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $lang; global $pages; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/pronouns.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; @@ -47,6 +47,9 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { global $subsystems; global $travelling; global $isLoggedIn; + global $lang; + + $french = $lang["_french"]; $subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$system.json"), true) ?? []; @@ -188,7 +191,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { ]; } - if ($travelling[$member['id']]["travelling"]) { + if ($travelling[$member['id']]["travelling"] && !$travelling[$member['id']]["equestria"]) { $systemData['page'] = "/" . ($system === "gdapd" ? "cloudburst" : "raindrops"); $systemData['icon'] = ($system === "gdapd" ? "cloudburst" : "raindrops") . ".png"; $systemData['name'] = $system === "gdapd" ? "Cloudburst" : "Raindrops"; @@ -197,6 +200,16 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $systemData['temporary'] = true; } + + if ($travelling[$member['id']]["travelling"] && $travelling[$member['id']]["equestria"]) { + $systemData['page'] = null; + $systemData['icon'] = "../logo/equestria.png"; + $systemData['name'] = "Equestria"; + $systemData['full_name'] = "Equestria"; + $systemData['subsystem'] = null; + $systemData['temporary'] = true; + } + $marefriends = []; foreach ($metadata["marefriends"] as $marefriend) { $mfSystem = explode("/", $marefriend)[0]; @@ -268,7 +281,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "html" => ( $french ? - '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronteuse la plus présente</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' the one who fronts the most often in ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' system." class="badge rounded-pill bg-primary">Fronteuse la plus présente</span>' + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronteuse la plus présente</b><br>Elle est le membre qui fronte le plus dans son système." class="badge rounded-pill bg-primary">Fronteuse la plus présente</span>' : '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Most common fronter</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' the one who fronts the most often in ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' system." class="badge rounded-pill bg-primary">Most common fronter</span>' ) @@ -276,13 +289,13 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { } } - if (($metadata["age_spells"] ?? false) && !$french) { + /*if (($metadata["age_spells"] ?? false) && !$french) { $badges[] = [ "id" => "age_spells", "color" => "#6f42c1", "html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Affected by age spells</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' can feel younger than ' . getMemberPronouns($member['pronouns'])["subjective"] . ' actually ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' when somepony else casts an age spell on ' . getMemberPronouns($member['pronouns'])["object"] . '." class="badge rounded-pill" style="background-color: #6f42c1;">Affected by age spells</span>' ]; - } + }*/ if ($metadata["fictive"] ?? false) { $badges[] = [ @@ -291,18 +304,38 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "html" => ( $french ? - '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fictive</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' based on the personality, look and behavior of a character that is fictional in this world." class="badge rounded-pill bg-info">Fictive</span>' + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fictive</b><br>Elle est basée sur la personnalité, apparence et comportement d\'un personnage qui est fictif dans ce monde." class="badge rounded-pill bg-info">Fictive</span>' : '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fictive</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' based on the personality, look and behavior of a character that is fictional in this world." class="badge rounded-pill bg-info">Fictive</span>' ) ]; } + if ($metadata["persecutor"] ?? false) { + $badges[] = [ + "id" => "persecutor", + "color" => "danger", + "html" => ( + $french + ? + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Persécutrice</b><br>Elle se comporte de façon nuisible à l\'égart des autres ou des autres membres du système, potentiellement comme une tentative malavisée de protéger le système." class="badge rounded-pill bg-danger">Persécutrice</span>' + : + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Persecutor</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "acts" : "act") . ' harmfully towards other system members and/or others, potentially as a misguided attempt to protect the system." class="badge rounded-pill bg-danger">Persecutor</span>' + ) + ]; + } + if ($metadata["less_frequent"] ?? false) { $badges[] = [ "id" => "nonverbal", "color" => "#fd7e14", - "html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronts less often</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "front" : "fronts") . ' less often than ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' headmates, this can due to various reasons." class="badge rounded-pill" style="background-color:#fd7e14;">Fronts less often</span>' + "html" => ( + $french + ? + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronts less often</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "front" : "fronts") . ' less often than ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' headmates, this can due to various reasons." class="badge rounded-pill" style="background-color:#fd7e14;">Fronte moins souvent</span>' + : + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fronts less often</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "front" : "fronts") . ' less often than ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' headmates, this can due to various reasons." class="badge rounded-pill" style="background-color:#fd7e14;">Fronts less often</span>' + ) ]; } @@ -310,7 +343,13 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "nonverbal", "color" => "#20c997", - "html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Non verbal IRL</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' non verbal in real life, although text communication is still possible." class="badge rounded-pill" style="background-color:#20c997;">Non verbal IRL</span>' + "html" => ( + $french + ? + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Non verbale dans la réalité</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' non verbal in real life, although text communication is still possible." class="badge rounded-pill" style="background-color:#20c997;">Non verbal IRL</span>' + : + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Non verbal IRL</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' non verbal in real life, although text communication is still possible." class="badge rounded-pill" style="background-color:#20c997;">Non verbal IRL</span>' + ) ]; } @@ -330,6 +369,20 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { ]; } + if (($metadata["leader"] ?? false) && $isLoggedIn) { + $badges[] = [ + "id" => "leader", + "color" => "d6a833", + "html" => ( + $french + ? + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Leader</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a leader in ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' system." class="badge rounded-pill" style="background-color:#fd7e14;">Dirigeante</span>' + : + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Leader</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a leader in ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' system." class="badge rounded-pill" style="background-color:#fd7e14;">Leader</span>' + ) + ]; + } + if ($metadata["protector"] ?? false) { $badges[] = [ "id" => "protector", @@ -337,7 +390,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "html" => ( $french ? - '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protecteur·ice")) . '</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protecteur·ice")) . '</span>' + '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protectrice")) . '</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protectrice")) . '</span>' : '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Protector</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">Protector</span>' ) @@ -386,18 +439,6 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Age regressor</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' capable of regressing ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' mental age, which causes ' . getMemberPronouns($member['pronouns'])["object"] . ' to become ' . (getMiniName($regression["display_name"] ?? $regression["name"])) . ', temporarily behaving and feeling younger than the body is." class="badge rounded-pill bg-secondary">Age regresses into <a href="/' . $regression["name"] . '">'. (getMiniName($regression["display_name"] ?? $regression["name"])) . '</a></span>' ) ]; - } else { - $badges[] = [ - "id" => "regressor", - "color" => "secondary", - "html" => ( - $french - ? - '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Régresseur d\'âge</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' capable of regressing ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' mental age, temporarily behaving and feeling younger than the body is." class="badge rounded-pill bg-secondary">Régresseur d\'âge</span>' - : - '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Age regressor</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' capable of regressing ' . getMemberPronouns($member['pronouns'])["possessive_det"] . ' mental age, temporarily behaving and feeling younger than the body is." class="badge rounded-pill bg-secondary">Age regressor</span>' - ) - ]; } } |