diff options
author | Minteck <contact@minteck.org> | 2022-08-26 22:29:23 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-08-26 22:29:23 +0200 |
commit | 09bd0164ebc020a54b944b7326dcba496fb5d82c (patch) | |
tree | 0c5e765e627ecc94e534ccb6e2bc83917d58dc4c /includes/header.php | |
parent | a2df9a69dcc14cb70118cda2ded499055e7ee358 (diff) | |
download | pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.tar.gz pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.tar.bz2 pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.zip |
idk when was the last commit so I'm making a new one - Violet Dawn
Diffstat (limited to 'includes/header.php')
-rw-r--r-- | includes/header.php | 329 |
1 files changed, 173 insertions, 156 deletions
diff --git a/includes/header.php b/includes/header.php index 59c64b7..8ce8389 100644 --- a/includes/header.php +++ b/includes/header.php @@ -1,138 +1,34 @@ <?php global $title; -function error($errno, $errstr, $file, $line) { ?> +function error($errno, $errstr, $file, $line) { + echo(' <!-- -->"> <div class="alert alert-danger" style="text-align: left;"> - <b>Error <?= $errno ?>:</b> <?= $errstr ?> [<?= $file ?>:<?= $line ?>] - </div> -<?php } + <b>Error ' . $errno . ':</b> ' . $errstr . ' [' . $file . ':' . $line . '] + </div>'); +} if (isset($_GET['errors'])) { - set_error_handler("error"); + ini_set('display_errors', '1'); + ini_set('display_startup_errors', '1'); + error_reporting(E_ALL); + set_error_handler("error", E_ALL); } +global $_MemberName; +global $_MemberPage; +global $_SystemName; +global $_SystemPage; +global $toplevel; + require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.php"; global $travelling; require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; global $isUserLoggedIn; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.php"; - -function getMiniName(string $name) { - $parts = explode(" ", $name); - - if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly") { - if (str_contains($parts[0], "/")) { - return explode("/", $parts[0])[0]; - } else { - return $parts[0]; - } - } else { - return $name; - } -} - -function getSystemMember(string $system, string $id) { - $systemID = $system; - - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); - $member = null; - - foreach ($members as $m) { - if ($m["id"] === $id) $member = $m; - } - - return $member; -} - -function getBrightness(string $hexCode) { - if (str_starts_with("#", $hexCode)) { - $hexCode = substr($hexCode, 1); - } - - $red = hexdec(substr($hexCode, 0, 2)); - $green = hexdec(substr($hexCode, 2, 2)); - $blue = hexdec(substr($hexCode, 4, 2)); - $brightness = $red + $green + $blue; - - return $brightness > 382; -} - -function showMembersFromList(array $list, string $id) { - foreach ($list as $member) { if ($member['name'] !== "unknown") { - echo('<!-- ' . ($member['display_name'] ?? $member['name']) . ' --> -<a href="/' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '/' . $member['name'] . '" style="text-decoration:none !important;filter:none !important;"><div class="hpd-item-card" style="background-color:rgba(255, 255, 255, .1);border:1px solid ' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';outline-color:' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;"><div> -<img alt="" src="' . $member['avatar_url'] . '" style="border-radius:999px;background-color:rgba(0, 0, 0, .25);height:48px;display:block;margin-left:auto;margin-right:auto;"> -<div style="text-decoration:none;color:white;margin-top:5px;">' . ($member['display_name'] ?? $member['name']) . '</div> -<div style="text-decoration:none !important;color:black !important;"><code style="text-decoration:none !important;color:white !important;">' . ($member['travelling'] ? "+" . ($member['proxy_tags'][0]['prefix'] ?? " ") : ($member['proxy_tags'][0]['prefix'] ?? " ")) . '</code></div> -</div></div></a>'); - }} -} - -function showSubsystem(array $data, string $parentSystem) { - $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$parentSystem-subsystem-$data[source].json"), true); - - echo('<!-- ' . $subsystemData["name"] . ' --> -<div id="hpd-cloudburst" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px;display:grid;grid-template-columns: 1fr;margin-bottom:10px;">'); - echo(' <div style="display:grid;grid-template-columns:repeat(6, 1fr);grid-gap:10px;">'); - - showMembersFromList(scoreOrder(array_map(function ($i) use ($parentSystem) { - return getSystemMember($parentSystem, $i); - }, $data["members"]), $parentSystem), $parentSystem); - - echo('</div> - -</div>'); -} - -function showSystem(string $id, string $name, string $color, bool $hideTitle) { - global $travelling; - - if ($hideTitle) { - echo('<!-- ' . $name . ' --> -<div id="hpd-' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px;display:grid;grid-template-columns: 1fr;margin-bottom:10px;">'); - } else { - echo('<!-- ' . $name . ' --> -<div id="hpd-' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px 10px 10px 20px;display:grid;grid-template-columns: 128px 1fr;margin-bottom:10px;">'); - } - if (!$hideTitle) echo('<!-- System Name --> -<a style="display:flex;margin: -10px -20px;align-items:center;justify-content:center;text-align:center;padding: 10px 20px;border-radius: 10px;background: ' . $color . ';width: 148px;text-decoration:none;color:white;filter:none !important;" href="/' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '" class="hpd-system"> -<div style="text-align:center;"><img src="/assets/uploads/' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '.png" style="width:64px;"><br>' . $name . '</div> -</a>'); - - if ($hideTitle) { - echo(' <div style="display:grid;grid-template-columns:repeat(6, 1fr);grid-gap:10px;">'); - } else { - echo(' <div style="display:grid;grid-template-columns:repeat(6, 1fr);padding-left:10px;grid-gap:10px;">'); - } - - showMembersFromList(scoreOrder([...array_map(function ($i) use ($id) { - $i["travelling"] = false; - $i["system"] = $id; - return $i; - }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id-members.json"), true), function ($i) use ($travelling) { - return !$travelling[$i['id']]['travelling']; - })), ...array_map(function ($i) use ($id) { - $i["travelling"] = true; - $i["system"] = ($id === "gdapd" ? "ynmuc" : "gdapd"); - return $i; - }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($id === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true), function ($i) use ($travelling) { - return $travelling[$i['id']]['travelling']; - }))], $id), $id); - - echo('</div> - -</div>'); -} - -function cloudburst(bool $hideTitle): void { - showSystem("ynmuc", "Cloudburst System", "#5f08a9a6", $hideTitle); -} - -function raindrops(bool $hideTitle): void { - showSystem("gdapd", "Raindrops System", "#a95f08a6", $hideTitle); -} +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; ?> <!doctype html> @@ -142,8 +38,28 @@ function raindrops(bool $hideTitle): void { <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script> - <title><?= $title ? $title . " · " : "" ?>Cuties and Plurality</title> - <link rel="shortcut icon" href="/assets/logo/logo.png" type="image/png"> + <title><?= $title ? $title . " · " : "" ?>Cold Haze</title> + <?php if (isset($_MemberName) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $_MemberName . ".png")): ?> + <link rel="shortcut icon" href="/assets/uploads/pt-<?= $_MemberName ?>.png" type="image/png"> + <?php else: ?> + <?php if (isset($_MemberPage) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/icons/favicon/" . $_MemberPage . ".png")): ?> + <link rel="shortcut icon" href="/assets/icons/favicon/<?= $_MemberPage ?>.png" type="image/png"> + <?php else: ?> + <?php if (isset($toplevel) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/icons/favicon/" . $toplevel . ".png")): ?> + <link rel="shortcut icon" href="/assets/icons/favicon/<?= $toplevel ?>.png" type="image/png"> + <?php else: ?> + <?php if (isset($_SystemPage) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/icons/favicon/" . $_SystemPage . ".png")): ?> + <link rel="shortcut icon" href="/assets/icons/favicon/<?= $_SystemPage ?>.png" type="image/png"> + <?php else: ?> + <?php if (isset($_SystemName) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/" . $_SystemName . ".png") && (!isset($_MemberName) || $_MemberName !== "fusion")): ?> + <link rel="shortcut icon" href="/assets/uploads/<?= $_SystemName ?>.png" type="image/png"> + <?php else: ?> + <link rel="shortcut icon" href="/assets/logo/logo.png" type="image/png"> + <?php endif; ?> + <?php endif; ?> + <?php endif; ?> + <?php endif; ?> + <?php endif; ?> <style> nav.navbar { background-color: black !important; @@ -364,7 +280,7 @@ function raindrops(bool $hideTitle): void { .comparison { display: grid; - grid-template-columns: 3fr repeat(2, 2fr) repeat(5, 1fr); + grid-template-columns: 3fr 1.5fr 2fr repeat(4, 1fr); } .comparison-header { @@ -594,7 +510,7 @@ function raindrops(bool $hideTitle): void { display: none !important; } .comparison { - grid-template-columns: repeat(3, 2fr) repeat(5, 1fr) !important; + grid-template-columns: repeat(3, 2fr) repeat(4, 1fr) !important; } .comparison-relations-count { display: inline; @@ -663,17 +579,76 @@ function raindrops(bool $hideTitle): void { .rainbow-item:active { opacity: .5; } + + peh-muted { + --bs-text-opacity: 1; + color: #6c757d!important; + } + + .dropdown-toggle::after { + margin-bottom: -3px; + } + + .navbar-nav { + width: 100%; + } + + .card { + background-color: #111; + border: 1px solid rgba(255, 255, 255, .125); + } + + #member-banner-container > #member-banner > #system-info { + border-bottom-right-radius: 0 !important; + border-bottom-left-radius: 0 !important; + } + + #member-details { + background: rgba(255, 255, 255, .1); + border: 1px solid transparent; + border-top: none; + padding: 10px 20px; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; + display: grid; + grid-template-columns: repeat(4, 1fr); + text-align: center; + } + + .navbar-collapse.show { + z-index: 999; + } + + @media (max-width: 991px) { + div#member-details.member-details-loggedIn { + grid-template-columns: repeat(2, 1fr) !important; + text-align: center; + } + + #member-details { + grid-template-columns: 1fr !important; + text-align: left; + } + } + + @media (max-width: 767px) { + div#member-details.member-details-loggedIn { + grid-template-columns: 1fr !important; + text-align: left; + } + } </style> </head> <body> - <nav class="navbar navbar-expand-<?= $isLoggedIn ? 'lg' : 'md' ?> bg-dark navbar-dark" style="height:60px;"> + <nav class="navbar navbar-expand-<?= $isLoggedIn ? 'xl' : 'lg' ?> bg-dark navbar-dark" style="height:60px;"> <div class="container-fluid"> - <a class="navbar-brand" href="/"><img src="/assets/logo/logo.png" alt="" style="width:32px;vertical-align: middle;margin-right:5px;"> <span style="vertical-align: middle;">Cuties and Plurality</span><a> + <a class="navbar-brand" href="/"><img src="/assets/logo/logo.png" alt="" style="width:32px;vertical-align: middle;margin-right:5px;"> <span style="vertical-align: middle;">Cold Haze</span><a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#collapsibleNavbar"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="collapsibleNavbar"> <ul class="navbar-nav"> + <?php if (!isset($demoHeader) || !$demoHeader): ?> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"> <img src="/assets/icons/global.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> @@ -700,27 +675,12 @@ function raindrops(bool $hideTitle): void { <li><h5 class="dropdown-header">Tools</h5></li> <li><a class="dropdown-item" href="/-/parser"> <img src="/assets/icons/parser.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">Message Parser</span> + <span style="vertical-align: middle;">Message parser</span> </a></li> <li><a class="dropdown-item" href="/-/prefix"> <img src="/assets/icons/prefix.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">Prefix Generator</span> + <span style="vertical-align: middle;">Prefix generator</span> </a></li> - <?php if (!$isLoggedIn): ?> - <li><hr class="dropdown-divider"></li> - <li><h5 class="dropdown-header">Administrator</h5></li> - <li><a class="dropdown-item" href="/-/login"> - <img src="/assets/icons/login.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">Login</span> - </a></li> - <?php else: ?> - <li><hr class="dropdown-divider"></li> - <li><h5 class="dropdown-header">Administrator</h5></li> - <li><a class="dropdown-item disabled" href="#" style="opacity:.5;"> - <img src="/assets/icons/right.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">See menu</span> - </a></li> - <?php endif; ?> </ul> </li> <?php if ($isLoggedIn): ?> @@ -732,14 +692,29 @@ function raindrops(bool $hideTitle): void { <ul class="dropdown-menu"> <li><a class="dropdown-item" href="/-/emergency"> <img src="/assets/icons/emergency.svg" alt="" style="width:24px;vertical-align: middle;"> - <span class="text-danger" style="vertical-align: middle;">Emergency Alert</span> + <span class="text-danger" style="vertical-align: middle;"><b>Emergency alert</b></span> </a></li> + <?php + + $frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"]; + $frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"]; + + if (isset($_GET['pleasure']) || ( + ((int)date('H') >= 20 || (int)date('H') < 6) && + $frontCloudburst[0]["id"] === "erknz" && + $frontRaindrops[0]["id"] === "qbzxm" + )): ?> + <li><a class="dropdown-item" href="/-/pleasure" <?= isset($_GET['pleasure']) ? 'style="opacity: .5;"' : '' ?>> + <img src="/assets/icons/pleasure.svg" alt="" style="width:24px;vertical-align: middle;"> + <span class="text-success" style="vertical-align: middle;"><b>Pleasure alert</b></span> + </a></li> + <?php endif; ?> <li><hr class="dropdown-divider"></li> <li><h5 class="dropdown-header">Applications</h5></li> <li><a class="dropdown-item" href="/-/fronting"> <img src="/assets/icons/fronting.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">Front Planner</span> + <span style="vertical-align: middle;">Front planner</span> </a></li> <li><a class="dropdown-item" href="/-/together"> <img src="/assets/icons/together.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> @@ -747,18 +722,22 @@ function raindrops(bool $hideTitle): void { </a></li> <li><a class="dropdown-item" href="/-/travelling"> <img src="/assets/icons/travel.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">System Travelling</span> + <span style="vertical-align: middle;">System travels manager</span> </a></li> <li><hr class="dropdown-divider"></li> <li><h5 class="dropdown-header">Utilities</h5></li> + <li><a class="dropdown-item" href="/-/splitting"> + <img src="/assets/icons/form.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> + <span style="vertical-align: middle;">Members by splitting date</span> + </a></li> <li><a class="dropdown-item" href="/-/bitset"> <img src="/assets/icons/bitset.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">Bitset Calculator</span> + <span style="vertical-align: middle;">Bitset calculator</span> </a></li> <li><a class="dropdown-item" href="/-/score"> <img src="/assets/icons/score.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">Score System Testing</span> + <span style="vertical-align: middle;">Score system testing</span> </a></li> <li><hr class="dropdown-divider"></li> @@ -768,6 +747,13 @@ function raindrops(bool $hideTitle): void { </a></li> </ul> </li> + <?php endif; else: ?> + <li class="nav-item"> + <a class="nav-link" href="/" role="button"> + <img src="/assets/icons/right.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> + <span style="vertical-align: middle;">Reste du site (en anglais)</span> + </a> + </li> <?php endif; ?> <?php if (!isset($emergencyHeader) || !$emergencyHeader): ?> <li class="nav-item dropdown"> @@ -789,7 +775,7 @@ function raindrops(bool $hideTitle): void { if (count($subsystemsNotMember) > 0): ?> <li><hr class="dropdown-divider"></li> - <li><h5 class="dropdown-header">Subsystems (<?= count($subsystemsNotMember) ?>)</h5></li> + <li><h5 class="dropdown-header">Subsystems</h5></li> <?php foreach ($subsystemsNotMember as $subsystem): $ssData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-subsystem-" . $subsystem['source'] . ".json"), true); ?> <li><a class="dropdown-item" href="/cloudburst/-/subsystem/<?= $subsystem['source'] ?>"> <img src="/assets/uploads/ss-<?= $subsystem['source'] ?>.png" alt="" style="border-radius:5px;width:24px;vertical-align: middle;"> @@ -798,10 +784,10 @@ function raindrops(bool $hideTitle): void { <?php endforeach; ?> <?php endif; ?> <li><hr class="dropdown-divider"></li> - <li><h5 class="dropdown-header">Members (<?= count(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true), "ynmuc")) - 1 ?>)</h5></li> - <?php foreach (scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true), "ynmuc"), "ynmuc") as $member): if ($member['name'] !== "unknown"): ?> + <li><h5 class="dropdown-header">Members</h5></li> + <?php foreach (scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true), "ynmuc"), "ynmuc") as $member): if ($member['name'] !== "unknown" && $member['name'] !== "fusion"): ?> <li><a class="dropdown-item" href="/cloudburst/<?= $member['name'] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member['name'] . ".png") ? "-" . $member['name'] : "" ?>.png" alt="" style="width:24px;vertical-align: middle;"> + <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" alt="" style="width:24px;vertical-align: middle;"> <span style="vertical-align: middle;"><?= $member['display_name'] ?? $member['name'] ?></span> </a></li> <?php endif; endforeach; ?> @@ -818,15 +804,46 @@ function raindrops(bool $hideTitle): void { <span style="vertical-align: middle;">About us</span> </a></li> <li><hr class="dropdown-divider"></li> - <li><h5 class="dropdown-header">Members (<?= count(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd")) - 1 ?>)</h5></li> - <?php foreach (scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd"), "gdapd") as $member): if ($member['name'] !== "unknown"): ?> + <li><h5 class="dropdown-header">Members</h5></li> + <?php foreach (scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd"), "gdapd") as $member): if ($member['name'] !== "unknown" && $member['name'] !== "fusion"): ?> <li><a class="dropdown-item" href="/raindrops/<?= $member['name'] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member['name'] . ".png") ? "-" . $member['name'] : "" ?>.png" alt="" style="width:24px;vertical-align: middle;"> + <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" alt="" style="width:24px;vertical-align: middle;"> <span style="vertical-align: middle;"><?= $member['display_name'] ?? $member['name'] ?></span> </a></li> <?php endif; endforeach; ?> </ul> </li> + <?php if ($isLoggedIn): ?> + <li class="nav-item" style="margin-left: auto;"> + <a class="nav-link" href="/-/user"> + <?php global $_PROFILE; ?> + <span style="vertical-align: middle;"> + <?= $_PROFILE["name"] ?> + </span> + <img alt="" src="/assets/icons/shield.svg" style="filter:invert(1);width:24px;vertical-align: middle;"> + </a> + </li> + <?php elseif ($isUserLoggedIn): ?> + <li class="nav-item" style="margin-left: auto;"> + <a class="nav-link" href="/-/user"> + <?php global $_PROFILE; ?> + <span style="vertical-align: middle;"> + <?= $_PROFILE["name"] ?> + </span> + <img alt="" src="/assets/icons/shield.svg" style="filter:invert(1);width:24px;vertical-align: middle;"> + </a> + </li> + <?php else: ?> + <li class="nav-item" style="margin-left: auto;"> + <a class="nav-link" href="/-/login"> + <?php global $_PROFILE; ?> + <span style="vertical-align: middle;"> + Not logged in + </span> + <img alt="" src="/assets/icons/login.svg" style="filter:invert(1);width:24px;vertical-align: middle;"> + </a> + </li> + <?php endif; ?> <?php endif; ?> </ul> </div> |