From 31fed783e82dd065c71b234ba08ece596a081f05 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 17 Dec 2023 12:23:19 +0100 Subject: Updated 15 files and deleted 3 files (automated) --- pages/alerts.inc | 7 +- pages/api/emergency-real.php | 31 ++-- pages/api/emergency.php | 31 ++-- pages/api/pleasure-real.php | 23 ++- pages/api/pleasure.php | 23 ++- pages/docs.inc | 423 ------------------------------------------- pages/emergency.inc | 4 +- pages/money.inc | 4 + pages/pleasure.inc | 6 +- pages/wakeup.inc | 15 -- 10 files changed, 74 insertions(+), 493 deletions(-) delete mode 100644 pages/docs.inc delete mode 100644 pages/wakeup.inc (limited to 'pages') diff --git a/pages/alerts.inc b/pages/alerts.inc index ec6c988..46d514d 100644 --- a/pages/alerts.inc +++ b/pages/alerts.inc @@ -2,6 +2,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $_PROFILE; global $isLowerLoggedIn; +if ($_PROFILE["login"] === "cloudburst") die(); require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
@@ -24,11 +25,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?> }, 1000); - - -
Wake-up alert
-
- +
Pleasure alert
diff --git a/pages/api/emergency-real.php b/pages/api/emergency-real.php index a67f549..700a6a7 100644 --- a/pages/api/emergency-real.php +++ b/pages/api/emergency-real.php @@ -1,6 +1,7 @@ [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("鈿狅笍馃啒 EMERGENCY 鈿狅笍馃啒") . "\r\n" . - "Priority: urgent\r\n" . - "Tags: emergency\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!") - ] -])); +if (isset($_GET["raindrops"])) $channels[] = "emergency-raindrops"; +if (isset($_GET["moonglow"])) $channels[] = "emergency-moonglow"; +if (isset($_GET[$GLOBALS["ColdHazeApp"]["other"]["slug"]])) $channels[] = "emergency"; -file_get_contents('https://' . $ntfy["server"] . '/emergency', false, stream_context_create([ +$context = stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("鈿狅笍馃啒 EMERGENCY 鈿狅笍馃啒") . "\r\n" . + "Title: " . formatPonypush("鈿狅笍 Emergency alert") . "\r\n" . "Priority: urgent\r\n" . "Tags: emergency\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!") + 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of immediate help. Please act now!") ] -])); +]); + +foreach ($channels as $channel) { + file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context); +} die(); \ No newline at end of file diff --git a/pages/api/emergency.php b/pages/api/emergency.php index 24c975a..a8a6e20 100644 --- a/pages/api/emergency.php +++ b/pages/api/emergency.php @@ -1,6 +1,7 @@ [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("[Test] 鈿狅笍馃啒 EMERGENCY 鈿狅笍馃啒") . "\r\n" . - "Priority: urgent\r\n" . - "Tags: emergency\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]") - ] -])); +if (isset($_GET["raindrops"])) $channels[] = "emergency-raindrops"; +if (isset($_GET["moonglow"])) $channels[] = "emergency-moonglow"; +if (isset($_GET[$GLOBALS["ColdHazeApp"]["other"]["slug"]])) $channels[] = "emergency"; -file_get_contents('https://' . $ntfy["server"] . '/emergency', false, stream_context_create([ +$context = stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("[Test] 鈿狅笍馃啒 EMERGENCY 鈿狅笍馃啒") . "\r\n" . + "Title: " . formatPonypush("[Test] 鈿狅笍 Emergency alert") . "\r\n" . "Priority: urgent\r\n" . "Tags: emergency\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]") + 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of immediate help. Please act now! [This notification is test]") ] -])); +]); + +foreach ($channels as $channel) { + file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context); +} die(); \ No newline at end of file diff --git a/pages/api/pleasure-real.php b/pages/api/pleasure-real.php index b523c1a..adfe732 100644 --- a/pages/api/pleasure-real.php +++ b/pages/api/pleasure-real.php @@ -1,6 +1,7 @@ [ 'method' => 'POST', 'header' => @@ -31,8 +40,12 @@ file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_cont "Priority: high\r\n" . "Tags: pleasure\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("Hey, $pony wants to play and have fun for a bit, get up!") + 'content' => formatPonypush("Hey, $pony wants to play and have fun with you, get up!") ] -])); +]); + +foreach ($channels as $channel) { + file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context); +} die(); \ No newline at end of file diff --git a/pages/api/pleasure.php b/pages/api/pleasure.php index 58def71..7d331ce 100644 --- a/pages/api/pleasure.php +++ b/pages/api/pleasure.php @@ -1,6 +1,7 @@ [ 'method' => 'POST', 'header' => @@ -31,8 +40,12 @@ file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_cont "Priority: high\r\n" . "Tags: pleasure\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("[This is a test] Hey, $pony wants to play and have fun for a bit, get up!") + 'content' => formatPonypush("[This notification is a test] Hey, $pony wants to play and have fun with you, get up! [This notification is a test]") ] -])); +]); + +foreach ($channels as $channel) { + file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context); +} die(); \ No newline at end of file diff --git a/pages/docs.inc b/pages/docs.inc deleted file mode 100644 index 403a4f9..0000000 --- a/pages/docs.inc +++ /dev/null @@ -1,423 +0,0 @@ - "Untitled document ($id)", - "category" => null, - "contents" => "This is a new document you just created.", - "last" => [ - "author" => $_PROFILE["login"], - "date" => time() - ] - ])); - - header("Location: /-/docs/$id"); - die(); -} elseif (isset($select)) { - 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 . " 路 Ponycule"; - $title = $data["name"] . " 路 " . $title; - } else { - header("Location: /-/docs"); - die(); - } -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; - -function showDocument($item) { ?> -
- - - - NSFW - - - - Deleting in hours - - - "> - - -
- - -
-
-
-
-

- - Back -

-

Category:

-

- - Last modified never - - Last modified "> - - by - - - 路 Saved -

- - = 0 && $data["last"]["author"] !== $_PROFILE["login"]): ?> -
- This document is currently in use by . It has been open in read-only to prevent conflicts with the changes they make. If they stopped editing the document, it will become editable for you after you refresh the page in minute 1 ? "s" : "" ?>. -
- - - - - - - - - - -
-

