From 2b192b3840ac344c456b98304ea400f0af90da15 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sat, 13 Jan 2024 16:12:11 +0100 Subject: Updated 46 files and deleted 19 files (automated) --- pages/alerts.inc | 2 - pages/api/cloudburst-img-round.php | 18 - pages/api/cloudburst-img.php | 11 - pages/api/cloudburst-img2-round.php | 18 - pages/api/cloudburst-two.php | 8 - pages/api/cloudburst.php | 6 - pages/api/emergency-real.php | 2 +- pages/api/emergency.php | 2 +- pages/api/me.php | 10 +- pages/api/money/account.php | 62 --- pages/api/money/accounts.php | 96 ----- pages/api/money/create.php | 99 ----- pages/api/pleasure-real.php | 5 +- pages/api/pleasure.php | 5 +- pages/api/pluralkit-integration.php | 3 - pages/api/raindrops-img-round.php | 18 - pages/api/raindrops-img-round2.php | 20 - pages/api/raindrops-img.php | 11 - pages/api/raindrops-img2-round.php | 18 - pages/api/raindrops-img2-round2.php | 20 - pages/api/raindrops-two.php | 8 - pages/api/raindrops.php | 6 - pages/api/timeline.php | 2 +- pages/api/wakeup-real.php | 33 -- pages/api/wakeup.php | 33 -- pages/byfront.inc | 43 +- pages/emergency.inc | 2 - pages/front.inc | 8 +- pages/metadata.inc | 8 +- pages/money.inc | 822 ------------------------------------ pages/page.inc | 29 +- pages/pleasure.inc | 1 - pages/public.inc | 13 +- pages/relations.inc | 19 +- pages/sessions.inc | 2 - pages/travelling.inc | 223 ---------- 36 files changed, 34 insertions(+), 1652 deletions(-) delete mode 100644 pages/api/cloudburst-img-round.php delete mode 100644 pages/api/cloudburst-img.php delete mode 100644 pages/api/cloudburst-img2-round.php delete mode 100644 pages/api/cloudburst-two.php delete mode 100644 pages/api/cloudburst.php delete mode 100644 pages/api/money/account.php delete mode 100644 pages/api/money/accounts.php delete mode 100644 pages/api/money/create.php delete mode 100644 pages/api/raindrops-img-round.php delete mode 100644 pages/api/raindrops-img-round2.php delete mode 100644 pages/api/raindrops-img.php delete mode 100644 pages/api/raindrops-img2-round.php delete mode 100644 pages/api/raindrops-img2-round2.php delete mode 100644 pages/api/raindrops-two.php delete mode 100644 pages/api/raindrops.php delete mode 100644 pages/api/wakeup-real.php delete mode 100644 pages/api/wakeup.php delete mode 100644 pages/money.inc delete mode 100644 pages/travelling.inc (limited to 'pages') diff --git a/pages/alerts.inc b/pages/alerts.inc index 46d514d..a47c84f 100644 --- a/pages/alerts.inc +++ b/pages/alerts.inc @@ -1,8 +1,6 @@
diff --git a/pages/api/cloudburst-img-round.php b/pages/api/cloudburst-img-round.php deleted file mode 100644 index 3238696..0000000 --- a/pages/api/cloudburst-img-round.php +++ /dev/null @@ -1,18 +0,0 @@ - count($fronters["members"]) > 1 -])); \ No newline at end of file diff --git a/pages/api/cloudburst.php b/pages/api/cloudburst.php deleted file mode 100644 index 2750a98..0000000 --- a/pages/api/cloudburst.php +++ /dev/null @@ -1,6 +0,0 @@ - getAsset("gdapd"), "email" => $_PROFILE["profile"]["email"]["email"] ])); -} else if ($_PROFILE["login"] === "cloudburst") { +} else if ($_PROFILE["login"] === "Moonglow") { die(json_encode([ "valid" => true, - "name" => "Cloudburst System", - "id" => "cloudburst", - "pluralkit" => "ynmuc", - "avatar" => getAsset("ynmuc"), + "name" => "Moonglow", + "id" => "moonglow", + "pluralkit" => "hrbom", + "avatar" => getAsset("hrbom"), "email" => $_PROFILE["profile"]["email"]["email"] ])); } else { diff --git a/pages/api/money/account.php b/pages/api/money/account.php deleted file mode 100644 index 1801b28..0000000 --- a/pages/api/money/account.php +++ /dev/null @@ -1,62 +0,0 @@ - $transaction) { - $member = getMemberWithoutSystem($transaction["author"]) ?? getMemberWithoutSystem("zdtsg"); - $trans = [ - "id" => $index, - "author" => [ - "avatar" => getAsset($member["_system"], $member["id"]), - "name" => $member["display_name"] ?? $member["name"] - ], - "type" => $transaction["amount"] < 0 ? "REMOVE" : "ADD", - "amount" => round(abs($transaction["amount"]), 2), - "date" => [ - "ts" => strtotime($transaction["date"]), - "iso" => date('c', strtotime($transaction["date"])), - "relative" => timeAgo($transaction["date"]) - ], - "description" => (isset($transaction["description"]) && trim($transaction["description"]) !== "") ? trim($transaction["description"]) : null - ]; - - $acc["transactions"][] = $trans; - } - - $obj = $acc; - } -} - -/* ------------------- */ - -die(json_encode($obj, JSON_PRETTY_PRINT)); \ No newline at end of file diff --git a/pages/api/money/accounts.php b/pages/api/money/accounts.php deleted file mode 100644 index 9f85323..0000000 --- a/pages/api/money/accounts.php +++ /dev/null @@ -1,96 +0,0 @@ - 0, - "exchange_rate" => $rate, - "users" => [ - "cloudburst" => [ - "total" => 0, - "accounts" => [] - ], - "raindrops" => [ - "total" => 0, - "accounts" => [] - ] - ] -]; - -$allAccounts = array_reduce(array_map(function ($i) { - return calculateFullAmount($i, true, true); -}, $accounts), function ($a, $b) { - return $a + $b; -}); -$obj["total"] = [ - "gbp" => round($allAccounts, 2), - "eur" => round($allAccounts * (1 / $rate), 2) -]; - -/* ------------------- */ - -$allAccounts = array_reduce(array_map(function ($i) { - return calculateFullAmount($i, true, true); -}, array_values(array_filter($accounts, function ($i) { return $i["owner"] === "cloudburst"; }))), function ($a, $b) { - return $a + $b; -}); - -$obj["users"]["cloudburst"]["total"] = $allAccounts; - -foreach ($accounts as $index => $account) { - if ($account["owner"] === "cloudburst") { - $acc = []; - - $acc["id"] = $account["_name"]; - $acc["name"] = $account["name"]; - $acc["currency"] = $account["currency"]; - $acc["default"] = $account["default"]; - $acc["total"] = round(calculateFullAmount($account, true), 2); - $acc["interests"] = $account["interests"]; - $acc["max"] = $account["max"]; - $acc["used_percentage"] = isset($account["max"]) ? round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) : null; - - $obj["users"]["cloudburst"]["accounts"][] = $acc; - } -} -/* ------------------- */ - -$allAccounts = array_reduce(array_map(function ($i) { - return calculateFullAmount($i, true, true); -}, array_values(array_filter($accounts, function ($i) { return $i["owner"] === "raindrops"; }))), function ($a, $b) { - return $a + $b; -}); - -$obj["users"]["raindrops"]["total"] = $allAccounts; - -foreach ($accounts as $index => $account) { - if ($account["owner"] === "raindrops") { - $acc = []; - - $acc["id"] = $account["_name"]; - $acc["name"] = $account["name"]; - $acc["currency"] = $account["currency"]; - $acc["default"] = $account["default"]; - $acc["total"] = round(calculateFullAmount($account, true), 2); - $acc["interests"] = $account["interests"]; - $acc["max"] = $account["max"]; - $acc["used_percentage"] = isset($account["max"]) ? round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) : null; - $acc["transactions"] = null; - - $obj["users"]["raindrops"]["accounts"][] = $acc; - } -} - -/* ------------------- */ - -die(json_encode($obj, JSON_PRETTY_PRINT)); \ No newline at end of file diff --git a/pages/api/money/create.php b/pages/api/money/create.php deleted file mode 100644 index 12cc7c9..0000000 --- a/pages/api/money/create.php +++ /dev/null @@ -1,99 +0,0 @@ - 0) { - $myId = $fronters[0]["id"]; -} else { - $myId = "zdtsg"; -} - -$accounts = array_map(function ($i) { - $name = substr($i, 0, -5); - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/money/" . $i), true); - $data["_name"] = $name; - return $data; -}, array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/money"), function ($i) { return !str_starts_with($i, "."); }))); -$rate = (float)trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/exchange.txt")); - -$obj = [ - "success" => false, - "error" => null -]; - -if ($_SERVER["REQUEST_METHOD"] !== "POST") { - $obj["success"] = false; - $obj["error"] = "INVALID_METHOD"; - die(json_encode($obj, JSON_PRETTY_PRINT)); -} - -if (!isset($data["amount"]) || !isset($data["id"]) || !isset($data["description"])) { - $obj["success"] = false; - $obj["error"] = "MISSING_OPERAND"; - die(json_encode($obj, JSON_PRETTY_PRINT)); -} - -$account = array_values(array_filter($accounts, function ($i) use ($data) { return $i["_name"] === $data["id"]; }))[0] ?? null; - -if (!isset($account)) { - $obj["success"] = false; - $obj["error"] = "ACCOUNT_NOT_FOUND"; - die(json_encode($obj, JSON_PRETTY_PRINT)); -} - -if (!(isset($data["amount"]) && is_numeric($data["amount"]) && (float)$data["amount"] < 9999 && (float)$data["amount"] > -9999)) { - $obj["success"] = false; - $obj["error"] = "INVALID_AMOUNT"; - die(json_encode($obj, JSON_PRETTY_PRINT)); -} -if (!isset($data["description"])) $data["description"] = ""; - -if (strlen($data["description"]) > 150) { - $obj["success"] = false; - $obj["error"] = "DESCRIPTION_TOO_LONG"; - die(json_encode($obj, JSON_PRETTY_PRINT)); -} - -if ($data["amount"] === 0) { - $obj["success"] = false; - $obj["error"] = "AMOUNT_IS_ZERO"; - die(json_encode($obj, JSON_PRETTY_PRINT)); -} - -$ntfy = $GLOBALS["ColdHazeApp"]["ntfy"]; -file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy["topic"], false, stream_context_create([ - 'http' => [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush((getMember($myId)["display_name"] ?? getMember($myId)["name"]) . " created a transaction to " . $account["name"] . " (" . ucfirst($account["owner"]) . ")") . "\r\n" . - "Tags: bits\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush(($account["currency"] === "gbp" ? "£" : "€") . abs((float)$data["amount"]) . " were " . ((float)$data["amount"] >= 0 ? "added" : "removed") . " just now" . (trim($data["description"]) !== "" ? ": " . $data["description"] : "")) - ] -])); - -array_unshift($account["transactions"], [ - "author" => $myId, - "description" => $data["description"], - "amount" => (float)$data["amount"], - "date" => date('c') -]); - -$name = $account["_name"]; -unset($account["_name"]); - -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/money/" . $name . ".json", json_encode($account, JSON_PRETTY_PRINT)); - -$obj["success"] = true; -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 adfe732..c1cbd59 100644 --- a/pages/api/pleasure-real.php +++ b/pages/api/pleasure-real.php @@ -1,7 +1,6 @@ count($fronters["members"]) > 1 -])); \ No newline at end of file diff --git a/pages/api/raindrops.php b/pages/api/raindrops.php deleted file mode 100644 index c44faa6..0000000 --- a/pages/api/raindrops.php +++ /dev/null @@ -1,6 +0,0 @@ - [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("🥱 Wake up!") . "\r\n" . - "Priority: high\r\n" . - "Tags: wakeup\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("Hey, $pony wants you to wake up!") - ] -])); - -die(); \ No newline at end of file diff --git a/pages/api/wakeup.php b/pages/api/wakeup.php deleted file mode 100644 index a5d2b9f..0000000 --- a/pages/api/wakeup.php +++ /dev/null @@ -1,33 +0,0 @@ - [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("[Test] 🥱 Wake up!") . "\r\n" . - "Priority: high\r\n" . - "Tags: wakeup\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("[This notification is test] Hey, $pony wants you to wake up! [This notification is test]") - ] -])); - -die(); \ No newline at end of file diff --git a/pages/byfront.inc b/pages/byfront.inc index beb9275..0974091 100644 --- a/pages/byfront.inc +++ b/pages/byfront.inc @@ -12,51 +12,12 @@ global $app; global $_PROFILE;

Members by last fronted

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; diff --git a/pages/emergency.inc b/pages/emergency.inc index e51b410..d57269a 100644 --- a/pages/emergency.inc +++ b/pages/emergency.inc @@ -1,8 +1,6 @@ diff --git a/pages/front.inc b/pages/front.inc index 73f193c..ad38a14 100644 --- a/pages/front.inc +++ b/pages/front.inc @@ -3,8 +3,8 @@ $parts = explode("/", $_GET["_"]); if (isset($parts[2])) { - if ($parts[2] === "cloudburst") { - $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true); + if ($parts[2] === "moonglow") { + $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/hrbom/fronters.json"), true); } elseif ($parts[2] === "raindrops") { $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true); } else { @@ -16,8 +16,8 @@ if (isset($parts[2])) { header("Location: /" . $fronters["members"][0]["name"]); die(); } else { - if ($parts[2] === "cloudburst") { - header("Location: /cloudburst"); + if ($parts[2] === "moonglow") { + header("Location: /moonglow"); } else { header("Location: /raindrops"); } diff --git a/pages/metadata.inc b/pages/metadata.inc index 0c02398..53d5c05 100644 --- a/pages/metadata.inc +++ b/pages/metadata.inc @@ -11,9 +11,9 @@ array_shift($parts); $system = $parts[0]; $member = !isset($parts[1]) || $parts[1] === "" ? null : $parts[1]; -if ($system !== "cloudburst" && $system !== "raindrops" && $system !== "moonglow" && $system !== $app["other"]["slug"]) peh_error("Invalid system name: " . $system, 400); -$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 ($system !== "raindrops" && $system !== "moonglow" && $system !== $app["other"]["slug"]) peh_error("Invalid system name: " . $system, 400); +$systemCommonName = $system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["name"] : ($system === "moonglow" ? "Moonglow" : "Raindrops System"); +$systemID = $system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["id"] : ($system === "moonglow" ? "hrbom" : "gdapd"); if ($isLowerLoggedIn && $systemID !== $app["other"]["id"] && $systemID !== "hrbom") { header("Location: /"); @@ -94,7 +94,7 @@ if ($member === null) { $toUpdate["gender"] = strip_tags($_GET["gender"]); } - $regex = "/^(ynmuc|gdapd|" . $app["other"]["id"] . ")\/[a-z]{5}$/m"; + $regex = "/^(hrbom|gdapd|" . $app["other"]["id"] . ")\/[a-z]{5}$/m"; if (isset($_GET["marefriends"])) { $toUpdate["marefriends"] = array_values(array_filter(array_map(function ($i) { return trim($i); }, explode(",", $_GET["marefriends"])), function ($i) use ($regex) { diff --git a/pages/money.inc b/pages/money.inc deleted file mode 100644 index 881c618..0000000 --- a/pages/money.inc +++ /dev/null @@ -1,822 +0,0 @@ - 0) { - $myId = $fronters[0]["id"]; -} else { - $myId = "zdtsg"; -} - -if ((isset($_GET["create"]) || isset($_GET["delete"])) && isset($parts[2])) { - $account = array_values(array_filter($accounts, function ($i) use ($parts) { return $i["_name"] === $parts[2]; }))[0]; - - header("Content-Type: text/plain"); - - if (isset($_GET["create"])) { - if (!(isset($_GET["amount"]) && is_numeric($_GET["amount"]) && (float)$_GET["amount"] < 9999 && (float)$_GET["amount"] > -9999)) { - header("Location: /-/money/" . $parts[2]); - die(); - } - if (!isset($_GET["description"])) $_GET["description"] = ""; - $_GET["description"] = substr($_GET["description"], 0, 150); - - $ntfy = $GLOBALS["ColdHazeApp"]["ntfy"]; - file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy["topic"], false, stream_context_create([ - 'http' => [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush((getMember($myId)["display_name"] ?? getMember($myId)["name"]) . " created a transaction to " . $account["name"] . " (" . ucfirst($account["owner"]) . ")") . "\r\n" . - "Tags: bits\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush(($account["currency"] === "gbp" ? "£" : "€") . abs((float)$_GET["amount"]) . " were " . ((float)$_GET["amount"] >= 0 ? "added" : "removed") . " just now" . (trim($_GET["description"]) !== "" ? ": " . $_GET["description"] : "")) - ] - ])); - - if ((float)$_GET["amount"] !== 0.0) array_unshift($account["transactions"], [ - "author" => $myId, - "description" => $_GET["description"], - "amount" => (float)$_GET["amount"], - "date" => date('c') - ]); - - $name = $account["_name"]; - unset($account["_name"]); - - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/money/" . $name . ".json", json_encode($account, JSON_PRETTY_PRINT)); - } else { - if (isset($_GET["id"]) && is_numeric($_GET["id"]) && isset($account["transactions"][(int)$_GET["id"]])) { - $ntfy = $GLOBALS["ColdHazeApp"]["ntfy"]; - file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy["topic"], false, stream_context_create([ - 'http' => [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush((getMember($myId)["display_name"] ?? getMember($myId)["name"]) . " deleted a transaction from " . $account["name"] . " (" . ucfirst($account["owner"]) . ")") . "\r\n" . - "Tags: bits\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush(($account["currency"] === "gbp" ? "£" : "€") . abs((float)$account["transactions"][(int)$_GET["id"]]["amount"]) . " " . ((float)$account["transactions"][(int)$_GET["id"]]["amount"] >= 0 ? "advance" : "withdrawal") . " created by " . (getMemberWithoutSystem($account["transactions"][(int)$_GET["id"]]["author"])["display_name"] ?? getMemberWithoutSystem($account["transactions"][(int)$_GET["id"]]["author"])["name"]) . " " . timeAgo($account["transactions"][(int)$_GET["id"]]["date"])) - ] - ])); - - unset($account["transactions"][(int)$_GET["id"]]); - - $name = $account["_name"]; - unset($account["_name"]); - - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/money/" . $name . ".json", json_encode($account, JSON_PRETTY_PRINT)); - } - } - - header("Location: /-/money/" . $parts[2]); - die(); -} - -$rate = (float)trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/exchange.txt")); - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; -$transactionMonths = []; - -foreach ($accounts as $account) { - array_push($transactionMonths, ...array_map(function ($i) { return date('Y-m', strtotime($i["date"])); }, array_filter($account["transactions"], function ($i) { return !isset($i["initial"]) || !$i["initial"]; }))); -} - -$months = [ - ...[ - "2022-12", "2022-11", "2022-10", "2022-09", - "2022-08", "2022-07", "2022-06" - ], - ...array_values(array_filter(array_unique(array_reduce($transactionMonths, function ($a, $b) { - return [...$a, $b]; - }, [])), function ($i) { - return $i !== date('Y-m'); - })) -]; - -$monthlyCloudburst = []; -$monthlyRaindrops = []; - -$bits = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/bits.json"), true); -$projects = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/projects.json"), true); - -foreach ($bits["cloudburst"] as $month => $value) { - $monthlyCloudburst[$month] = $value; -} - -foreach ($bits["raindrops"] as $month => $value) { - $monthlyRaindrops[$month] = $value; -} - -foreach ($months as $month) { - $gainedCloudburst = $monthlyCloudburst[$month] ?? 0; - $gainedRaindrops = $monthlyRaindrops[$month] ?? 0; - - foreach ($accounts as $account) { - foreach ($account["transactions"] as $transaction) { - if (isset($transaction["initial"]) && $transaction["initial"]) continue; - if (date('Y-m', strtotime($transaction["date"])) !== $month) continue; - - if ($account["owner"] === "raindrops") { - $gainedRaindrops += $transaction["amount"]; - } else { - $gainedCloudburst += $transaction["amount"]; - } - } - } - - $monthlyCloudburst[$month] = $gainedCloudburst; - $monthlyRaindrops[$month] = $gainedRaindrops; -} - -uksort($monthlyCloudburst, function ($k1, $k2) { - return strtotime($k2) - strtotime($k1); -}); - -uksort($monthlyRaindrops, function ($k1, $k2) { - return strtotime($k2) - strtotime($k1); -}); - -function getMonthlyEarnings(): array { - global $monthlyRaindrops; - global $monthlyCloudburst; - - return [ - "cloudburst" => array_sum(array_values($monthlyCloudburst)) / count($monthlyCloudburst), - "raindrops" => array_sum(array_values($monthlyRaindrops)) / count($monthlyRaindrops) - ]; -} - -?> - - - - - -
-
- -
-

