summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/account.inc4
-rw-r--r--pages/alerts.inc6
-rw-r--r--pages/api/2023ui.php5
-rw-r--r--pages/api/close.php1
-rw-r--r--pages/api/computer.php68
-rw-r--r--pages/api/computername.php12
-rw-r--r--pages/api/data.php12
-rw-r--r--pages/api/design.php58
-rw-r--r--pages/api/evening.php155
-rw-r--r--pages/api/overage.php47
-rw-r--r--pages/api/pleasure-real.php2
-rw-r--r--pages/api/pleasure.php2
-rw-r--r--pages/api/ponytown.php2
-rw-r--r--pages/docs.inc3
-rw-r--r--pages/evening.inc11
-rw-r--r--pages/home.inc202
-rw-r--r--pages/lists.inc2
-rw-r--r--pages/login.inc2
-rw-r--r--pages/metadata.inc3
-rw-r--r--pages/money.inc2
-rw-r--r--pages/pair.inc12
-rw-r--r--pages/ponytown.inc6
-rw-r--r--pages/profiles.inc106
-rw-r--r--pages/public.inc210
-rw-r--r--pages/schedules.inc134
-rw-r--r--pages/sessions.inc2
26 files changed, 236 insertions, 833 deletions
diff --git a/pages/account.inc b/pages/account.inc
index b8fc9f5..216892c 100644
--- a/pages/account.inc
+++ b/pages/account.inc
@@ -1,8 +1,6 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
-
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
<br>
@@ -25,7 +23,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
<hr>
<?php $version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true); ?>
- <p>Cold Haze System Software, build <?= $version["build"] ?>.<?= $version["revision"] ?> · © 2022-<?= date('Y') ?> <a href="https://equestria.dev" target="_blank">Equestria.dev Developers</a></p>
+ <p>Ponycule Software, build <?= $version["build"] ?>.<?= $version["revision"] ?> · © 2022-<?= date('Y') ?> <a href="https://equestria.dev" target="_blank">Equestria.dev Developers</a></p>
</div>
</div>
diff --git a/pages/alerts.inc b/pages/alerts.inc
index a0b47ff..ec6c988 100644
--- a/pages/alerts.inc
+++ b/pages/alerts.inc
@@ -1,7 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
+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/components/header.inc'; ?>
@@ -25,12 +24,15 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
}, 1000);
</script><?php endif; ?>
</a>
+ <?php if (!$isLowerLoggedIn): ?>
<a href="/-/wakeup" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;">
<img src="<?= icon('wakeup', null, true) ?>" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">Wake-up alert</div>
</a>
+ <?php endif; if ($_PROFILE["login"] !== "Moonwind"): ?>
<a href="/-/pleasure" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;">
<img src="<?= icon('pleasure', null, true) ?>" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">Pleasure alert</div>
</a>
+ <?php endif; ?>
</div>
</div>
</div>
diff --git a/pages/api/2023ui.php b/pages/api/2023ui.php
deleted file mode 100644
index 0501b9a..0000000
--- a/pages/api/2023ui.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-
-setcookie("new2023UI", "yes", time() + 86400*365, "/", "", true, true);
-header("Location: /?ui2023intro");
-die(); \ No newline at end of file
diff --git a/pages/api/close.php b/pages/api/close.php
deleted file mode 100644
index 07d1cff..0000000
--- a/pages/api/close.php
+++ /dev/null
@@ -1 +0,0 @@
-<script>window.close();</script> \ No newline at end of file
diff --git a/pages/api/computer.php b/pages/api/computer.php
deleted file mode 100644
index 2c75183..0000000
--- a/pages/api/computer.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-if (time() >= 1688169600) die();
-
-if (isset($_GET["chrome"])) {
- header("Access-Control-Allow-Origin: chrome-extension://" . preg_replace("/[^a-z]/m", "", $_GET["chrome"]));
- header("Access-Control-Allow-Credentials: true");
-}
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE;
-
-if (!$isLoggedIn || !isset($_PROFILE) || !isset($_PROFILE["login"])) {
- header("Location: /-/login");
- die();
-}
-
-$request_raw = file_get_contents('php://input');
-$json_object = json_decode($request_raw, true);
-
-$host = md5($json_object['host'] ?? $_GET["host"]);
-
-switch ($_GET['type']) {
- case "heartbeat":
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $_PROFILE['login'] . "-" . $host . ".json")) {
- $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $_PROFILE['login'] . "-" . $host . ".json"), true);
- $data["date"] = date('c');
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $_PROFILE['login'] . "-" . $host . ".json", json_encode($data));
- }
- break;
-
- case "screenshot":
- $id = $json_object['id'];
- $data = base64_decode($json_object['data']);
-
- if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens");
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens/" . $_PROFILE['login'] . "-" . $host . "-" . $id . ".jpg", $data);
- break;
-
- case "window":
- $id = sha1($json_object['id']);
- $data = base64_decode($json_object['data']);
-
- if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows");
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows/" . $_PROFILE['login'] . "-" . $host . "-" . $id . ".jpg", $data);
-
- if (isset($json_object['icon'])) {
- $data2 = base64_decode($json_object['icon']);
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows/" . $_PROFILE['login'] . "-" . $host . "-" . $id . ".png", $data2);
- } else {
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows/" . $_PROFILE['login'] . "-" . $host . "-" . $id . ".png", "");
- }
-
- break;
-
- case "data":
- if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata");
- if (isset($json_object["_session"])) unset($json_object["_session"]);
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $_PROFILE['login'] . "-" . $host . ".json", json_encode($json_object));
- break;
-}
-
-if (isset($_GET["json"])) {
- die(json_encode([
- "id" => $_PROFILE['login'] . "-" . $host
- ]));
-} else {
- die($_PROFILE['login'] . "-" . $host);
-} \ No newline at end of file
diff --git a/pages/api/computername.php b/pages/api/computername.php
deleted file mode 100644
index 477a8e6..0000000
--- a/pages/api/computername.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-if (time() >= 1688169600) die();
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE;
-if (!$isLoggedIn) header("Location: /-/login") and die();
-
-$names = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/names.json"), true);
-$names[$_GET["id"]] = $_GET["name"];
-file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/names.json", json_encode($names));
-
-die(); \ No newline at end of file
diff --git a/pages/api/data.php b/pages/api/data.php
deleted file mode 100644
index eb07824..0000000
--- a/pages/api/data.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
-if (!$isLoggedIn) header("Location: /-/login") and die();
-
-if (!isset($_GET['f']) || !file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $_GET['f'])) {
- die();
-} else {
- header("Content-Type: " . mime_content_type($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $_GET['f']));
- die(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $_GET['f']));
-} \ No newline at end of file
diff --git a/pages/api/design.php b/pages/api/design.php
deleted file mode 100644
index 1894a75..0000000
--- a/pages/api/design.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/random.inc";
-
-if (!$isLoggedIn || !isset($_GET["type"]) || !isset($_GET["member"])) die("Not logged in or missing operand");
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $_GET["member"] . ".png")) die("No initial Pony Town character");
-
-$designs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $_GET["member"] . ".json"), true);
-
-$inputJSON = file_get_contents('php://input');
-$input = json_decode($inputJSON, true);
-
-switch ($_GET["type"]) {
- case "name":
- $designs[$_GET["id"]]["name"] = trim(strip_tags(substr(base64_decode($_GET["value"]), 0, 100)));
-
- if (trim(strip_tags(substr(base64_decode($_GET["value"]), 0, 100))) === "" && $_GET["id"] !== "_main") {
- unset($designs[$_GET["id"]]);
- echo("&");
- }
-
- break;
-
- case "note":
- $designs[$_GET["id"]]["note"] = trim(strip_tags(substr(base64_decode($_GET["value"]), 0, 100)));
- break;
-
- case "upload":
- $id = random();
-
- $file = base64_decode($input["file"]);
- $image = @imagecreatefromstring($file);
-
- imagealphablending($image, false);
- imagesavealpha($image, true);
-
- imagepng($image, "/tmp/temp-" . $id . ".png");
- $text = base64_encode(file_get_contents("/tmp/temp-" . $id . ".png"));
- unlink("/tmp/temp-" . $id . ".png");
-
- $designs[$id] = [
- "name" => "Untitled",
- "note" => "ID: " . $id,
- "image" => $text
- ];
-
- break;
-
- default:
- die("Invalid type");
-}
-
-file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $_GET["member"] . ".json", json_encode($designs));
-
-while (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $_GET["member"] . ".json")) === "") {
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $_GET["member"] . ".json", json_encode($designs));
-} \ No newline at end of file
diff --git a/pages/api/evening.php b/pages/api/evening.php
deleted file mode 100644
index 4d420ab..0000000
--- a/pages/api/evening.php
+++ /dev/null
@@ -1,155 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
-if (!$isLoggedIn || $isLowerLoggedIn) {
- header("Location: /-/login");
- die();
-}
-
-$pairs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/pairs.json"), true);
-$ignored = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json"), true);
-$locked = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json"), true);
-$data = [];
-
-$members = $members = [
- ...array_map(function ($i) {
- $system = "ynmuc";
- $i["_lastFronted"] = -1;
- $id = $i["id"];
- $memberData = $i;
-
- $fronters = array_map(function ($item) {
- return $item["id"];
- }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]);
-
- if (in_array($id, $fronters)) {
- $i["_lastFronted"] = time();
- } else {
- $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true);
-
- $thisMember = array_filter($switches, function ($item) use ($memberData) {
- return in_array($memberData["id"], $item["members"]);
- });
-
- $thisMember = array_values($thisMember);
- $frontingEnd = null;
-
- if (count($thisMember) > 0) {
- $thisIndex = array_search($thisMember[0], $switches);
-
- $frontingStart = $thisMember[0];
- $frontingEnd = $switches[$thisIndex - 1];
- }
-
- if ($frontingEnd !== null && isset($frontingStart)) {
- $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]);
- }
- }
-
- return $i;
- }, array_values(array_filter(scoreOrderGlobal(), function ($i) {
- return $i["_system"] === "ynmuc";
- }))),
- ...array_map(function ($i) {
- $system = "gdapd";
- $i["_lastFronted"] = -1;
- $id = $i["id"];
- $memberData = $i;
-
- $fronters = array_map(function ($item) {
- return $item["id"];
- }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]);
-
- if (in_array($id, $fronters)) {
- $i["_lastFronted"] = time();
- } else {
- $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true);
-
- $thisMember = array_filter($switches, function ($item) use ($memberData) {
- return in_array($memberData["id"], $item["members"]);
- });
-
- $thisMember = array_values($thisMember);
- $frontingEnd = null;
-
- if (count($thisMember) > 0) {
- $thisIndex = array_search($thisMember[0], $switches);
-
- $frontingStart = $thisMember[0];
- $frontingEnd = $switches[$thisIndex - 1];
- }
-
- if ($frontingEnd !== null && isset($frontingStart)) {
- $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]);
- }
- }
-
- return $i;
- }, array_values(array_filter(scoreOrderGlobal(), function ($i) {
- return $i["_system"] === "gdapd";
- })))
-];
-
-usort($pairs, function ($a, $b) use ($members) {
- $times = [];
-
- foreach ($a[0] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
- foreach ($a[1] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
-
- $timeA = time() - min($times);
- $times = [];
-
- foreach ($b[0] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
- foreach ($b[1] as $id) {
- if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id);
- }
-
- $timeB = time() - min($times);
-
- return $timeB - $timeA;
-}); $pairs = array_values($pairs); foreach ($pairs as $pair): $times = [];
- foreach ($pair[0] as $id): $times[] = getLastFronted($members, $id); endforeach;
- foreach ($pair[1] as $id): $times[] = getLastFronted($members, $id); endforeach;
-endforeach;
-
-$listI = 0; for ($i = 0; $i < 7; $i++): $pair = $pairs[$listI];
- $realPair = $pair;
-
- if (isset($locked[date('Y-m-d', time() + 86400 * $i)])) {
- $pair = array_map(function ($i) {
- return explode(",", $i);
- }, explode("|", $locked[date('Y-m-d', time() + 86400 * $i)]));
- }
-
- $data[$i] = [];
- if (!in_array(date('Y-m-d', time() + 86400 * $i), $ignored)) {
- $data[$i][0] = [];
- $data[$i][1] = [];
- foreach ($pair[0] as $id):
- $data[$i][0][] = (getMemberWithoutSystem($id)["display_name"] ?? getMemberWithoutSystem($id)["name"]) . (isset($locked[date('Y-m-d', time() + 86400 * $i)]) ? "*" : "");
- endforeach;
- foreach ($pair[1] as $id):
- $data[$i][1][] = (getMemberWithoutSystem($id)["display_name"] ?? getMemberWithoutSystem($id)["name"]) . (isset($locked[date('Y-m-d', time() + 86400 * $i)]) ? "*" : "");
- endforeach;
- } else {
- $data[$i] = null;
- }
-
- if (
- (!isset($locked[date('Y-m-d', time() + 86400 * $i)]) && !in_array(date('Y-m-d', time() + 86400 * $i), $ignored))
- || (isset($locked[date('Y-m-d', time() + 86400 * $i)]) && $locked[date('Y-m-d', time() + 86400 * $i)] === implode(",", $realPair[0]) . "|" . implode(",", $realPair[1]))
- ) {
- $listI++;
- }
-
- if ($listI === count($pairs)) $listI = 0; endfor;
-
-header("Content-Type: application/json");
-die(json_encode($data, JSON_PRETTY_PRINT)); \ No newline at end of file
diff --git a/pages/api/overage.php b/pages/api/overage.php
deleted file mode 100644
index aef4ac6..0000000
--- a/pages/api/overage.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
-if (!$isLoggedIn) header("Location: /-/login") and die();
-
-header("Content-Type: application/json");
-
-$obj = [
- "raindrops" => null,
- "cloudburst" => null
-];
-
-foreach (["raindrops", "cloudburst"] as $userName) {
- $allowNsfw = null;
- $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($userName === "raindrops" ? "gdapd" : "ynmuc") . "/fronters.json"), true);
-
- if (count($fronters["members"]) > 0) {
- $id = $fronters["members"][0]["id"];
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $id . ".json")) {
- $info = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $id . ".json"), true);
-
- if (isset($info["birth"]["age"]) && $info["birth"]["age"] < 15 && $info["birth"]["age"] > 0) {
- $allowNsfw = false;
- } else if (isset($info["birth"]["year"]) && $info["birth"]["year"] > 1900) {
- if (!isset($info["birth"]["date"])) $info["birth"]["date"] = "01-01";
-
- $age = (int)date('Y') - $info["birth"]["year"] + (strtotime(date('Y') . "-" . $info["birth"]["date"]) <= time() ? 0 : -1);
-
- if ($age < 15) {
- $allowNsfw = false;
- } else {
- $allowNsfw = true;
- }
- } else if ((!isset($info["birth"]["age"]) || $info["birth"]["age"] === 0) && (!isset($info["birth"]["year"]) || $info["birth"]["year"] > 1900)) {
- $allowNsfw = false;
- } else {
- $allowNsfw = true;
- }
- }
- }
-
- $obj[$userName] = $allowNsfw;
-}
-
-die(json_encode($obj, JSON_PRETTY_PRINT)); \ No newline at end of file
diff --git a/pages/api/pleasure-real.php b/pages/api/pleasure-real.php
index 122d994..b523c1a 100644
--- a/pages/api/pleasure-real.php
+++ b/pages/api/pleasure-real.php
@@ -9,8 +9,6 @@ if (!$isLoggedIn && !$isLowerLoggedIn) {
global $_PROFILE;
-if ($_PROFILE["login"] === "cloudburst") return;
-
$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"];
$frontOther = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/fronters.json"), true)["members"];
diff --git a/pages/api/pleasure.php b/pages/api/pleasure.php
index 14abada..58def71 100644
--- a/pages/api/pleasure.php
+++ b/pages/api/pleasure.php
@@ -9,8 +9,6 @@ if (!$isLoggedIn && !$isLowerLoggedIn) {
global $_PROFILE;
-if ($_PROFILE["login"] === "cloudburst") return;
-
$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"];
$frontOther = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/fronters.json"), true)["members"];
diff --git a/pages/api/ponytown.php b/pages/api/ponytown.php
index 6deec43..bc40975 100644
--- a/pages/api/ponytown.php
+++ b/pages/api/ponytown.php
@@ -20,7 +20,7 @@ if (getMemberWithoutSystem($select) === null) {
$member = getMemberWithoutSystem($select);
-if ($isLowerLoggedIn && $member["_system"] !== $app["other"]["id"]) {
+if ($isLowerLoggedIn && $member["_system"] !== $app["other"]["id"] && $member["_system"] !== "hrbom") {
peh_error("System member not found", 404);
return;
}
diff --git a/pages/docs.inc b/pages/docs.inc
index 58256c7..403a4f9 100644
--- a/pages/docs.inc
+++ b/pages/docs.inc
@@ -24,7 +24,7 @@ if ($select === "add") {
if (ctype_alnum($select) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json")) {
$id = $_documentId = $select;
$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json"), true);
- $titleBase = " · " . $title . " · Cold Haze";
+ $titleBase = " · " . $title . " · Ponycule";
$title = $data["name"] . " · " . $title;
} else {
header("Location: /-/docs");
@@ -58,7 +58,6 @@ function showDocument($item) { ?>
<div class="container">
<div>
<?php if (isset($data)): ?><div id="page-content">
- <?php if (isset($data["nsfw"]) && $data["nsfw"]): ?><script>requestExplicit("back");</script><?php endif; ?>
<h2>
<span contenteditable="true" id="document-name" style="outline: none;"><?= $data["name"] ?></span>
<a href="/-/docs" class="small btn btn-outline-light" style="float:right;margin-top:5px;vertical-align:middle;opacity:1 !important; color:white;">Back</a>
diff --git a/pages/evening.inc b/pages/evening.inc
deleted file mode 100644
index 59c34e4..0000000
--- a/pages/evening.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
-
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
-
-<br>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fragments/evening.inc"; ?>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/home.inc b/pages/home.inc
index 11a01de..b4dc96a 100644
--- a/pages/home.inc
+++ b/pages/home.inc
@@ -4,200 +4,10 @@ if (isset($_GET["ec"])) {
header("HTTP/1.1 " . $_GET["ec"] . " Error");
}
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly; global $isNormallyLoggedIn; global $_PROFILE; global $lang; global $pages; global $isLowerLoggedIn; global $app; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $isLoggedIn; global $isLowerLoggedIn;
-global $use2023UI;
-
-function banner() { global $isLoggedIn; global $isLowerLoggedIn; $byColor = getMembersByColor(false, true); global $lang; global $use2023UI; ?>
- <div style="text-align: center;">
- <img alt="" src="/assets/logo/newlogo<?= $isLoggedIn || $isLowerLoggedIn ? "3" : "" ?>.png" style="width:128px;" class="old-ui">
- <img alt="" src="/assets/logo/newlogo-ng.png" style="width:128px;" class="new-ui">
- <p style="z-index:999;position:relative;background:transparent;margin: 20px -10px 0 -20px;padding-right:30px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);">
- <?php foreach ($byColor as $member): ?><a class="rainbow-item" style="overflow: hidden;"><img title="<?= $member["display_name"] ?? $member["name"] ?>" data-bs-toggle="tooltip" src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="height:32px;position:absolute;z-index:99;"></a><?php endforeach; ?>
- </p>
- <div style="margin-top:-33px;margin-bottom:0;margin-left:-20px;margin-right:20px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);position:relative;left:10px;">
- <?php foreach ($byColor as $member): ?><div>
- <span style="display: inline-block;background: transparent;position:absolute;width: 0;height: 0;margin-top: 17px;box-shadow: 0 6px 20px 20px #<?= $member["color"] ?>;z-index: 9;margin-left: 8px;opacity: .75;"></span>
- </div><?php endforeach; ?>
- </div>
- <div id="banner-lower" style="padding:5px 10px;background:#3332328a;position:relative;z-index: 999;backdrop-filter: blur(30px);">
- <h2 style="margin-top: 20px;">Cold Haze</h2>
- <?php if ($isLoggedIn || $isLowerLoggedIn): ?>
- <p><?= count($byColor) ?> ponies in 4 plural systems</p>
- <?php else: ?>
- <p><?= count($byColor) ?> ponies in 3 plural systems</p>
- <?php endif; ?>
- </div>
- </div>
-<?php }
-
-function members() { global $isLoggedIn; global $isLowerLoggedIn; global $app; ?>
- <div id="new-homepage" style="margin-top:20px;">
-
- <div id="new-homepage-systems" <?php if ($isLoggedIn || $isLowerLoggedIn): ?>style="grid-template-columns: repeat(4, 1fr);"<?php endif; ?>>
- <?php newHomepage("ynmuc", "cloudburst", true); ?>
- <?php newHomepage("gdapd", "raindrops", true); ?>
- <?php if ($isLoggedIn || $isLowerLoggedIn) newHomepage($app["other"]["id"], $app["other"]["slug"], true); ?>
- <?php newHomepage("hrbom", "moonglow", true); ?>
- </div>
-
- </div>
-<?php } ?>
-
-<br>
-<div class="container">
- <?php if (isset($_GET['em'])): ?>
- <div class="alert alert-danger alert-dismissible">
- <button onclick='window.history.pushState({"html":null,"pageTitle":document.title},"", "/");' type="button" class="btn-close" data-bs-dismiss="alert"></button>
- <b><?= $lang["home"]["error"] ?> </b><?= strip_tags(base64_decode($_GET['em'])) ?>
- </div>
- <?php endif; ?>
-
- <div class="alert alert-warning alert-dismissible" id="gpuWarning" style="display: none;">
- <button onclick='window.history.pushState({"html":null,"pageTitle":document.title},"", "/");' type="button" class="btn-close" data-bs-dismiss="alert"></button>
- <b>GPU acceleration is turned off or not supported.</b> A lot of visual effects on this website rely on GPU acceleration, which is currently disabled on your browser, meaning the website's overall look will be affected. Please enable GPU acceleration in your browser settings.
- </div>
-
- <?php if ($readOnly && $isNormallyLoggedIn || $readOnly && $isLowerLoggedIn): ?>
- <div class="alert alert-warning">
- <b>Notice: </b>This website is temporarily under maintenance and the administrators have locked the database. Although you are logged in as <?= $_PROFILE['name'] ?>, you cannot access any of the logged-in features while the website is under maintenance. <a href="/-/emergency">Alerts dispatching</a> remains possible in case of an emergency.
- </div>
- <?php endif; ?>
-
-
- <?php
-
- //file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json", "{}");
- $cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json"), true);
- if (!isset($cache["banner"])) $cache["banner"] = [];
- if (!isset($cache["members"])) $cache["members"] = [];
-
- if (!isset($cache["banner"]["public"])) {
- ob_start();
-
- $isLoggedInOldState = $isLoggedIn;
- $isLowerLoggedInOldState = $isLowerLoggedIn;
- $isLoggedIn = false;
- $isLowerLoggedIn = false;
- banner();
- $isLoggedIn = $isLoggedInOldState;
- $isLowerLoggedIn = $isLowerLoggedInOldState;
-
- $cache["banner"]["public"] = ob_get_contents();
- ob_end_clean();
- }
-
- if (!isset($cache["banner"]["private"])) {
- ob_start();
-
- $isLoggedInOldState = $isLoggedIn;
- $isLowerLoggedInOldState = $isLowerLoggedIn;
- $isLoggedIn = true;
- $isLowerLoggedIn = true;
- banner();
- $isLoggedIn = $isLoggedInOldState;
- $isLowerLoggedIn = $isLowerLoggedInOldState;
-
- $cache["banner"]["private"] = ob_get_contents();
- ob_end_clean();
- }
-
- if (!isset($cache["members"]["public"])) {
- ob_start();
-
- $isLoggedInOldState = $isLoggedIn;
- $isLowerLoggedInOldState = $isLowerLoggedIn;
- $isLoggedIn = false;
- $isLowerLoggedIn = false;
- members();
- $isLoggedIn = $isLoggedInOldState;
- $isLowerLoggedIn = $isLowerLoggedInOldState;
-
- $cache["members"]["public"] = ob_get_contents();
- ob_end_clean();
- }
-
- if (!isset($cache["members"]["private"])) {
- ob_start();
-
- $isLoggedInOldState = $isLoggedIn;
- $isLowerLoggedInOldState = $isLowerLoggedIn;
- $isLoggedIn = true;
- $isLowerLoggedIn = true;
- members();
- $isLoggedIn = $isLoggedInOldState;
- $isLowerLoggedIn = $isLowerLoggedInOldState;
-
- $cache["members"]["private"] = ob_get_contents();
- ob_end_clean();
- }
-
- if ($isLowerLoggedIn || $isLoggedIn) {
- echo($cache["banner"]["private"]);
- } else {
- echo($cache["banner"]["public"]);
- }
-
- ?>
- <div id="timeline-container" style="background: #3332328a;padding: 5px 10px;border-top:1px solid rgba(255,255,255,.1);border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;">
- <div id="timeline"></div>
- <script>
- async function refreshTimeline() {
- document.getElementById("timeline").innerHTML = await (await fetch("/api/timeline?gdapd&ynmuc<?= ($isLowerLoggedIn || $isLoggedIn) ? "&" . $app["other"]["id"] : "" ?>&hrbom")).text();
-
- Array.from(document.getElementsByClassName("dynamic-time")).forEach((el) => {
- let time = el.getAttribute("data-time");
- el.innerText = new Date(parseInt(time) * 1000).toTimeString().split(":").splice(0, 2).join(":");
- });
-
- Array.from(document.getElementsByClassName("dynamic-time-mobile")).forEach((el) => {
- let time = el.getAttribute("data-time");
- el.innerText = new Date(parseInt(time) * 1000).toTimeString().split(":")[0] + ":";
- });
- }
-
- setInterval(refreshTimeline, 10000);
- refreshTimeline();
- </script>
- </div>
-
- <?php if ($isLoggedIn || $isLowerLoggedIn): ?>
- <div class="alert alert-warning" style="margin-top: 20px;">
- <b>Cold Haze Documents is now deprecated.</b> Cold Haze's Documents feature is now deprecated in favor of Google Docs and will be removed in the future. Please migrate your documents to Google Drive as soon as possible.
- </div>
- <?php endif; ?>
-
- <!--<div class="alert alert-warning" style="margin-top:20px;">
- <b>Notice:</b> The administrators are currently trying a new optimisation technique based on a virtual file system (chvfs). Data loss, corruption or inconsistency may happen and should be reported on <a href="https://bugs.equestria.dev/issues/CH" target="_blank">bugs.equestria.dev</a>.
- </div>-->
-
- <?php if (isset($_COOKIE["PEH2_SESSION_TOKEN"]) && $_COOKIE["PEH2_SESSION_TOKEN"] !== "" && !$isLoggedIn && !$isLowerLoggedIn): ?>
- <div class="alert alert-warning" style="margin-top:20px;">
- <b>You were previously logged in to Cold Haze, </b>however you have been logged out due to inactivity, due to your device being removed, or due to switching to a new authentication system (such as the v3). Please log in again. <a href="https://bugs.equestria.dev/issue/CH-56/Better-session-security" target="_blank">Learn more.</a>
- </div>
- <?php endif; ?>
-
- <?php
-
- if ($isLowerLoggedIn || $isLoggedIn) {
- echo($cache["members"]["private"]);
- } else {
- echo($cache["members"]["public"]);
- }
-
- ?>
-</div>
-
-<style>
-<?php if ($use2023UI): ?>
-.old-ui {
- display: none;
-}
-<?php else: ?>
-.new-ui {
- display: none;
-}
-<?php endif; ?>
-</style>
-
-<?php file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json", json_encode($cache)); require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
+if ($isLoggedIn || $isLowerLoggedIn) {
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fragments/dashboard.inc";
+} else {
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/public.inc";
+} \ No newline at end of file
diff --git a/pages/lists.inc b/pages/lists.inc
index c9baf06..e14f706 100644
--- a/pages/lists.inc
+++ b/pages/lists.inc
@@ -1,8 +1,6 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
-
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
<br>
diff --git a/pages/login.inc b/pages/login.inc
index 157794f..0e306f1 100644
--- a/pages/login.inc
+++ b/pages/login.inc
@@ -28,7 +28,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; glob
<b>You are already logged in.</b> If you want to log into a different account or using a different authentication method, you may do so now.
</div>
<?php else: ?>
- <p><?= $lang["login"]["select"] ?> Cold Haze.</p>
+ <p><?= $lang["login"]["select"] ?> Ponycule.</p>
<div class="row">
<div class="col-md-6">
<div class="card" style="margin-bottom:10px;text-align: center;">
diff --git a/pages/metadata.inc b/pages/metadata.inc
index aea128b..0c02398 100644
--- a/pages/metadata.inc
+++ b/pages/metadata.inc
@@ -2,7 +2,6 @@
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLowerLoggedIn; global $isLoggedIn; global $lang; global $pages; global $app;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
if (!isset($_GET['_']) || trim($_GET['_']) === "") peh_error("Invalid request", 400);
@@ -16,7 +15,7 @@ if ($system !== "cloudburst" && $system !== "raindrops" && $system !== "moonglow
$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["name"] : ($system === "moonglow" ? "Moonglow" : "Raindrops System"));
$systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["id"] : ($system === "moonglow" ? "hrbom" : "gdapd"));
-if ($isLowerLoggedIn && $systemID !== $app["other"]["id"]) {
+if ($isLowerLoggedIn && $systemID !== $app["other"]["id"] && $systemID !== "hrbom") {
header("Location: /");
die();
}
diff --git a/pages/money.inc b/pages/money.inc
index e3edd27..d1651bc 100644
--- a/pages/money.inc
+++ b/pages/money.inc
@@ -805,7 +805,7 @@ function getMonthlyEarnings(): array {
</label>
</p>
- <p>Adding a transaction takes effect immediately and cannot be modified afterwards.</p>
+ <p>Adding a transaction takes effect immediately and cannot be modified afterward.</p>
<button id="delete-link" class="btn btn-<?= $use2023UI ? "primary" : "success" ?>">Create</button>
</form>
</div>
diff --git a/pages/pair.inc b/pages/pair.inc
index 8b0bb09..42e70ef 100644
--- a/pages/pair.inc
+++ b/pages/pair.inc
@@ -11,7 +11,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; glob
<div class="alert alert-success alert-dismissible" id="pair-confirm" style="display: none;">
<button type="button" class="btn-close" onclick="document.getElementById('pair-confirm').style.display='none';"></button>
- Successfully paired "<span id="paired-name-1">-</span>" with your Cold Haze account. You may now close this page.
+ Successfully paired "<span id="paired-name-1">-</span>" with your Ponycule account. You may now close this page.
</div>
<div class="alert alert-danger alert-dismissible" id="pair-cancel" style="display: none;">
@@ -19,7 +19,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; glob
Cancelled pairing "<span id="paired-name-2">-</span>", this device does not have access to your account. You may now close this page.
</div>
- <p>Pairing allows a connected device that cannot normally use Cold Haze to gather data. This device will get full access to your account as if they were acting on your behalf, so make sure you trust the device and/or application you are using.</p>
+ <p>Pairing allows a connected device that cannot normally use Ponycule to gather data. This device will get full access to your account as if they were acting on your behalf, so make sure you trust the device and/or application you are using.</p>
<?php $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])), true); if (isset($data["profile"])): ?>
<p>Equestria.dev may not have verified the application you use, always check for a signature. Enter the pairing code displayed on your device below:</p>
@@ -42,10 +42,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; glob
</div>
<div class="modal-body">
- <p>You are about to pair the following device with your Cold Haze account:</p>
+ <p>You are about to pair the following device with your Ponycule account:</p>
<blockquote style="display: grid; grid-template-columns: max-content 1fr; grid-gap: 10px;">
<div style="display: flex; align-items: center; justify-content: center;">
- <img src="/assets/logo/newlogo3.png" id="device-icon" style="width: 32px; height: 32px;">
+ <img src="/assets/logo/newlogo-ng.png" id="device-icon" style="width: 32px; height: 32px;">
</div>
<div>
<b>Name:</b> <span id="device-name">-</span><br>
@@ -95,11 +95,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; glob
return "https://git.equestria.dev/equestria.dev/luna/raw/branch/mane/icons/logo.png";
}
- if (name.startsWith("Cold Haze for Wear OS ")) {
+ if (name.startsWith("Cold Haze for Wear OS ") || name.startsWith("Ponycule for Wear OS ")) {
return "https://static.equestria.horse/ch-wear.png";
}
- return "/assets/logo/newlogo3.png";
+ return "/assets/logo/newlogo-ng.png";
}
(async () => {
diff --git a/pages/ponytown.inc b/pages/ponytown.inc
index 08c3f27..b268aa3 100644
--- a/pages/ponytown.inc
+++ b/pages/ponytown.inc
@@ -16,7 +16,7 @@ if (getMemberWithoutSystem($parts[2]) === null) {
$member = getMemberWithoutSystem($parts[2]);
-if ($isLowerLoggedIn && $member["_system"] !== $app["other"]["id"]) {
+if ($isLowerLoggedIn && $member["_system"] !== $app["other"]["id"] && $member["_system"] !== "hrbom") {
peh_error("System member not found", 404);
return;
}
@@ -48,7 +48,7 @@ $member = getMemberWithoutSystem($parts[2]);
<img src="data:image/png;base64,<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png") ? base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png")) : "" ?>" style="width: 100%; border: 1px dashed rgba(255, 255, 255, .5); border-radius: 10px;">
</div>
<div style="display: flex; align-items: center; justify-content: center;">
- <img src="data:image/png;base64,<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png") ? base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png")) : "" ?>" style="width: 100%; border: 1px dashed rgba(255, 255, 255, .5); border-radius: 10px;">
+ <img src="data:image/png;base64,<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png") ? base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png")) : (file_exists($_SERVER['DOCUMENT_ROOT'] . getAsset($member["_system"], $member["id"], "heads")) ? base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . getAsset($member["_system"], $member["id"], "heads"))) : "") ?>" style="width: 100%; border: 1px dashed rgba(255, 255, 255, .5); border-radius: 10px;">
</div>
</div>
@@ -61,7 +61,7 @@ $member = getMemberWithoutSystem($parts[2]);
}
if ($info[1] > 60): ?>
- <p class="text-warning" style="margin-top: 15px; margin-bottom: 0; text-align: center;"><b>This Pony Town character needs to be updated.</b><br>Cold Haze now relies on pixel-perfect versions of one's Pony Town character to work properly, and the current character for this member is not compliant or non-existant.</p>
+ <p class="text-warning" style="margin-top: 15px; margin-bottom: 0; text-align: center;"><b>This Pony Town character needs to be updated.</b><br>Ponycule now relies on pixel-perfect versions of one's Pony Town character to work properly, and the current character for this member is not compliant or non-existant.</p>
<?php endif; ?>
</div>
</div>
diff --git a/pages/profiles.inc b/pages/profiles.inc
deleted file mode 100644
index 8440b5f..0000000
--- a/pages/profiles.inc
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-
-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/components/header.inc';
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/util/profiles.inc';
-
-?>
-
-<br>
-<div class="container">
- <div id="page-content">
- <h2>Profile scores</h2>
- <?php
-
- $ordered = scoreOrderGlobal();
-
- $ordered = array_map(function ($i) {
- $i["_score"] = calculateProfileScore($i);
- return $i;
- }, $ordered);
-
- usort($ordered, function ($a, $b) {
- return $b["_score"]["sortable"] - $a["_score"]["sortable"];
- });
-
- $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($_PROFILE['login'] === "raindrops" ? "gdapd" : "ynmuc") . "/fronters.json"), true)["members"];
-
- ?>
-
- <?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!
- <?php else: ?>
- <?php if (count($me["_score"]["actions"]) > 2): ?>
- your profile is not complete, here is all you need to do:
- <?php else: ?>
- your profile is almost complete, all there's left to do is
- <?php endif; ?>
- <?php endif; ?>
-
- <?php if (count($me["_score"]["actions"]) > 2 || count($me["_score"]["actions"]) === 0): ?></p><?php endif; ?>
-
- <?php if ($me["_score"]["progress"] === 1): ?>
- <p>You will be getting a Complete Profile badge pretty soon, so watch out for it.</p>
- <?php elseif (count($me["_score"]["actions"]) > 2): ?>
- <ul>
- <?php $index = -1; foreach ($me["_score"]["actions"] as $action): $index++; ?>
- <li>add <?= $action ?><?= $index !== count($me["_score"]["actions"]) - 1 ? ($index !== count($me["_score"]["actions"]) - 2 ? ";" : "; and") : "" ?></li>
- <?php endforeach; ?>
- </ul>
- <?php else: ?>
- add <?= implode(" and ", $me["_score"]["actions"]) ?>.
- <p>Once you are done, you will get a Complete Profile badge.</p>
- <?php endif; ?>
-
- <hr>
- <?php endif; ?>
-
- <?php foreach ($ordered as $member): ?>
- <div class="relation" style="background-color:rgba(255, 255, 255, .1);margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1.5fr 6fr;">
- <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;text-decoration: none;" href="/<?= $member["name"] ?>">
- <img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
- </a>
-
- <div style="margin: -10px -10px -10px 10px;background: linear-gradient(90deg, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, .1) <?= round($member["_score"]["progress"] * 100) ?>%, transparent <?= round($member["_score"]["progress"] * 100) ?>.000001%);border-top-right-radius: 10px;border-bottom-right-radius: 10px;display: flex;align-items: center;">
- <div style="margin-left: 10px; width: 100%;">
- <?php if (count($member["_score"]["actions"]) === 0): ?>
- Complete profile
- <?php elseif (count($member["_score"]["actions"]) < 3): ?>
- Add <?= implode(" and ", $member["_score"]["actions"]) ?> to get to 100%
- <?php else: ?>
- <?= round($member["_score"]["progress"] * 100) ?>% complete
- <?php endif; ?>
-
- <div id="icons" style="float:right; margin-right: 10px;">
- <span title="<?= $member["_score"]["values"][5] ? "This member has a Pony Town character" : "This member does not have a Pony Town character" ?>" data-bs-toggle="tooltip">
- <img alt="" src="/assets/icons/ponytown.svg" style="filter: invert(1); opacity: <?= $member["_score"]["values"][5] ? "1" : ".25" ?>;">
- </span>
- <span title="<?= $member["_score"]["values"][6] ? "This member has a color" : "This member does not have a color" ?>" data-bs-toggle="tooltip">
- <img alt="" src="/assets/icons/color.svg" style="filter: invert(1); opacity: <?= $member["_score"]["values"][6] ? "1" : ".25" ?>;">
- </span>
- <span title="<?= $member["_score"]["values"][2] ? "This member has a public page that is over 200 letters long" : ($member["_score"]["pages"][0] ? "This member has a public page but it is only " . $member["_score"]["characters"][0] . " characters long" : "This member does not have a public page") ?>" data-bs-toggle="tooltip">
- <img alt="" src="/assets/icons/global.svg" style="filter: invert(1); opacity: <?= $member["_score"]["values"][2] ? "1" : ($member["_score"]["pages"][0] ? ".5" : ".25") ?>;">
- </span>
- <span title="<?= $member["_score"]["values"][3] ? "This member has a public page that is over 200 letters long" : ($member["_score"]["pages"][1] ? "This member has a public page but it is only " . $member["_score"]["characters"][1] . " characters long" : "This member does not have a public page") ?>" data-bs-toggle="tooltip">
- <img alt="" src="/assets/icons/logout.svg" style="filter: invert(1); opacity: <?= $member["_score"]["values"][3] ? "1" : ($member["_score"]["pages"][1] ? ".5" : ".25") ?>;">
- </span>
- <span title="<?= $member["_score"]["values"][0] ? "This member has their age entered" : (in_array("alicorn", $member["_metadata"]["species"]) ? "This member does not have their age entered, but this might be because they are an alicorn" : "This member does not have their age entered") ?>" data-bs-toggle="tooltip">
- <img alt="" src="/assets/icons/age.svg" style="filter: invert(1); opacity: <?= $member["_score"]["values"][0] ? "1" : (in_array("alicorn", $member["_metadata"]["species"]) ? ".5" : ".25") ?>;">
- </span>
- <span title="<?= $member["_score"]["values"][4] ? "This member has a banner" : "This member does not have a banner" ?>" data-bs-toggle="tooltip">
- <img alt="" src="/assets/icons/banner.svg" style="filter: invert(1); opacity: <?= $member["_score"]["values"][4] ? "1" : ".25" ?>;">
- </span>
- <span title="<?= $member["_score"]["values"][1] ? "This member has their birth date entered" : "This member does not have their birth date entered" ?>" data-bs-toggle="tooltip">
- <img alt="" src="/assets/icons/splitting.svg" style="filter: invert(1); opacity: <?= $member["_score"]["values"][1] ? "1" : ".25" ?>;">
- </span>
- </div>
- </div>
- </div>
- </div>
- <?php endforeach; ?>
- </div>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/public.inc b/pages/public.inc
new file mode 100644
index 0000000..b29d626
--- /dev/null
+++ b/pages/public.inc
@@ -0,0 +1,210 @@
+<?php
+
+if (isset($_GET["ec"])) {
+ header("HTTP/1.1 " . $_GET["ec"] . " Error");
+}
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; $title = ""; global $isNormallyLoggedIn; global $_PROFILE; global $lang; global $pages; global $isLowerLoggedIn; global $app; global $isLoggedIn;
+$isOrigLoggedIn = $isLoggedIn; $isOrigLowerLoggedIn = $isLowerLoggedIn;
+
+if ($isOrigLowerLoggedIn || $isOrigLoggedIn) {
+ $title = "Public home page";
+}
+
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly;
+$isLoggedIn = false; $isLowerLoggedIn = false;
+
+global $use2023UI;
+
+function banner() { $isLoggedIn = false; $isLowerLoggedIn = false; $byColor = getMembersByColor(false, true); global $lang; global $use2023UI; ?>
+ <div style="text-align: center;">
+ <img alt="" src="/assets/logo/newlogo-ng.png" style="width:128px;">
+ <p style="z-index:999;position:relative;background:transparent;margin: 20px -10px 0 -20px;padding-right:30px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);">
+ <?php foreach ($byColor as $member): ?><a class="rainbow-item" style="overflow: hidden;"><img title="<?= $member["display_name"] ?? $member["name"] ?>" data-bs-toggle="tooltip" src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="height:32px;position:absolute;z-index:99;"></a><?php endforeach; ?>
+ </p>
+ <div style="margin-top:-33px;margin-bottom:0;margin-left:-20px;margin-right:20px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);position:relative;left:10px;">
+ <?php foreach ($byColor as $member): ?><div>
+ <span style="display: inline-block;background: transparent;position:absolute;width: 0;height: 0;margin-top: 17px;box-shadow: 0 6px 20px 20px #<?= $member["color"] ?>;z-index: 9;margin-left: 8px;opacity: .75;"></span>
+ </div><?php endforeach; ?>
+ </div>
+ <div id="banner-lower" style="padding:5px 10px;background:#3332328a;position:relative;z-index: 999;backdrop-filter: blur(30px);">
+ <h2 style="margin-top: 20px;">Ponycule</h2>
+ <?php if ($isLoggedIn || $isLowerLoggedIn): ?>
+ <p><?= count($byColor) ?> ponies in 4 plural systems</p>
+ <?php else: ?>
+ <p><?= count($byColor) ?> ponies in 3 plural systems</p>
+ <?php endif; ?>
+ </div>
+ </div>
+<?php }
+
+function members() { $isLoggedIn = false; $isLowerLoggedIn = false; global $app; ?>
+ <div id="new-homepage" style="margin-top:20px;">
+
+ <div id="new-homepage-systems" <?php if ($isLoggedIn || $isLowerLoggedIn): ?>style="grid-template-columns: repeat(4, 1fr);"<?php endif; ?>>
+ <?php newHomepage("ynmuc", "cloudburst", true); ?>
+ <?php newHomepage("gdapd", "raindrops", true); ?>
+ <?php if ($isLoggedIn || $isLowerLoggedIn) newHomepage($app["other"]["id"], $app["other"]["slug"], true); ?>
+ <?php newHomepage("hrbom", "moonglow", true); ?>
+ </div>
+
+ </div>
+<?php } ?>
+
+<br>
+<div class="container">
+ <?php if (isset($_GET['em'])): ?>
+ <div class="alert alert-danger alert-dismissible">
+ <button onclick='window.history.pushState({"html":null,"pageTitle":document.title},"", "/");' type="button" class="btn-close" data-bs-dismiss="alert"></button>
+ <b><?= $lang["home"]["error"] ?> </b><?= strip_tags(base64_decode($_GET['em'])) ?>
+ </div>
+ <?php endif; ?>
+
+ <div class="alert alert-warning alert-dismissible" id="gpuWarning" style="display: none;">
+ <button onclick='window.history.pushState({"html":null,"pageTitle":document.title},"", "/");' type="button" class="btn-close" data-bs-dismiss="alert"></button>
+ <b>GPU acceleration is turned off or not supported.</b> A lot of visual effects on this website rely on GPU acceleration, which is currently disabled on your browser, meaning the website's overall look will be affected. Please enable GPU acceleration in your browser settings.
+ </div>
+
+ <?php if ($readOnly && $isNormallyLoggedIn || $readOnly && $isLowerLoggedIn): ?>
+ <div class="alert alert-warning">
+ <b>Notice: </b>This website is temporarily under maintenance and the administrators have locked the database. Although you are logged in as <?= $_PROFILE['name'] ?>, you cannot access any of the logged-in features while the website is under maintenance. <a href="/-/emergency">Alerts dispatching</a> remains possible in case of an emergency.
+ </div>
+ <?php endif; ?>
+
+
+ <?php
+
+ //file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json", "{}");
+ $cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json"), true);
+ if (!isset($cache["banner"])) $cache["banner"] = [];
+ if (!isset($cache["members"])) $cache["members"] = [];
+
+ if (!isset($cache["banner"]["public"])) {
+ ob_start();
+
+ $isLoggedInOldState = $isLoggedIn;
+ $isLowerLoggedInOldState = $isLowerLoggedIn;
+ $isLoggedIn = false;
+ $isLowerLoggedIn = false;
+ banner();
+ $isLoggedIn = $isLoggedInOldState;
+ $isLowerLoggedIn = $isLowerLoggedInOldState;
+
+ $cache["banner"]["public"] = ob_get_contents();
+ ob_end_clean();
+ }
+
+ if (!isset($cache["banner"]["private"])) {
+ ob_start();
+
+ $isLoggedInOldState = $isLoggedIn;
+ $isLowerLoggedInOldState = $isLowerLoggedIn;
+ $isLoggedIn = true;
+ $isLowerLoggedIn = true;
+ banner();
+ $isLoggedIn = $isLoggedInOldState;
+ $isLowerLoggedIn = $isLowerLoggedInOldState;
+
+ $cache["banner"]["private"] = ob_get_contents();
+ ob_end_clean();
+ }
+
+ if (!isset($cache["members"]["public"])) {
+ ob_start();
+
+ $isLoggedInOldState = $isLoggedIn;
+ $isLowerLoggedInOldState = $isLowerLoggedIn;
+ $isLoggedIn = false;
+ $isLowerLoggedIn = false;
+ members();
+ $isLoggedIn = $isLoggedInOldState;
+ $isLowerLoggedIn = $isLowerLoggedInOldState;
+
+ $cache["members"]["public"] = ob_get_contents();
+ ob_end_clean();
+ }
+
+ if (!isset($cache["members"]["private"])) {
+ ob_start();
+
+ $isLoggedInOldState = $isLoggedIn;
+ $isLowerLoggedInOldState = $isLowerLoggedIn;
+ $isLoggedIn = true;
+ $isLowerLoggedIn = true;
+ members();
+ $isLoggedIn = $isLoggedInOldState;
+ $isLowerLoggedIn = $isLowerLoggedInOldState;
+
+ $cache["members"]["private"] = ob_get_contents();
+ ob_end_clean();
+ }
+
+ if ($isLowerLoggedIn || $isLoggedIn) {
+ echo($cache["banner"]["private"]);
+ } else {
+ echo($cache["banner"]["public"]);
+ }
+
+ ?>
+ <div id="timeline-container" style="background: #3332328a;padding: 5px 10px;border-top:1px solid rgba(255,255,255,.1);border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;">
+ <div id="timeline"></div>
+ <script>
+ async function refreshTimeline() {
+ document.getElementById("timeline").innerHTML = await (await fetch("/api/timeline?gdapd&ynmuc<?= ($isLowerLoggedIn || $isLoggedIn) ? "&" . $app["other"]["id"] : "" ?>&hrbom")).text();
+
+ Array.from(document.getElementsByClassName("dynamic-time")).forEach((el) => {
+ let time = el.getAttribute("data-time");
+ el.innerText = new Date(parseInt(time) * 1000).toTimeString().split(":").splice(0, 2).join(":");
+ });
+
+ Array.from(document.getElementsByClassName("dynamic-time-mobile")).forEach((el) => {
+ let time = el.getAttribute("data-time");
+ el.innerText = new Date(parseInt(time) * 1000).toTimeString().split(":")[0] + ":";
+ });
+ }
+
+ setInterval(refreshTimeline, 10000);
+ refreshTimeline();
+ </script>
+ </div>
+
+ <?php if ($isLoggedIn || $isLowerLoggedIn): ?>
+ <div class="alert alert-warning" style="margin-top: 20px;">
+ <b>Ponycule Documents is now deprecated.</b> Ponycule's Documents feature is now deprecated in favor of Google Docs and will be removed in the future. Please migrate your documents to Google Drive as soon as possible.
+ </div>
+ <?php endif; ?>
+
+ <!--<div class="alert alert-warning" style="margin-top:20px;">
+ <b>Notice:</b> The administrators are currently trying a new optimisation technique based on a virtual file system (chvfs). Data loss, corruption or inconsistency may happen and should be reported on <a href="https://bugs.equestria.dev/issues/CH" target="_blank">bugs.equestria.dev</a>.
+ </div>-->
+
+ <?php if (isset($_COOKIE["PEH2_SESSION_TOKEN"]) && $_COOKIE["PEH2_SESSION_TOKEN"] !== "" && !$isOrigLoggedIn && !$isOrigLowerLoggedIn): ?>
+ <div class="alert alert-warning" style="margin-top:20px;">
+ <b>You were previously logged in to Ponycule, </b>however you have been logged out due to inactivity, due to your device being removed, or due to switching to a new authentication system (such as the v3). Please log in again. <a href="https://bugs.equestria.dev/issue/CH-56/Better-session-security" target="_blank">Learn more.</a>
+ </div>
+ <?php endif; ?>
+
+ <?php
+
+ if ($isLowerLoggedIn || $isLoggedIn) {
+ echo($cache["members"]["private"]);
+ } else {
+ echo($cache["members"]["public"]);
+ }
+
+ ?>
+</div>
+
+<style>
+<?php if ($use2023UI): ?>
+.old-ui {
+ display: none;
+}
+<?php else: ?>
+.new-ui {
+ display: none;
+}
+<?php endif; ?>
+</style>
+
+<?php file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json", json_encode($cache)); require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/pages/schedules.inc b/pages/schedules.inc
deleted file mode 100644
index dde2981..0000000
--- a/pages/schedules.inc
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/evening.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $app;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly; global $isNormallyLoggedIn;
-
-global $use2023UI;
-
-?>
-
-<style>
- .day-gradient {
- background-image: linear-gradient(180deg, rgba(7,15,36,1) 0%, rgba(36,56,83,1) 14%, rgba(165,126,57,1) 28%, rgba(37,109,201,1) 42%, rgba(47,165,208,1) 57%, rgba(252,120,15,1) 71%, rgba(38,66,97,1) 85%, rgba(7,15,36,1) 100%);
- background-size: 100% 1000%;
- }
-
- .invert {
- filter: invert(1) hue-rotate(180deg);
- }
-
- @media (max-width: 800px) {
- #schedules {
- grid-template-columns: 1fr !important;
- }
-
- .schedules-separator {
- display: block !important;
- }
- }
-</style>
-
-<br>
-<div class="container">
- <h2>Schedules</h2>
-
- <div id="schedules" style="margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 20px;">
- <div>
- <div id="live-time-other-outer" class="day-gradient" style="text-align: center; background-color: rgba(255, 255, 255, .1); padding: 20px 0; border-radius: 10px; margin-bottom: 20px;">
- <b><?= $app["other"]["name"] ?></b><br>
- <h3 id="live-time-other">--:--</h3>
- </div>
-
- <hr style="display: none;" class="schedules-separator">
- </div>
-
- <div>
- <div id="live-time-cloudburst-outer" class="day-gradient" style="text-align: center; background-color: rgba(255, 255, 255, .1); padding: 20px 0; border-radius: 10px; margin-bottom: 20px;">
- <b>Cloudburst System</b><br>
- <h3 id="live-time-cloudburst">--:--</h3>
- </div>
-
- <hr style="display: none;" class="schedules-separator">
- </div>
-
- <div>
- <div id="live-time-raindrops-outer" class="day-gradient" style="text-align: center; background-color: rgba(255, 255, 255, .1); padding: 20px 0; border-radius: 10px; margin-bottom: 20px;">
- <b>Raindrops System</b><br>
- <h3 id="live-time-raindrops">--:--</h3>
- </div>
- </div>
-
- <div>
- <div id="live-time-moonwind-outer" class="day-gradient" style="text-align: center; background-color: rgba(255, 255, 255, .1); padding: 20px 0; border-radius: 10px; margin-bottom: 20px;">
- <b>Moonwind System</b><br>
- <h3 id="live-time-moonwind">--:--</h3>
- </div>
- </div>
- </div>
-</div>
-
-<script>
- function getDayPercentage(time) {
- let hours = parseInt(time.split(":")[0]);
- let minutes = parseInt(time.split(":")[1].split(" ")[0]);
-
- if (time.split(":")[1].split(" ")[1] === "PM") hours += 12;
- if (hours === 12 && time.split(":")[1].split(" ")[1] === "AM") hours = 0;
- if (hours === 24 && time.split(":")[1].split(" ")[1] === "PM") hours = 12;
-
- let timestamp = new Date("1970-01-01 " + hours + ":" + minutes + " UTC").getTime() / 1000;
-
- return (timestamp / 86400) * 100;
- }
-
- function updateTime() {
- let time1 = (new Intl.DateTimeFormat('en-US', {
- timeZone: 'Europe/Paris',
- hour: 'numeric',
- minute: '2-digit',
- hour12: false
- })).format(new Date());
-
- document.getElementById("live-time-raindrops").innerText = time1;
- document.getElementById("live-time-raindrops-outer").style.backgroundPositionY = getDayPercentage(time1) + "%";
-
- let time4 = (new Intl.DateTimeFormat('en-US', {
- timeZone: 'Europe/Kyiv',
- hour: 'numeric',
- minute: '2-digit',
- hour12: false
- })).format(new Date());
-
- document.getElementById("live-time-moonwind").innerText = time4;
- document.getElementById("live-time-moonwind-outer").style.backgroundPositionY = getDayPercentage(time4) + "%";
-
- let time2 = (new Intl.DateTimeFormat('en-US', {
- timeZone: 'Europe/London',
- hour: 'numeric',
- minute: '2-digit',
- hour12: false
- })).format(new Date());
-
- document.getElementById("live-time-cloudburst").innerText = time2;
- document.getElementById("live-time-cloudburst-outer").style.backgroundPositionY = getDayPercentage(time2) + "%";
-
- let time3 = (new Intl.DateTimeFormat('en-US', {
- timeZone: 'America/Chicago',
- hour: 'numeric',
- minute: '2-digit',
- hour12: false
- })).format(new Date());
-
- document.getElementById("live-time-other").innerText = time3;
- document.getElementById("live-time-other-outer").style.backgroundPositionY = getDayPercentage(time3) + "%";
- }
-
- updateTime();
-
- setInterval(() => {
- updateTime();
- }, 10000);
-</script>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/sessions.inc b/pages/sessions.inc
index fc861bf..7e6f328 100644
--- a/pages/sessions.inc
+++ b/pages/sessions.inc
@@ -105,7 +105,7 @@ $verifiedNames = [
</div>
<div class="modal-body">
- <p>You are about to log out the following device from your Cold Haze account:</p>
+ <p>You are about to log out the following device from your Ponycule account:</p>
<blockquote id="device-bq">
<div>
<b>Name:</b> <span id="device-name">-</span><br>