Documents

-
- substr($i, 0, -5), - ...(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $i), true) ?? []) - ]; - }, array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs"), function ($i) { - return !str_starts_with($i, ".") && str_ends_with($i, ".json"); - })); - - $deletable = array_values(array_filter($documents, function ($i) { - return str_starts_with(strip_tags($i["contents"]), "/delete"); - })); - $unsorted_pre = array_values(array_filter($documents, function ($i) { - return !str_starts_with(strip_tags($i["contents"]), "/delete"); - })); - - $categoryFirst = []; - $unsorted = []; - $categories = []; - foreach ($unsorted_pre as $item) { - if (isset($item["category"])) { - $existing_categories = [...array_keys($categories), ...array_keys($categoryFirst)]; - $matched_category = null; - - foreach ($existing_categories as $existing_category) { - if (levenshtein($item["category"], $existing_category) < 3) { - $matched_category = $existing_category; - } - } - - $selected_category = $matched_category ?? $item["category"]; - - if (str_starts_with($item["category"], ".")) { - if (!isset($categoryFirst[$selected_category])) $categoryFirst[$selected_category] = []; - $categoryFirst[$selected_category][] = $item; - } else { - if (!isset($categories[$selected_category])) $categories[$selected_category] = []; - $categories[$selected_category][] = $item; - } - } else { - $unsorted[] = $item; - } - } - - foreach ($categories as $category => $_) { - uasort($categories[$category], function ($a, $b) { - return preg_replace("/[^a-z\d]/m", "", strtolower($b["name"])) < preg_replace("/[^a-z\d]/m", "", strtolower($a["name"])); - }); - } - - foreach ($categoryFirst as $category => $_) { - uasort($categoryFirst[$category], function ($a, $b) { - return preg_replace("/[^a-z\d]/m", "", strtolower($b["name"])) < preg_replace("/[^a-z\d]/m", "", strtolower($a["name"])); - }); - } - - uasort($unsorted, function ($a, $b) { - return preg_replace("/[^a-z\d]/m", "", strtolower($b["name"])) < preg_replace("/[^a-z\d]/m", "", strtolower($a["name"])); - }); - - uasort($deletable, function ($a, $b) { - return preg_replace("/[^a-z\d]/m", "", strtolower($b["name"])) < preg_replace("/[^a-z\d]/m", "", strtolower($a["name"])); - }); - - $fullList = [...$categoryFirst, ...$categories]; - - ?> - - $items): if ($category != "Archives"): ?> -

-
- - -

Unsorted

- -
-
- Show archives and marked for deletion - -

Archives

- - -
-

Marked for deletion

-
-
- -
- - -
-
- - - - - diff --git a/pages/emergency.inc b/pages/emergency.inc index 244571b..e51b410 100644 --- a/pages/emergency.inc +++ b/pages/emergency.inc @@ -1,6 +1,8 @@ diff --git a/pages/money.inc b/pages/money.inc index d1651bc..881c618 100644 --- a/pages/money.inc +++ b/pages/money.inc @@ -241,6 +241,10 @@ function getMonthlyEarnings(): array {

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. +
+
- -
-
-
- -
-
- - -- cgit