Money tracker

- -
- The Ponycule money tracker is deprecated and will be removed. Data currently in the money tracker will be moved to individual accounts on a dedicated money tracking application that Equestria.dev will not have control over. -
- -
- - -

£ · €

-

As of · €1.00 = £

- - - - - -
- -

Cloudburst System (£, earning £/month)

-
-
- Show monthly earnings - - - $value): ?> - - - - - -
:">£
-
-
-
- $account): if ($account["owner"] === "cloudburst"): ?> - "> -
-
-

- Default · % interests -
Max balance: (% used)
No maximum balance -
-
-
- -
- -
- $minimumCloudburst) { - $part2 = ($allAccounts - $minimumCloudburst) / $allAccounts; - $part1 = 1 - $part2; - $difference = $allAccounts - $minimumCloudburst; - } else { - $part1 = 1; - $part2 = 0; - $difference = $minimumCloudburst - $allAccounts; - } - - ?> -
-
-
-

">£ $minimumCloudburst): ?> (%) $minimumCloudburst ? "over" : "under" ?> the minimum

- - -
-
- " style="width: 100%;"> -
-
-
-

-
-
%">
-
- 0): $months = ceil($missing / getMonthlyEarnings()["cloudburst"]); ?> -
Costs £ · Missing £ · Can afford it in (in month 1 ? "s" : "" ?>)
-
You can afford it now, this will take you to the minimum.
-
You can afford it now, this will take you £ above the minimum.
-
-
-
- - - - - - -

