From bf2558253637537c2d57765e557bdc0e164c58ee Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 22 Feb 2023 10:29:48 +0100 Subject: Updated 23 files, added assets/uploads/pt-princesscelestia.png and renamed assets/uploads/pt-luna.png (automated) --- Authentication/Callback/index.php | 13 ++++- api/fronter.php | 7 ++- app/planner/index.php | 2 +- assets/uploads/pt-luna.png | Bin 5609 -> 0 bytes assets/uploads/pt-princesscelestia.png | Bin 0 -> 5637 bytes assets/uploads/pt-princessluna.png | Bin 0 -> 5609 bytes includes/agewarning.inc | 42 ++++++++----- includes/banner.inc | 2 +- includes/details.inc | 16 ++--- includes/flags.json | 3 +- includes/functions.inc | 2 +- includes/init.inc | 8 ++- includes/navigation.inc | 104 +++++++++++++++++---------------- includes/pages.json | 40 +++++++++++++ includes/pane.inc | 16 ++--- includes/planner.inc | 42 ++++++------- includes/score.inc | 1 + includes/session.inc | 46 +++++---------- includes/short.inc | 1 + includes/sysbanner.inc | 16 ++--- includes/system/history.inc | 9 ++- includes/system/history.old.inc | 40 ++++++------- pages/byfront.inc | 31 ++++++++-- pages/logout.inc | 8 +-- pages/profiles.inc | 4 +- pages/travelling.inc | 8 +-- 26 files changed, 273 insertions(+), 188 deletions(-) delete mode 100644 assets/uploads/pt-luna.png create mode 100644 assets/uploads/pt-princesscelestia.png create mode 100644 assets/uploads/pt-princessluna.png diff --git a/Authentication/Callback/index.php b/Authentication/Callback/index.php index 508326b..981525f 100644 --- a/Authentication/Callback/index.php +++ b/Authentication/Callback/index.php @@ -38,15 +38,22 @@ if (isset($result["access_token"])) { $result = curl_exec($crl); $result = json_decode($result, true); - if (!in_array($result["id"], $appdata["oauth"]["allowed"])) { - header("Location: /"); + if (!in_array($result["id"], $appdata["oauth"]["allowed"]["admin"]) && !in_array($result["id"], $appdata["oauth"]["allowed"]["lower"])) { + header("Location: /?error=Access denied, you are not allowed to login to this website"); die(); } if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens"); + if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens"); $token = bin2hex(random_bytes(32)); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode($result)); + + if (in_array($result["id"], $appdata["oauth"]["allowed"]["admin"])) { + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode($result)); + } else { + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token, json_encode($result)); + } + header("Set-Cookie: PEH2_SESSION_TOKEN=" . $token . "; SameSite=None; Path=/; Secure; HttpOnly; Expires=" . date("r", time() + (86400 * 730))); header("Location: /Authentication/Success"); diff --git a/api/fronter.php b/api/fronter.php index 0dd6e99..c41562f 100644 --- a/api/fronter.php +++ b/api/fronter.php @@ -1,7 +1,10 @@ 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn")) { + if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn" && $parts[1] !== "Fizz")) { if (str_contains($parts[0], "/")) { return explode("/", $parts[0])[0]; } else { diff --git a/assets/uploads/pt-luna.png b/assets/uploads/pt-luna.png deleted file mode 100644 index 804690a..0000000 Binary files a/assets/uploads/pt-luna.png and /dev/null differ diff --git a/assets/uploads/pt-princesscelestia.png b/assets/uploads/pt-princesscelestia.png new file mode 100644 index 0000000..baa8055 Binary files /dev/null and b/assets/uploads/pt-princesscelestia.png differ diff --git a/assets/uploads/pt-princessluna.png b/assets/uploads/pt-princessluna.png new file mode 100644 index 0000000..804690a Binary files /dev/null and b/assets/uploads/pt-princessluna.png differ diff --git a/includes/agewarning.inc b/includes/agewarning.inc index a7ab501..1f51647 100644 --- a/includes/agewarning.inc +++ b/includes/agewarning.inc @@ -3,17 +3,33 @@ function showWarning($name, $id, $system) { $ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"]; - file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy['topic'], false, stream_context_create([ - 'http' => [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: ⚠️ $name does not have an age or birth year set\r\n" . - "Priority: max\r\n" . - "Tags: switch\r\n" . - "Actions: view, Edit on Cold Haze, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => "To make sure they still appear on the fronting schedule after March 1st, they need to set an age or birth year now." - ] - ])); + if (time() > 1677628800) { + file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy['topic'], false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: ⚠️ $name does not have an age or birth year set\r\n" . + "Priority: max\r\n" . + "Tags: switch\r\n" . + "Actions: view, Edit on Cold Haze, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "To make sure they appear on the fronting schedule (and to make sure they can front again), they need to set an age or birth year now." + ] + ])); + } else { + file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy['topic'], false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: ⚠️ $name does not have an age or birth year set\r\n" . + "Priority: max\r\n" . + "Tags: switch\r\n" . + "Actions: view, Edit on Cold Haze, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "To make sure they still appear on the fronting schedule after March 1st, they need to set an age or birth year now." + ] + ])); + } } \ No newline at end of file diff --git a/includes/banner.inc b/includes/banner.inc index 341b4e7..c96bedd 100644 --- a/includes/banner.inc +++ b/includes/banner.inc @@ -391,7 +391,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { ]; } - if (($metadata["leader"] ?? false) && $isLoggedIn) { + if (($metadata["leader"] ?? false)) { $badges[] = [ "id" => "leader", "color" => "d6a833", diff --git a/includes/details.inc b/includes/details.inc index aced1ac..323352d 100644 --- a/includes/details.inc +++ b/includes/details.inc @@ -1,5 +1,5 @@ - -
; margin-left: -20px; margin-right: -20px;"> + +
; margin-left: -20px; margin-right: -20px;">

"" . $lang["details"]["memory_states"][2] . "", } ?>
- +
Age:
- + 0): ?> INF ?> Eternal" ?> @@ -70,9 +70,10 @@
- -
; margin-left: -20px; margin-right: -20px;"> + +
; margin-left: -20px; margin-right: -20px;grid-template-columns: repeat(3, 1fr);"> = 16 && $metadata["little"] === 0) || (!isset($age) && $metadata["little"] === 0)) || $metadata["sexual_features"]): ?> +
Sexual consent:
@@ -86,6 +87,7 @@
+
Sexual alignmentSex. algn.:
This member is too young to be in a sexual relationship.
diff --git a/includes/flags.json b/includes/flags.json index 1802615..c4ccfce 100644 --- a/includes/flags.json +++ b/includes/flags.json @@ -19,5 +19,6 @@ "non_verbal": "Non verbal in real life", "less_frequent": "Fronts less frequently", "persecutor": "Persecutor", - "pacifier": "Sleeps with pacifier" + "pacifier": "Sleeps with pacifier", + "not_fronting": "Not fronting regularly" } \ No newline at end of file diff --git a/includes/functions.inc b/includes/functions.inc index bdc961b..924bfae 100644 --- a/includes/functions.inc +++ b/includes/functions.inc @@ -178,7 +178,7 @@ if (!function_exists("getMiniName")) { function getMiniName(string $name) { $parts = explode(" ", $name); - if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn")) { + if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn" && $parts[1] !== "Fizz")) { if ($parts[0] === "Princess") { array_shift($parts); } diff --git a/includes/init.inc b/includes/init.inc index 53a6328..391a1bc 100644 --- a/includes/init.inc +++ b/includes/init.inc @@ -7,7 +7,7 @@ global $pages; global $lang; global $pages; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; if (in_array($toplevel, array_keys($pages))) { $title = $pages[$toplevel]["name"][$lang["_name"]]; @@ -22,7 +22,11 @@ if (in_array($toplevel, array_keys($pages))) { $readOnly = true; } - if (!$isLoggedIn || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die(); + if ($pages[$toplevel]["limited"]) { + if ((!$isLoggedIn && !$isLowerLoggedIn) || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die(); + } else { + if (!$isLoggedIn || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die(); + } } } else { $title = $toplevel; diff --git a/includes/navigation.inc b/includes/navigation.inc index 7f744b9..82b6046 100644 --- a/includes/navigation.inc +++ b/includes/navigation.inc @@ -18,7 +18,7 @@ global $lang; global $pages; $navigation_admin = [ "admin" => true, - "name" => $lang["navigation"]["admin"], + "name" => "Private utilities", "icon" => "/assets/icons/admin.svg", "invert" => true, "items" => [ @@ -31,14 +31,16 @@ $navigation_admin = [ "icon" => "/assets/icons/emergency.svg", "invert" => false, "link" => "/-/emergency", - "stepped" => "rgb(220,53,69)" + "stepped" => "rgb(220,53,69)", + "private" => false ], [ "name" => $pages["wakeup"]["name"][$lang["_name"]], "icon" => "/assets/icons/wakeup.svg", "invert" => false, "link" => "/-/wakeup", - "stepped" => "rgb(13,202,240)" + "stepped" => "rgb(13,202,240)", + "private" => false ] ] ], @@ -51,63 +53,72 @@ $navigation_admin = [ "icon" => "/assets/icons/about.svg", "invert" => true, "link" => "/-/about", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["fronting"]["name"][$lang["_name"]], "icon" => "/assets/icons/fronting.svg", "invert" => true, "link" => "/-/fronting", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["profiles"]["name"][$lang["_name"]], "icon" => "/assets/icons/profiles.svg", "invert" => true, "link" => "/-/profiles", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["money"]["name"][$lang["_name"]], "icon" => "/assets/icons/money.svg", "invert" => true, "link" => "/-/money", - "stepped" => null + "stepped" => null, + "private" => true ], [ "name" => $pages["rules"]["name"][$lang["_name"]], "icon" => "/assets/icons/rules.svg", "invert" => true, "link" => "/-/rules", - "stepped" => null + "stepped" => null, + "private" => true ], [ "name" => $pages["docs"]["name"][$lang["_name"]], "icon" => "/assets/icons/docs.svg", "invert" => true, "link" => "/-/docs", - "stepped" => null + "stepped" => null, + "private" => true ], [ "name" => $pages["computers"]["name"][$lang["_name"]], "icon" => "/assets/icons/computers.svg", "invert" => true, "link" => "/-/computers", - "stepped" => null + "stepped" => null, + "private" => true ], [ "name" => $pages["travelling"]["name"][$lang["_name"]], "icon" => "/assets/icons/travelling.svg", "invert" => true, "link" => "/-/travelling", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["stats"]["name"][$lang["_name"]], "icon" => "/assets/icons/stats.svg", "invert" => true, "link" => "/-/stats", - "stepped" => null + "stepped" => null, + "private" => true ] ] ], @@ -120,28 +131,32 @@ $navigation_admin = [ "icon" => "/assets/icons/splitting.svg", "invert" => true, "link" => "/-/splitting", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["byfront"]["name"][$lang["_name"]], "icon" => "/assets/icons/byfront.svg", "invert" => true, "link" => "/-/byfront", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["alphabet"]["name"][$lang["_name"]], "icon" => "/assets/icons/alphabet.svg", "invert" => true, "link" => "/-/alphabet", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["s:species"]["name"][$lang["_name"]], "icon" => "/assets/icons/species.svg", "invert" => true, "link" => "/-/byspecies", - "stepped" => null + "stepped" => null, + "private" => false ], ] ], @@ -196,35 +211,32 @@ $navigation_global = [ "icon" => "/assets/icons/home.svg", "invert" => true, "link" => "/", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["disclaimers"]["name"][$lang["_name"]], "icon" => "/assets/icons/disclaimers.svg", "invert" => true, "link" => "/-/disclaimers", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["relations"]["name"][$lang["_name"]], "icon" => "/assets/icons/relations.svg", "invert" => true, "link" => "/-/relations", - "stepped" => null + "stepped" => null, + "private" => false ], - ($_SERVER['HTTP_HOST'] !== "fr.equestria.horse" ? [ - "name" => $pages["government"]["name"][$lang["_name"]], - "icon" => "/assets/icons/government.svg", - "invert" => true, - "link" => "/-/government", - "stepped" => null - ] : null), [ "name" => $pages["terminology"]["name"][$lang["_name"]], "icon" => "/assets/icons/terminology.svg", "invert" => true, "link" => "/-/terminology", - "stepped" => null + "stepped" => null, + "private" => false ] ] ] @@ -245,28 +257,24 @@ $navigation_cloudburst = [ "icon" => "/assets/icons/about.svg", "invert" => true, "link" => "/cloudburst", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["s:history"]["name"][$lang["_name"]], "icon" => "/assets/icons/history.svg", "invert" => true, "link" => "/cloudburst/-/history", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["s:compare"]["name"][$lang["_name"]], "icon" => "/assets/icons/compare.svg", "invert" => true, "link" => "/cloudburst/-/compare", - "stepped" => null - ], - [ - "name" => $pages["s:species"]["name"][$lang["_name"]], - "icon" => "/assets/icons/species.svg", - "invert" => true, - "link" => "/cloudburst/-/species", - "stepped" => null + "stepped" => null, + "private" => false ] ] ], @@ -294,7 +302,8 @@ $navigation_cloudburst = [ "icon" => getAsset($member["system"], $member["id"], "heads"), "invert" => false, "link" => "/$member[name]", - "stepped" => null + "stepped" => null, + "private" => false ]; }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true), "ynmuc"), "ynmuc"), function ($member) { return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; @@ -317,28 +326,24 @@ $navigation_raindrops = [ "icon" => "/assets/icons/about.svg", "invert" => true, "link" => "/raindrops", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["s:history"]["name"][$lang["_name"]], "icon" => "/assets/icons/history.svg", "invert" => true, "link" => "/raindrops/-/history", - "stepped" => null + "stepped" => null, + "private" => false ], [ "name" => $pages["s:compare"]["name"][$lang["_name"]], "icon" => "/assets/icons/compare.svg", "invert" => true, "link" => "/raindrops/-/compare", - "stepped" => null - ], - [ - "name" => $pages["s:species"]["name"][$lang["_name"]], - "icon" => "/assets/icons/species.svg", - "invert" => true, - "link" => "/raindrops/-/species", - "stepped" => null + "stepped" => null, + "private" => false ] ] ], @@ -366,7 +371,8 @@ $navigation_raindrops = [ "icon" => getAsset($member["system"], $member["id"], "heads"), "invert" => false, "link" => "/$member[name]", - "stepped" => null + "stepped" => null, + "private" => false ]; }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd"), "gdapd"), function ($member) { return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; diff --git a/includes/pages.json b/includes/pages.json index 985a224..eca0fe4 100644 --- a/includes/pages.json +++ b/includes/pages.json @@ -6,6 +6,7 @@ }, "short": "About", "admin": true, + "limited": true, "rail": true }, "actions": { @@ -15,6 +16,7 @@ }, "short": "Actions", "admin": true, + "limited": false, "rail": true }, "alphabet": { @@ -24,6 +26,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "api": { @@ -33,6 +36,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "app": { @@ -42,6 +46,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "byfront": { @@ -51,6 +56,7 @@ }, "short": "Last fronts", "admin": true, + "limited": true, "rail": true }, "computers": { @@ -60,6 +66,7 @@ }, "short": "PCs", "admin": true, + "limited": false, "rail": true }, "dashboard": { @@ -69,6 +76,7 @@ }, "short": null, "admin": true, + "limited": false, "rail": true }, "debug": { @@ -78,6 +86,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": true }, "docs": { @@ -87,6 +96,7 @@ }, "short": "Docs", "admin": true, + "limited": false, "rail": true }, "disclaimers": { @@ -96,6 +106,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "edit": { @@ -105,6 +116,7 @@ }, "short": null, "admin": true, + "limited": false, "rail": false }, "edit-private": { @@ -114,6 +126,7 @@ }, "short": null, "admin": true, + "limited": false, "rail": false }, "emergency": { @@ -123,6 +136,7 @@ }, "short": null, "admin": true, + "limited": false, "rail": true }, "fronting": { @@ -132,6 +146,7 @@ }, "short": null, "admin": true, + "limited": true, "rail": true }, "government": { @@ -141,6 +156,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "home": { @@ -150,6 +166,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "login": { @@ -159,6 +176,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "logout": { @@ -168,6 +186,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "metadata": { @@ -177,6 +196,7 @@ }, "short": "Metadata", "admin": true, + "limited": false, "rail": false }, "money": { @@ -186,6 +206,7 @@ }, "short": "Money", "admin": true, + "limited": false, "rail": false }, "nicknames": { @@ -195,6 +216,7 @@ }, "short": "Nicknames", "admin": true, + "limited": false, "rail": true }, "page": { @@ -204,6 +226,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "pleasure": { @@ -213,6 +236,7 @@ }, "short": null, "admin": true, + "limited": false, "rail": true }, "profiles": { @@ -222,6 +246,7 @@ }, "short": null, "admin": true, + "limited": true, "rail": true }, "relations": { @@ -231,6 +256,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "rules": { @@ -240,6 +266,7 @@ }, "short": "Rules", "admin": true, + "limited": false, "rail": true }, "s:compare": { @@ -249,6 +276,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "s:history": { @@ -258,6 +286,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "s:species": { @@ -267,6 +296,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "s:tree": { @@ -276,6 +306,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": false }, "score": { @@ -285,6 +316,7 @@ }, "short": null, "admin": true, + "limited": true, "rail": true }, "splitting": { @@ -294,6 +326,7 @@ }, "short": "Splits", "admin": true, + "limited": true, "rail": true }, "stats": { @@ -303,6 +336,7 @@ }, "short": "Stats", "admin": true, + "limited": false, "rail": true }, "terminology": { @@ -312,6 +346,7 @@ }, "short": null, "admin": false, + "limited": false, "rail": true }, "together": { @@ -321,6 +356,7 @@ }, "short": "Together", "admin": true, + "limited": true, "rail": false }, "together-dev": { @@ -330,6 +366,7 @@ }, "short": null, "admin": true, + "limited": true, "rail": false }, "toys": { @@ -339,6 +376,7 @@ }, "short": "Toys", "admin": true, + "limited": false, "rail": true }, "travelling": { @@ -348,6 +386,7 @@ }, "short": "Travels", "admin": true, + "limited": true, "rail": true }, "wakeup": { @@ -357,6 +396,7 @@ }, "short": null, "admin": true, + "limited": false, "rail": true } } \ No newline at end of file diff --git a/includes/pane.inc b/includes/pane.inc index e95747e..0a546a5 100644 --- a/includes/pane.inc +++ b/includes/pane.inc @@ -1,4 +1,4 @@ - + @@ -166,8 +166,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + and "> + " style="width:24px;">
@@ -209,8 +209,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + and "> + " style="width:24px;">
@@ -252,8 +252,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + and "> + " style="width:24px;">
@@ -295,8 +295,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + and "> + " style="width:24px;">
@@ -338,8 +338,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + and "> + " style="width:24px;"> @@ -381,8 +381,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + and "> + " style="width:24px;"> @@ -424,8 +424,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + and "> + " style="width:24px;"> @@ -467,8 +467,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + and "> + " style="width:24px;"> @@ -504,8 +504,8 @@ function getMember(string $id) { " style="width:24px;"> - (with "> - " style="width:24px;"> ) + "> + " style="width:24px;"> diff --git a/pages/byfront.inc b/pages/byfront.inc index 88da2f5..93fe3d5 100644 --- a/pages/byfront.inc +++ b/pages/byfront.inc @@ -90,12 +90,35 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ }))) ]; uasort($members, function ($a, $b) { return $b["_lastFronted"] - $a["_lastFronted"]; - }); $members = array_reverse($members); foreach ($members as $member): if ($member["_lastFronted"] !== -1 && $member["_lastFronted"] !== time()): ?> -
time() - (86400 * 21)): ?>rgba(255, 255, 255, .1) time() - (86400 * 37)): ?>rgba(255, 227, 0, 0.17)rgba(255,55,55,0.17); time() - (86400 * 21)): ?>rgba(255, 255, 255, .1) time() - (86400 * 30)): ?>rgba(255, 227, 0, 0.17)rgba(255,55,55,0.17);;margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;opacity: 0.75;"> + }); $members = array_reverse($members); foreach ($members as $member): if ($member["_lastFronted"] !== -1 && $member["_lastFronted"] !== time()): + + $metadata = $member["_metadata"]; + + if (!isset($metadata["birth"]["year"]) || $metadata["birth"]["age"] > 0) { + if ($metadata["birth"]["age"] === -1) { + $age = abs(log(0)); + } elseif ($metadata["birth"]["age"] <= 0) { + $age = null; + } else { + $age = $metadata["birth"]["age"]; + } + } else { + if ($metadata["birth"]["year"] <= 1900) { + $age = null; + } else { + $age = (int)date('Y') - $metadata["birth"]["year"] + (strtotime(date('Y') . "-" . $metadata["birth"]["date"]) <= time() ? 0 : -1); + } + } + + if (isset($age) && $age > 0 && time() > 1677628800): ?> +
time() - (86400 * 21)): ?>rgba(255, 255, 255, .1) time() - (86400 * 37)): ?>rgba(255, 227, 0, 0.17)rgba(128,54,54,0.17); time() - (86400 * 21)): ?>rgba(255, 255, 255, .1) time() - (86400 * 30)): ?>rgba(255, 227, 0, 0.17)rgba(255,55,55,0.17);;margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;opacity: 0.75;background-color:rgba(255, 255, 255, .1) !important;"> "> " style="width:24px;">  - + + No + + Less @@ -121,7 +144,7 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
- +