summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Authentication/Callback/index.php13
-rw-r--r--api/fronter.php7
-rw-r--r--app/planner/index.php2
-rw-r--r--assets/uploads/pt-princesscelestia.pngbin0 -> 5637 bytes
-rw-r--r--assets/uploads/pt-princessluna.png (renamed from assets/uploads/pt-luna.png)bin5609 -> 5609 bytes
-rw-r--r--includes/agewarning.inc42
-rw-r--r--includes/banner.inc2
-rw-r--r--includes/details.inc16
-rw-r--r--includes/flags.json3
-rw-r--r--includes/functions.inc2
-rw-r--r--includes/init.inc8
-rw-r--r--includes/navigation.inc104
-rw-r--r--includes/pages.json40
-rw-r--r--includes/pane.inc16
-rw-r--r--includes/planner.inc42
-rw-r--r--includes/score.inc1
-rw-r--r--includes/session.inc46
-rw-r--r--includes/short.inc1
-rw-r--r--includes/sysbanner.inc16
-rw-r--r--includes/system/history.inc9
-rw-r--r--includes/system/history.old.inc40
-rw-r--r--pages/byfront.inc31
-rw-r--r--pages/logout.inc8
-rw-r--r--pages/profiles.inc4
-rw-r--r--pages/travelling.inc8
25 files changed, 273 insertions, 188 deletions
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 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
-if (!$isLoggedIn) header("Location: /-/login") and die();
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+if (!$isLoggedIn || $isLowerLoggedIn) {
+ header("Location: /-/login");
+ die();
+}
$system = $_GET['s'] ?? null;
$member = $_GET['m'] ?? null;
diff --git a/app/planner/index.php b/app/planner/index.php
index 0ae3663..ebc81e6 100644
--- a/app/planner/index.php
+++ b/app/planner/index.php
@@ -39,7 +39,7 @@
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 (str_contains($parts[0], "/")) {
return explode("/", $parts[0])[0];
} else {
diff --git a/assets/uploads/pt-princesscelestia.png b/assets/uploads/pt-princesscelestia.png
new file mode 100644
index 0000000..baa8055
--- /dev/null
+++ b/assets/uploads/pt-princesscelestia.png
Binary files differ
diff --git a/assets/uploads/pt-luna.png b/assets/uploads/pt-princessluna.png
index 804690a..804690a 100644
--- a/assets/uploads/pt-luna.png
+++ b/assets/uploads/pt-princessluna.png
Binary files 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 @@
-<?php global $isLoggedIn; global $metadata; global $memberData; global $lang; global $pages; $pronouns = getMemberPronouns($memberData['pronouns']); ?>
-<div id="member-details" class="<?= $isLoggedIn ? 'member-details-loggedIn' : '' ?>" style="<?php if (!$isLoggedIn): ?>grid-template-columns: repeat(4, 1fr);<?php endif; ?> background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
+<?php global $isLoggedIn; global $metadata; global $memberData; global $isLowerLoggedIn; global $lang; global $pages; $pronouns = getMemberPronouns($memberData['pronouns']); ?>
+<div id="member-details" class="<?= ($isLoggedIn || $isLowerLoggedIn) ? 'member-details-loggedIn' : '' ?>" style="<?php if (!$isLoggedIn && !$isLowerLoggedIn): ?>grid-template-columns: repeat(4, 1fr);<?php endif; ?> background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
<div>
<b><?= $lang["details"]["food"] ?></b><span class="member-small-separator"><br></span>
<?= match ($metadata["food"]) {
@@ -17,10 +17,10 @@
2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst($pronouns["subjective"])) . ($pronouns["third"] ? " shares" : " share") . " all memories with " . str_replace("'", "&apos;", $pronouns["possessive_det"]) . " headmates.'>" . $lang["details"]["memory_states"][2] . "</span>",
} ?>
</div>
- <?php if ($isLoggedIn): ?>
+ <?php if ($isLoggedIn || $isLowerLoggedIn): ?>
<div>
<b>Age:</b><span class="member-small-separator"><br></span>
- <?php if (!isset($metadata["birth"]["year"])): ?>
+ <?php if (!isset($metadata["birth"]["year"]) || $metadata["birth"]["age"] > 0): ?>
<?php if ($metadata["birth"]["age"] === -1): $age = abs(log(0)); // => INF ?>
<?= "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst($pronouns["subjective"])) . " never age" . str_replace("'", "&apos;", $pronouns["third"] ? "s" : "") . " and " . str_replace("'", "&apos;", $pronouns["third"] ? "doesn't" : "don't") . " have a defined age, making " . str_replace("'", "&apos;", $pronouns["object"]) . " pretty much eternal.'>Eternal</span>" ?>
<?php elseif ($metadata["birth"]["age"] <= 0): ?>
@@ -70,9 +70,10 @@
<?php endif; ?>
</div>
</div>
-<?php if ($isLoggedIn): ?>
-<div id="member-details-2" style="background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
+<?php if ($isLoggedIn || $isLowerLoggedIn): ?>
+<div id="member-details-2" style="background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;<?php if ($isLowerLoggedIn): ?>grid-template-columns: repeat(3, 1fr);<?php endif; ?>">
<?php if (((isset($age) && $age >= 16 && $metadata["little"] === 0) || (!isset($age) && $metadata["little"] === 0)) || $metadata["sexual_features"]): ?>
+ <?php if ($isLoggedIn): ?>
<div>
<span style="vertical-align: middle;">
<b>Sexual consent:</b><span class="member-small-separator"><br></span>
@@ -86,6 +87,7 @@
<img src="/assets/icons/warning.svg" style="width: 16px;" title="Although this pony is able to engage in sexual relationships, they are not allowed to have sex with ponies who are over 16 years old." data-bs-toggle="tooltip">
<?php endif; ?>
</div>
+ <?php endif; ?>
<div>
<b><span class="member-detail-desktop">Sexual alignment</span><span class="member-detail-mobile">Sex. algn.</span>:</b><span class="member-small-separator"><br></span>
<?php switch ($metadata["alignment"]["sexual"]) {
@@ -110,7 +112,7 @@
<div>
<style>
#member-details-2 {
- grid-template-columns: 2fr 1fr 1fr;
+ grid-template-columns: <?= $isLowerLoggedIn ? "1fr 1fr 1fr" : "2fr 1fr 1fr" ?>;
}
</style>
<div style="display: flex; align-items: center; justify-content: center; height: 100%;opacity:.5;">This member is too young to be in a sexual relationship.</div>
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 @@
-<?php global $isLoggedIn; global $isUserLoggedIn; global $pages; global $navigation; $byColor = getMembersByColor($_SERVER['HTTP_HOST'] === "fr.equestria.horse"); global $lang; global $pages; ?>
+<?php global $isLoggedIn; global $isLowerLoggedIn; global $pages; global $navigation; $byColor = getMembersByColor($_SERVER['HTTP_HOST'] === "fr.equestria.horse"); global $lang; global $pages; ?>
<?php if ($_SERVER['HTTP_HOST'] === "fr.equestria.horse"): ?>
<div id="pane-header-background" style="background-image: linear-gradient(90deg, <?php
@@ -43,11 +43,11 @@ foreach ($list as $color) {
</a>
</div>
-<?php if ($isLoggedIn || $isUserLoggedIn): ?>
+<?php if ($isLoggedIn || $isLowerLoggedIn): ?>
<a onclick="toggleGlobalSearch();" id="login-link" class="login-link-clickable">
<?= $lang["navigation"]["search"] ?>
</a>
-<?php elseif (!$isLoggedIn && !$isUserLoggedIn): ?>
+<?php else: ?>
<a href="/-/login" id="login-link" class="login-link-clickable">
<?php global $_PROFILE; ?>
<img alt="" src="/assets/icons/login.svg" style="filter:invert(1);width:24px;vertical-align: middle;">
@@ -56,7 +56,7 @@ foreach ($list as $color) {
<?php endif; ?>
<?php endif; ?>
-<?php foreach ($navigation as $id => $item): if (!$item["admin"] || $isLoggedIn): ?>
+<?php foreach ($navigation as $id => $item): if (!$item["admin"] || $isLoggedIn || $isLowerLoggedIn): ?>
<div class="pane-group" id="pane-group-<?= $id ?>">
<div class="pane-group-title">
@@ -64,19 +64,19 @@ foreach ($list as $color) {
<span style="vertical-align: middle;"><?= $item["name"] ?></span>
</div>
- <?php foreach ($item["items"] as $category): ?>
+ <?php foreach ($item["items"] as $category): if (!($category["minimal"] && $isLowerLoggedIn)): ?>
<div class="pane-group-category <?= $category["minimal"] ? "pane-group-category-minimal" : "" ?>" <?= $category["minimal"] ? 'style="display: grid; grid-template-columns: repeat(' . count($category["items"]) . ', 1fr); grid-gap: 10px;"' : "" ?>>
<?php if (isset($category["name"])): ?>
<div class="pane-group-category-title"><?= $category["name"] ?></div>
<?php endif; ?>
- <?php foreach ($category["items"] as $link): if (isset($link)): ?>
+ <?php foreach ($category["items"] as $link): if (isset($link)): if (!($isLowerLoggedIn && $link["private"])): ?>
<a class="pane-group-item" href="<?= $link["link"] ?>">
<img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px; border-radius: 5px; vertical-align: middle;">
<?php if (!$category["minimal"]): ?><span style="vertical-align: middle;<?= isset($link["stepped"]) ? "color: $link[stepped];" : "" ?>"><?= isset($link["stepped"]) ? "<b>$link[name]</b>" : $link["name"] ?></span><?php endif; ?>
</a>
- <?php endif; endforeach; ?>
+ <?php endif; endif; endforeach; ?>
</div>
- <?php endforeach; ?>
+ <?php endif; endforeach; ?>
</div>
<?php endif; endforeach; ?>
diff --git a/includes/planner.inc b/includes/planner.inc
index 1bc5143..ce6e0cb 100644
--- a/includes/planner.inc
+++ b/includes/planner.inc
@@ -4,7 +4,7 @@ require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.inc"; global $tra
require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.inc";
require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.inc";
require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isUserLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isUserLoggedIn; global $isLowerLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
@@ -14,9 +14,11 @@ $cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
$raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/gdapd.json"), true);
function pacifier($id) {
+ global $isLowerLoggedIn;
+
$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $id . ".json"), true));
- if ($metadata["pacifier"]) {
+ if ($metadata["pacifier"] && !$isLowerLoggedIn) {
return "<img title='This pony likes to sleep with a pacifier.' data-bs-toggle='tooltip' src='/assets/logo/pacifier.png' style='margin-left:auto;float: right;opacity:.75;width:24px;height:24px;vertical-align: middle; filter: invert(1);'>";
}
@@ -113,6 +115,7 @@ function formatTime($time) {
function school($time, $first = false) {
global $school;
global $_PROFILE;
+ global $isLowerLoggedIn;
$day = date('Y-m-d', $time);
$parts = [];
@@ -127,6 +130,8 @@ function school($time, $first = false) {
}
}
+ if ($isLowerLoggedIn) $parts = [];
+
if (count($parts) > 0) {
if ($first) {
return ucfirst(implode(", ", $parts));
@@ -142,7 +147,7 @@ function school($time, $first = false) {
}
}
-function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; ?>
+function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; global $isLowerLoggedIn; ?>
<?php if (!isset($display)) {
$display = date('l', time() + (86400 * $diff));
}
@@ -194,10 +199,10 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
</td>
<?php if (!isset($dayCloudburst[$index][1])): ?>
- <td class="planner-cofronter-inner planner-link" style="width:5%;text-align:center;border-left-color: transparent;border-bottom-color: transparent;">
+ <td class="planner-cofronter-inner planner-link" style="width:5%;text-align:center;border-left-color: transparent;border-bottom-color: transparent;"><?php if (!$isLowerLoggedIn): ?>
<a onclick="addCofronter('cloudburst', <?= $diff ?>, <?= $index ?>);" class="planner-add-link planner-add-link-cofronter">
<span class="planner-add-link-cofronter-inner"><img src="/assets/icons/add.svg" alt="" class="planner-add-icon"></span>
- </a>
+ </a><?php endif; ?>
</td>
<?php else: ?>
<td class="planner-link" style="border-bottom-color: transparent;width:41.35vw;" colspan="2">
@@ -211,7 +216,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
</td>
<?php endif; ?>
- <?php elseif ($index === count($dayCloudburst)): ?>
+ <?php elseif ($index === count($dayCloudburst)): if (!$isLowerLoggedIn): ?>
<td class="planner-add-inner planner-link" colspan="5" style="border-top-color: transparent;border-bottom-color: transparent;">
<a onclick="addFronter('cloudburst', <?= $diff ?>, <?= $index ?>);" id="planner-add-link-cloudburst-<?= $diff ?>" class="planner-add-link">
<div class="planner-add-link-inner">
@@ -220,7 +225,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
</div>
</a>
</td>
- <?php else: ?>
+ <?php endif; else: ?>
<td colspan="5" class="planner-empty" style="border-top-color:transparent;border-bottom-color:transparent;"></td>
<?php endif; ?>
<?php if (isset($dayRaindrops[$index])): ?>
@@ -238,13 +243,13 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
</td>
<?php if (!isset($dayRaindrops[$index][1])): ?>
- <td class="planner-cofronter-inner planner-link" style="border-bottom-color: transparent;border-left-color: transparent;width:5%;text-align:center;">
+ <td class="planner-cofronter-inner planner-link" style="border-bottom-color: transparent;border-left-color: transparent;width:5%;text-align:center;"><?php if (!$isLowerLoggedIn): ?>
<a onclick="addCofronter('raindrops', <?= $diff ?>, <?= $index ?>);" class="planner-add-link planner-add-link-cofronter">
<span class="planner-add-link-cofronter-inner"><img src="/assets/icons/add.svg" alt="" class="planner-add-icon"></span>
- </a>
+ </a><?php endif; ?>
</td>
<?php else: ?>
- <td class="planner-link" style="width:41.35vw;" colspan="2">
+ <td class="planner-link" style="border-bottom-color:transparent;width:41.35vw;" colspan="2">
<?php $member = getMemberWithoutSystem($dayRaindrops[$index][1]); ?>
<?php if ($member["name"] === "fusion"): ?>
<a class="member-link" onclick="openEditCofronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><span class="member-link-inner"><img src="/assets/logo/newlogo.png" style="filter:grayscale(1);width:24px;"> <span class="member-link-text"><span class="merge-desktop" style="opacity:.75;">Multiple merged members</span></span></span></a>
@@ -255,7 +260,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
</td>
<?php endif; ?>
- <?php elseif ($index === count($dayRaindrops)): ?>
+ <?php elseif ($index === count($dayRaindrops)): if (!$isLowerLoggedIn): ?>
<td class="planner-add-inner planner-link" colspan="5" style="border-top-color: transparent;border-bottom-color: transparent;">
<a onclick="addFronter('raindrops', <?= $diff ?>, <?= $index ?>);" id="planner-add-link-raindrops-<?= $diff ?>" class="planner-add-link">
<div class="planner-add-link-inner">
@@ -264,7 +269,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
</div>
</a>
</td>
- <?php else: ?>
+ <?php endif; else: ?>
<td colspan="5" class="planner-empty" style="border-top-color:transparent;border-bottom-color:transparent;"></td>
<?php endif; ?>
</tr>
@@ -473,7 +478,6 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
.member-link:hover .member-link-inner, .planner-add-link:hover .planner-add-link-inner, .planner-add-link-cofronter:hover .planner-add-link-cofronter-inner {
background-color: rgba(255, 255, 255, .125);
- /*background-color: rgba(255, 255, 255, .25);*/
}
</style>
@@ -862,15 +866,15 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<p class="text-muted">Editing for the <span id="edit-fronter-system">n/a</span></p>
<div class="list-group" id="list-cloudburst">
- <a class="list-group-item list-group-item-action edit-fronter-link" onclick="deleteFronter();">
+ <a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="deleteFronter();">
<img src="/assets/icons/delete.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Delete</span>
</a>
- <a class="list-group-item list-group-item-action edit-fronter-link" onclick="moveFronterUp();">
+ <a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="moveFronterUp();">
<img src="/assets/icons/up.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Move up</span>
</a>
- <a class="list-group-item list-group-item-action edit-fronter-link" onclick="moveFronterDown();">
+ <a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="moveFronterDown();">
<img src="/assets/icons/down.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Move down</span>
</a>
@@ -898,14 +902,10 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<p class="text-muted">Editing for the <span id="edit-cofronter-system">n/a</span></p>
<div class="list-group" id="list-cloudburst">
- <a class="list-group-item list-group-item-action edit-cofronter-link" onclick="deleteCofronter();">
+ <a class="list-group-item list-group-item-action edit-cofronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="deleteCofronter();">
<img src="/assets/icons/delete.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Delete</span>
</a>
- <!--<a class="list-group-item list-group-item-action edit-fronter-link" onclick="invertCofronter();">
- <img src="/assets/icons/invert.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
- <span style="vertical-align: middle;">Invert main and secondary fronters</span>
- </a>-->
<a class="list-group-item list-group-item-action edit-cofronter-link" onclick="viewCofronterPage();">
<img src="/assets/icons/page.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">View page</span>
diff --git a/includes/score.inc b/includes/score.inc
index 703b9cc..96925bf 100644
--- a/includes/score.inc
+++ b/includes/score.inc
@@ -17,6 +17,7 @@ function calculateScore($metadata, $name) {
$scoreAdd = 0;
if ($name === "Cloudy Dreams") $scoreAdd += 250;
+ if ($name === "Princess Celestia") $scoreAdd += 250;
if ($name === "Scootaloo") $scoreAdd -= 235;
$score = $scoreLeader + $scorePersecutor + $scoreFictive + $scoreLittle + $scoreNotTalking + $scoreProtector + $scoreSharedMemory + $scoreRelations + $scoreSpecies + $scoreName + $scoreMedian + $scoreAdd;
diff --git a/includes/session.inc b/includes/session.inc
index 4e2569c..5c94e92 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -1,41 +1,27 @@
<?php
global $isLoggedIn;
-global $isUserLoggedIn;
+global $isLowerLoggedIn;
global $_PROFILE;
-if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) {
- if (str_contains($_COOKIE['PEH2_SESSION_TOKEN'], ".") || str_contains($_COOKIE['PEH2_SESSION_TOKEN'], "/") || trim($_COOKIE["PEH2_SESSION_TOKEN"]) === "") {
- $isLoggedIn = false;
- }
+$isLoggedIn = false;
+$isLowerLoggedIn = false;
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) {
- $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN']))), true);
-
- if (isset($_GET['invert'])) {
- $_PROFILE["login"] = $_PROFILE["login"] === "raindrops" ? "cloudburst" : "raindrops";
- $_PROFILE["name"] = $_PROFILE["name"] === "Raindrops System" ? "Cloudburst System" : "Raindrops System";
- }
+if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) {
+ if (!(str_contains($_COOKIE['PEH2_SESSION_TOKEN'], ".") || str_contains($_COOKIE['PEH2_SESSION_TOKEN'], "/") || trim($_COOKIE["PEH2_SESSION_TOKEN"]) === "")) {
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) {
+ $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN']))), true);
- $isLoggedIn = true;
- } else {
- $isLoggedIn = false;
- }
-} else {
- $isLoggedIn = false;
-}
+ if (isset($_GET['invert'])) {
+ $_PROFILE["login"] = $_PROFILE["login"] === "raindrops" ? "cloudburst" : "raindrops";
+ $_PROFILE["name"] = $_PROFILE["name"] === "Raindrops System" ? "Cloudburst System" : "Raindrops System";
+ }
-if (isset($_COOKIE['PEH2_USER_TOKEN'])) {
- if (str_contains($_COOKIE['PEH2_USER_TOKEN'], ".") || str_contains($_COOKIE['PEH2_USER_TOKEN'], "/")) {
- $isUserLoggedIn = false;
- }
+ $isLoggedIn = true;
+ } elseif (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) {
+ $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN']))), true);
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens-public/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_USER_TOKEN'])))) {
- $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens-public/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_USER_TOKEN']))), true);
- $isUserLoggedIn = true;
- } else {
- $isUserLoggedIn = false;
+ $isLowerLoggedIn = true;
+ }
}
-} else {
- $isUserLoggedIn = false;
} \ No newline at end of file
diff --git a/includes/short.inc b/includes/short.inc
index fe0baa5..dda38d0 100644
--- a/includes/short.inc
+++ b/includes/short.inc
@@ -13,6 +13,7 @@ $list = [
"cb" => "/cloudburst",
"minty" => "/cloudydreams",
"twilight" => "/twi",
+ "luna" => "/princessluna",
"cloudy" => "/cloudydreams",
"zipp" => "/zippstorm",
"babs" => "/babsseed",
diff --git a/includes/sysbanner.inc b/includes/sysbanner.inc
index f9feb5c..d240869 100644
--- a/includes/sysbanner.inc
+++ b/includes/sysbanner.inc
@@ -50,8 +50,8 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
<?php $member = $fronters["members"][0]; ?>
<a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member["name"])) ?></a>
<?php if (count($fronters["members"]) > 1): ?>
- <br>(<?= $lang["system"]["with"] ?>
- <?php if (isset($fronters["members"][1])): ?><?php $member2 = $fronters["members"][1]; ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($fronters["members"][2])): ?><?php $member2 = $fronters["members"][2]; ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($fronters["members"][3])): ?><?php $member2 = $fronters["members"][3]; ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?>)<?php endif; ?>
+ <br>and
+ <?php if (isset($fronters["members"][1])): ?><?php $member2 = $fronters["members"][1]; ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($fronters["members"][2])): ?><?php $member2 = $fronters["members"][2]; ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($fronters["members"][3])): ?><?php $member2 = $fronters["members"][3]; ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php endif; ?>
<?php else: ?>-<?php endif; ?>
</span>
<span>
@@ -74,7 +74,7 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
?>
<a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member["name"])) ?></a>
<?php if (count($previous) > 1): ?>
- <br>(<?= $lang["system"]["with"] ?> <?php if (isset($previous[1])): ?><?php $member2 = getMemberWithoutSystem($previous[1]); ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($previous[2])): ?><?php $member2 = getMemberWithoutSystem($previous[2]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($previous[3])): ?><?php $member2 = getMemberWithoutSystem($previous[3]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?>)
+ <br>and <?php if (isset($previous[1])): ?><?php $member2 = getMemberWithoutSystem($previous[1]); ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($previous[2])): ?><?php $member2 = getMemberWithoutSystem($previous[2]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?><?php if (isset($previous[3])): ?><?php $member2 = getMemberWithoutSystem($previous[3]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>" . $lang["system"]["more"] . "</peh-muted>" : $member2["name"])) ?></a><?php endif; ?>
<?php endif; ?>
<?php else: ?>-<?php endif; ?>
</span>
@@ -102,7 +102,7 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
</div>
</div>
-<div id="system-actions" style="padding:5px 30px;display:grid;grid-template-columns: 1fr 1fr 1fr 1fr;background-color:rgba(255, 255, 255, .025);margin-left: -20px; margin-right: -20px;">
+<div id="system-actions" style="padding:5px 30px;display:grid;grid-template-columns: 1fr 1fr;background-color:rgba(255, 255, 255, .025);margin-left: -20px; margin-right: -20px;">
<a title="<?= $pages["s:history"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/history">
<img src="/assets/icons/history.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
<span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:history"]["name"][$lang["_name"]] ?></span>
@@ -111,12 +111,12 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
<img src="/assets/icons/compare.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
<span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:compare"]["name"][$lang["_name"]] ?></span>
</a>
- <a title="<?= $pages["s:tree"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/tree">
+ <!--<a title="<?= $pages["s:tree"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/tree">
<img src="/assets/icons/tree.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
<span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:tree"]["name"][$lang["_name"]] ?></span>
- </a>
- <a title="<?= $pages["s:species"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/species">
+ </a>-->
+ <!--<a title="<?= $pages["s:species"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/species">
<img src="/assets/icons/species.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
<span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:species"]["name"][$lang["_name"]] ?></span>
- </a>
+ </a>-->
</div> \ No newline at end of file
diff --git a/includes/system/history.inc b/includes/system/history.inc
index b66b8c4..ee7f762 100644
--- a/includes/system/history.inc
+++ b/includes/system/history.inc
@@ -56,10 +56,9 @@ function getMember(string $id) {
$original = str_replace("Sat", "Sam.", $original);
$original = str_replace("Sun", "Dim.", $original);
- return $original;
- } else {
- return $original;
}
+
+ return $original;
}
function getSwitchesForDay(int $day) {
@@ -145,8 +144,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (count($switch["members"]) > 1): ?>
- (<?= $lang["system"]["with"] ?>
- <?php if (isset($switch["members"][1])): $member2 = getMember($switch["members"][1]); ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?><?php if (isset($switch["members"][2])): $member2 = getMember($switch["members"][2]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?><?php if (isset($switch["members"][3])): $member2 = getMember($switch["members"][3]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?>)
+ and
+ <?php if (isset($switch["members"][1])): $member2 = getMember($switch["members"][1]); ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?><?php if (isset($switch["members"][2])): $member2 = getMember($switch["members"][2]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?><?php if (isset($switch["members"][3])): $member2 = getMember($switch["members"][3]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?>
<?php endif; ?>
</span>
</div>
diff --git a/includes/system/history.old.inc b/includes/system/history.old.inc
index ee687d7..060ba97 100644
--- a/includes/system/history.old.inc
+++ b/includes/system/history.old.inc
@@ -123,8 +123,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -166,8 +166,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -209,8 +209,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -252,8 +252,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -295,8 +295,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -338,8 +338,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -381,8 +381,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -424,8 +424,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -467,8 +467,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ and <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
@@ -504,8 +504,8 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?>
- (with <a class="member-link" href="/<?= $member2["name"] ?>">
- <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>)
+ <a class="member-link" href="/<?= $member2["name"] ?>">
+ <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>
<?php endif; ?>
</span>
</div>
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()): ?>
- <div class="relation" style="background-color:<?php if ($member["_metadata"]["less_frequent"] || $member["_metadata"]["persecutor"]): ?><?php if ($member["_lastFronted"] > time() - (86400 * 21)): ?>rgba(255, 255, 255, .1)<?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 37)): ?>rgba(255, 227, 0, 0.17)<?php else: ?>rgba(255,55,55,0.17)<?php endif; ?>;<?php endif; ?><?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 21)): ?>rgba(255, 255, 255, .1)<?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 30)): ?>rgba(255, 227, 0, 0.17)<?php else: ?>rgba(255,55,55,0.17)<?php endif; ?>;<?php endif; ?><?php endif; ?>;margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;<?php if ($travelling[$member['id']]["travelling"]): ?>opacity: 0.75;<?php endif; ?>">
+ }); $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): ?>
+ <div class="relation" style="background-color:<?php if ($member["_metadata"]["less_frequent"] || $member["_metadata"]["persecutor"]): ?><?php if ($member["_lastFronted"] > time() - (86400 * 21)): ?>rgba(255, 255, 255, .1)<?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 37)): ?>rgba(255, 227, 0, 0.17)rgba(128,54,54,0.17)<?php endif; ?>;<?php endif; ?><?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 21)): ?>rgba(255, 255, 255, .1)<?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 30)): ?>rgba(255, 227, 0, 0.17)<?php else: ?>rgba(255,55,55,0.17)<?php endif; ?>;<?php endif; ?><?php endif; ?>;margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;<?php if ($travelling[$member['id']]["travelling"]): ?>opacity: 0.75;<?php endif; ?><?php if (isset($member["_metadata"]["not_fronting"]) && $member["_metadata"]["not_fronting"]): ?>background-color:rgba(255, 255, 255, .1) !important;<?php endif; ?>">
<a class="relation-intro" style="background-color:rgba(255, 255, 255, .05);border-right:1px solid rgba(255, 255, 255, .1);margin:-10px;padding:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;color: white;display:flex;align-items:center;text-decoration: none;" href="/<?= $member["name"] ?>">
<img src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px;">&nbsp;<?= $member["display_name"] ?? $member["name"] ?>
<span style="display: inline-block;margin-left: auto;">
- <?php if ($member["_metadata"]["less_frequent"]): ?>
+ <?php if ($member["_metadata"]["not_fronting"]): ?>
+ <span class="badge bg-info rounded-pill text-black">No</span>
+ <?php endif; ?>
+ <?php if ($member["_metadata"]["less_frequent"] && !(isset($member["_metadata"]["not_fronting"]) && $member["_metadata"]["not_fronting"])): ?>
<span class="badge bg-success rounded-pill">Less</span>
<?php endif; ?>
<?php if ($member["_metadata"]["persecutor"]): ?>
@@ -121,7 +144,7 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
<?php endif; ?>
</div>
</div>
- <?php endif; endforeach; ?>
+ <?php endif; endif; endforeach; ?>
<style>
@media (max-width: 991px) {
diff --git a/pages/logout.inc b/pages/logout.inc
index 0263278..37d89ed 100644
--- a/pages/logout.inc
+++ b/pages/logout.inc
@@ -3,12 +3,8 @@
if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) {
unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])));
- }
-}
-
-if (isset($_COOKIE['PEH2_USER_TOKEN'])) {
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens-public/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_USER_TOKEN'])))) {
- unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens-public/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_USER_TOKEN'])));
+ } elseif (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) {
+ unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])));
}
}
diff --git a/pages/profiles.inc b/pages/profiles.inc
index f24d5d9..dd6df4b 100644
--- a/pages/profiles.inc
+++ b/pages/profiles.inc
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $_PROFILE;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $_PROFILE; global $isLowerLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/profiles.inc';
@@ -27,7 +27,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/profiles.inc';
?>
- <?php if (count($fronters) > 0): $me = $fronters[0]; $me = array_values(array_filter($ordered, function ($i) use ($me) { return $i["id"] === $me["id"]; }))[0]; ?>
+ <?php if (!$isLowerLoggedIn && count($fronters) > 0): $me = $fronters[0]; $me = array_values(array_filter($ordered, function ($i) use ($me) { return $i["id"] === $me["id"]; }))[0]; ?>
<p>Hi <b><?= $me["display_name"] ?></b>,
<?php if ($me["_score"]["progress"] === 1): ?>
your profile is complete, congratulations!
diff --git a/pages/travelling.inc b/pages/travelling.inc
index 674d739..46b1a7f 100644
--- a/pages/travelling.inc
+++ b/pages/travelling.inc
@@ -1,12 +1,12 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $isLowerLoggedIn;
$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
-if (isset($_GET['toggleTravel'])) {
+if (isset($_GET['toggleTravel']) && $isLoggedIn) {
if (isset($travelling[$_GET['member']])) {
$id = $_GET['member'];
$equestria = isset($_GET['equestria']);
@@ -152,7 +152,7 @@ global $travelling;
<div>
<?php if ($travelling[$member['id']]["travelling"]): ?>
<div class="dropdown">
- <button type="button" class="btn btn-outline-danger dropdown-toggle" data-bs-toggle="dropdown">
+ <button type="button" class="btn btn-outline-danger dropdown-toggle" data-bs-toggle="dropdown" <?= $isLowerLoggedIn ? "disabled" : "" ?>>
Stop travelling
</button>
<ul class="dropdown-menu">
@@ -161,7 +161,7 @@ global $travelling;
</div>
<?php else: ?>
<div class="dropdown">
- <button type="button" class="btn btn-outline-success dropdown-toggle" data-bs-toggle="dropdown">
+ <button type="button" class="btn btn-outline-success dropdown-toggle" data-bs-toggle="dropdown" <?= $isLowerLoggedIn ? "disabled" : "" ?>>
Start travelling
</button>
<ul class="dropdown-menu">