Raindrops System (, earning €/month)

-
-
- Show monthly earnings - - - $value): ?> - - - - - -
:">€
-
-
-
- $account): if ($account["owner"] === "raindrops"): ?> - "> -
-
-

- Default · % interests -
Max balance: (% used)
No maximum balance -
-
-
- -
- -
- $minimumRaindrops) { - $part2 = ($allAccounts - $minimumRaindrops) / $allAccounts; - $part1 = 1 - $part2; - $difference = $allAccounts - $minimumRaindrops; - } else { - $part1 = 1; - $part2 = 0; - $difference = $minimumRaindrops - $allAccounts; - } - - ?> -
-
-
-

">€ $minimumRaindrops): ?> (%) $minimumRaindrops ? "over" : "under" ?> the minimum

- - -
-
- " style="width: 100%;"> -
-
-
-

-
-
%">
-
- 0): $months = ceil($missing / getMonthlyEarnings()["raindrops"]); ?> -
Costs € · Missing € · Can afford it in (in month 1 ? "s" : "" ?>)
-
You can afford it now, this will take you to the minimum.
-
You can afford it now, this will take you € above the minimum.
-
-
-
- - - - - -
- -

- · (default) - " style="float:right;margin-top:5px;vertical-align:middle;opacity:1 !important; ">Back -

-
-

-
-
Maximum balance: (% used)No maximum balance
-
Interests: % interestsNone
-
-
- - - - -
- - - - - - - - - -
- - diff --git a/pages/page.inc b/pages/page.inc index fb63383..fa82a10 100644 --- a/pages/page.inc +++ b/pages/page.inc @@ -9,10 +9,7 @@ if (!isset($_GET['_']) || trim($_GET['_']) === "") peh_error("Invalid request", $parts = explode("/", $_GET['_']); -if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== "moonglow" && $parts[0] !== $app["other"]["slug"]) && (!(count($parts) > 2) || $parts[1] === "-")) { - $namesCloudburst = [...array_map(function ($i) { - return $i['name']; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)), "unknown-cb"]; +if (($parts[0] !== "raindrops" && $parts[0] !== "moonglow" && $parts[0] !== $app["other"]["slug"]) && (!(count($parts) > 2) || $parts[1] === "-")) { $namesRaindrops = [...array_map(function ($i) { return $i['name']; }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)), "unknown-rd"]; @@ -33,9 +30,7 @@ if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== "m array_unshift($parts, ""); $parts = array_values($parts); - if (in_array($parts[1], $namesCloudburst)) { - $parts[0] = "cloudburst"; - } else if (in_array($parts[1], $namesRaindrops)) { + if (in_array($parts[1], $namesRaindrops)) { $parts[0] = "raindrops"; } else if (in_array($parts[1], $namesMoonglow)) { $parts[0] = "moonglow"; @@ -49,9 +44,9 @@ if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== "m $system = $parts[0]; $member = ($parts[1] ?? null) === "" ? null : ($parts[1] ?? null); -if ($system !== "cloudburst" && $system !== "raindrops" && $system !== "moonglow" && ($system !== $app["other"]["slug"] && !$isLowerLoggedIn && !$isLoggedIn)) peh_error("System not found", 404); -$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 ($system !== "raindrops" && $system !== "moonglow" && ($system !== $app["other"]["slug"] && !$isLowerLoggedIn && !$isLoggedIn)) peh_error("System not found", 404); +$systemCommonName = $system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["name"] : ($system === "moonglow" ? "Moonglow" : "Raindrops System"); +$systemID = $system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["id"] : ($system === "moonglow" ? "hrbom" : "gdapd"); if ($member === null) { global $_SystemName; @@ -72,13 +67,12 @@ if ($member === null) { $traveller = false; $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === $app["other"]["id"] ? "other" : $systemID) . "/members.json"), true); - $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true); + $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "hrbom" : "gdapd") . "/members.json"), true); $memberData = null; $memberCommonName = null; $memberID = null; - foreach ($members as $m) { - if ($m['name'] === $member) { + foreach ($members as $m) {if ($m['name'] === $member) { $memberData = $m; $memberCommonName = $m['display_name'] ?? $m['name']; $memberID = $m['id']; @@ -86,14 +80,7 @@ if ($member === null) { } foreach ($members2 as $m) { - if ($m['name'] === $member && $travelling[$m['id']]['travelling']) { - $traveller = true; - $memberData = $m; - $memberCommonName = $m['display_name'] ?? $m['name']; - $memberID = $m['id']; - $system = $systemID === "gdapd" ? "cloudburst" : "raindrops"; - $systemID = $system === "cloudburst" ? "ynmuc" : "gdapd"; - } else if ($m['name'] === $member) { + if ($m['name'] === $member) { $memberFoundInAnotherSystem = true; } } diff --git a/pages/pleasure.inc b/pages/pleasure.inc index 1a6e50a..5435bd1 100644 --- a/pages/pleasure.inc +++ b/pages/pleasure.inc @@ -1,7 +1,6 @@
-
style="grid-template-columns: repeat(4, 1fr);"> - +
style="grid-template-columns: repeat(3, 1fr);"> @@ -74,7 +73,7 @@ function members() { $isLoggedIn = false; $isLowerLoggedIn = false; global $app;
- -
- Ponycule Documents is now deprecated. 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. -
- - diff --git a/pages/relations.inc b/pages/relations.inc index 1c5a878..5d3f7ef 100644 --- a/pages/relations.inc +++ b/pages/relations.inc @@ -11,7 +11,7 @@ function page() { global $isLoggedIn; global $isLowerLoggedIn; global $pages; gl

-
+
"> " style="width:24px;"> @@ -66,23 +66,6 @@ function page() { global $isLoggedIn; global $isLowerLoggedIn; global $pages; gl - - - - - - -
- Friends:
-
- - - - - " data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="/">" style="width:24px;"> - - -
diff --git a/pages/sessions.inc b/pages/sessions.inc index 7e6f328..444e981 100644 --- a/pages/sessions.inc +++ b/pages/sessions.inc @@ -7,7 +7,6 @@ $verified = [ dns_get_record("zephyrheights.equestria.dev", DNS_A)[0]["ip"], dns_get_record("maretimebay.equestria.dev", DNS_A)[0]["ip"], dns_get_record("bridlewood.equestria.dev", DNS_A)[0]["ip"], - dns_get_record("cloudsdale.equestria.dev", DNS_A)[0]["ip"], dns_get_record("manehattan.equestria.dev", DNS_A)[0]["ip"], dns_get_record("everfree.equestria.dev", DNS_A)[0]["ip"], ]; @@ -16,7 +15,6 @@ $verifiedNames = [ "Raindrops System", "Raindrops System", "Equestria.dev bridlewood", - "Cloudburst System", "Equestria.dev manehattan", $app["other"]["name"] ]; diff --git a/pages/travelling.inc b/pages/travelling.inc deleted file mode 100644 index c7eaadf..0000000 --- a/pages/travelling.inc +++ /dev/null @@ -1,223 +0,0 @@ - [ - 'method' => "DELETE", - 'header' => "Authorization: " . $app["pluralkit"][$travellingSystem === "gdapd" ? "raindrops" : "cloudburst"] - ] - ]; - - $reqContext = stream_context_create($reqOptions); - - // No actual data is received on DELETE, so we don't even bother trying to collect req response; if it fails it will put a warning in the logs anyway. - //sleep(1); - //file_get_contents("https://api.pluralkit.me/v2/members/$travellingMember", false, $reqContext); - } - } else { - $travelling[$_GET['member']]["travelling"] = true; - $travelling[$_GET['member']]["equestria"] = $equestria; - $travelling[$_GET['member']]["pluralkit"] = null; - $travelling[$_GET['member']]["history"][] = [ - "start" => date("c"), - "end" => null, - "equestria" => $equestria - ]; - - if (!$equestria) { - // Insert code here to run after a travelling member is ADDED. - // $id is the member ID (e.g. rirgf) - // $member is the member - // $system is the system the member comes from - // $metadata is the ponies.equestria.horse metadata - // $travellingMember is unset here - // Store the travelling member ID in $travelling[$id]['pluralkit'] - $reqOptions = [ - 'http' => [ - 'method' => "POST", - 'header' => "Authorization: " . $app["pluralkit"][$travellingSystem === "gdapd" ? "raindrops" : "cloudburst"] . "\r\n" . - "Content-Type: application/json", - 'content' => json_encode([ - 'name' => "$member[name]-travelling", - 'display_name' => $member["display_name"], - 'color' => $member["color"], - 'birthday' => $member["birthday"], - 'created' => $member["created"], - 'pronouns' => $member["pronouns"], - 'avatar_url' => $member["avatar_url"], - 'banner' => $member["banner"], - 'description' => "**This pony is visiting this system from the " . ($system === "gdapd" ? "Raindrops System" : "Cloudburst System") . ". They are not a permanent member of this system**\n\n$member[description]", - 'proxy_tags' => array_map(function ($i) { - $i["prefix"] = "+" . $i['prefix']; - return $i; - }, $member["proxy_tags"]), - 'privacy' => $member["privacy"] - ]) - ] - ]; - - $reqContext = stream_context_create($reqOptions); - - //sleep(1); - //$member = json_decode(file_get_contents("https://api.pluralkit.me/v2/members", false, $reqContext), true); - - // Member exists? - //if (isset($member)) { - //$travelling[$id]['pluralkit'] = $member["id"]; - //} - } - } - } - - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/navigation.json", "{}"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json", "{}"); - createJob("RefreshCache", []); - - header("Location: /-/travelling"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); - die(); -} - -global $use2023UI; - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; -global $travelling; - -?> - - - -
-
-
-

System travelling

- -
- -
- "> - " style="width:24px;">  - - -
-
- Current location:
- - - - Equestria - - Celeste - - - "> System - - - () - -
-
- -
- - - - - -
-
- -
- - -
- - -- cgit