From 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 23 Feb 2023 19:34:56 +0100 Subject: Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated) --- pages/actions.inc | 1119 ----------------------------------- pages/api.inc | 4 +- pages/api/cloudburst-img-round.php | 94 +++ pages/api/cloudburst-img.php | 11 + pages/api/cloudburst-img2-round.php | 94 +++ pages/api/cloudburst-two.php | 8 + pages/api/cloudburst.php | 6 + pages/api/computer.php | 50 ++ pages/api/data.php | 12 + pages/api/docs.php | 29 + pages/api/emergency-real.php | 22 + pages/api/emergency.php | 22 + pages/api/fronter.php | 113 ++++ pages/api/pluralkit-integration.php | 176 ++++++ pages/api/raindrops-img-round.php | 94 +++ pages/api/raindrops-img.php | 11 + pages/api/raindrops-img2-round.php | 94 +++ pages/api/raindrops-two.php | 8 + pages/api/raindrops.php | 6 + pages/api/save-private.php | 35 ++ pages/api/save.php | 37 ++ pages/api/token.php | 7 + pages/api/wakeup-real.php | 28 + pages/api/wakeup.php | 28 + pages/app.inc | 3 - pages/byfront.inc | 2 +- pages/dashboard.inc | 231 -------- pages/demo.inc | 4 - pages/disclaimers.inc | 15 - pages/docs.inc | 2 +- pages/edit-private.inc | 36 +- pages/edit.inc | 34 +- pages/front.inc | 4 +- pages/government.inc | 142 ----- pages/home.inc | 22 +- pages/login.inc | 5 +- pages/metadata.inc | 40 +- pages/nicknames.inc | 115 ---- pages/page.inc | 8 +- pages/parser.inc | 4 - pages/pleasure.inc | 16 - pages/prefix.inc | 4 - pages/relations.inc | 8 +- pages/rules-old.inc | 4 - pages/score.inc | 208 ------- pages/terminology.inc | 2 +- pages/thinkpad.inc | 50 -- pages/together-dev.inc | 4 - pages/together.inc | 940 ----------------------------- pages/toys.inc | 905 ---------------------------- pages/travelling.inc | 2 +- 51 files changed, 1034 insertions(+), 3884 deletions(-) delete mode 100644 pages/actions.inc create mode 100644 pages/api/cloudburst-img-round.php create mode 100644 pages/api/cloudburst-img.php create mode 100644 pages/api/cloudburst-img2-round.php create mode 100644 pages/api/cloudburst-two.php create mode 100644 pages/api/cloudburst.php create mode 100644 pages/api/computer.php create mode 100644 pages/api/data.php create mode 100644 pages/api/docs.php create mode 100644 pages/api/emergency-real.php create mode 100644 pages/api/emergency.php create mode 100644 pages/api/fronter.php create mode 100644 pages/api/pluralkit-integration.php create mode 100644 pages/api/raindrops-img-round.php create mode 100644 pages/api/raindrops-img.php create mode 100644 pages/api/raindrops-img2-round.php create mode 100644 pages/api/raindrops-two.php create mode 100644 pages/api/raindrops.php create mode 100644 pages/api/save-private.php create mode 100644 pages/api/save.php create mode 100644 pages/api/token.php create mode 100644 pages/api/wakeup-real.php create mode 100644 pages/api/wakeup.php delete mode 100644 pages/app.inc delete mode 100644 pages/dashboard.inc delete mode 100644 pages/demo.inc delete mode 100644 pages/disclaimers.inc delete mode 100644 pages/government.inc delete mode 100644 pages/nicknames.inc delete mode 100644 pages/parser.inc delete mode 100644 pages/pleasure.inc delete mode 100644 pages/prefix.inc delete mode 100644 pages/rules-old.inc delete mode 100644 pages/score.inc delete mode 100644 pages/thinkpad.inc delete mode 100644 pages/together-dev.inc delete mode 100644 pages/together.inc delete mode 100644 pages/toys.inc (limited to 'pages') diff --git a/pages/actions.inc b/pages/actions.inc deleted file mode 100644 index 630626a..0000000 --- a/pages/actions.inc +++ /dev/null @@ -1,1119 +0,0 @@ - $item) { - if ($item["id"] === $id) { - $selectedIndex = $index; - $selected = $item; - break; - } - } - - if ($selected === null) { - header("Location: /-/actions"); - die(); - } - - unset($data[$selectedIndex]); - @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/" . date('Y-m-d_H-i-s') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json", utf8_encode(json_encode($data))); - header("Location: /-/actions/?d&id=" . $id); - die(); -} - -if (isset($_POST['updateAction'])) { - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); - - $selected = null; - $selectedIndex = -1; - $id = $_POST['action']; - - foreach ($data as $index => $item) { - if ($item["id"] === $id) { - $selectedIndex = $index; - $selected = $item; - break; - } - } - - if ($selected === null) { - header("Location: /-/actions"); - die(); - } - - if (isset($_POST["consent"])) { - $selected["consent"] = true; - } else { - $selected["consent"] = false; - } - - if (isset($_POST["name"])) $selected["name"] = strip_tags(trim($_POST["name"])); - if (isset($_POST["example"])) $selected["example"] = strip_tags(trim($_POST["example"])); - if (isset($_POST["irl"])) $selected["irl"] = strip_tags(trim($_POST["irl"])); - if (isset($_POST["keywords"])) $selected["keywords"] = array_map(function ($i) { - return trim($i); - }, explode(",", strip_tags(trim($_POST["keywords"])))); - if (isset($_POST["description"])) $selected["description"] = strip_tags(trim($_POST["description"])); - if (isset($_POST["type"])) $selected["type"] = match ($_POST["type"]) { - "0" => "affectionate", - "1" => "sexual", - "2" => "mixed" - }; - - if (isset($_POST["relations"])) { - $ponies = []; - - foreach ($_POST["relations"] as $relation => $d) { - $ponies[] = [ - "members" => explode("-", $relation), - "deprecated" => isset($d["deprecated"]), - "sexual" => isset($d["sexual"]) - ]; - } - - $selected["ponies"] = $ponies; - } - - global $_PROFILE; - if ($_PROFILE['login'] === "raindrops" && isset($_POST["verified"])) { - $selected["verified"] = true; - } else { - unset($selected["verified"]); - } - - if (isset($_POST["untested"])) { - $selected["untested"] = true; - } else { - unset($selected["untested"]); - } - - $data[$selectedIndex] = $selected; - @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/" . date('Y-m-d_H-i-s') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json", utf8_encode(json_encode($data))); - - header("Location: /-/actions/" . $id); - die(); -} - -if (isset($_POST['createAction'])) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.inc"; - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); - - if (!isset($_POST["name"]) || !isset($_POST["type"])) { - header("Location: /-/actions"); - die(); - } - if (trim($_POST["name"]) === "" || !is_numeric($_POST["type"])) { - header("Location: /-/actions"); - die(); - } - - $type = match ($_POST["type"]) { - "0" => "affectionate", - "1" => "sexual", - "2" => "mixed" - }; - $name = strip_tags(trim($_POST["name"])); - $id = random(); - - $ponies = []; - - if (isset($_POST["relations"])) { - foreach ($_POST["relations"] as $relation => $_) { - $ponies[] = [ - "members" => explode("-", $relation), - "deprecated" => false, - "sexual" => false - ]; - } - } - - if (isset($_POST["consent"])) { - $consent = true; - } else { - $consent = false; - } - - $data[] = [ - "id" => $id, - "name" => $name, - "type" => $type, - "description" => null, - "ponies" => $ponies, - "example" => null, - "irl" => null, - "keywords" => [], - "consent" => $consent - ]; - - @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/" . date('Y-m-d_H-i-s') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json", utf8_encode(json_encode($data))); - header("Location: /-/actions/" . $id); - die(); -} - -global $pagename; -$parts = explode("/", $pagename); -$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); -$toys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); - -$selected = null; - -if (isset($parts[1])) { - $id = $parts[1]; - - foreach ($data as $item) { - if ($item["id"] === $id) { - $selected = $item; - break; - } - } - - if ($selected === null) { - header("Location: /-/actions/?nf&id=" . $id); - die(); - } else { - $title = $selected["name"] . " · " . $title; - } -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/keywords.inc'; - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json", "[]"); - -global $_PROFILE; -global $pagename; -$parts = explode("/", $pagename); - -?> - - - -
-
-
"> - -
- - Error: The requested action () was not found, it may have been deleted or has never existed. -
- - - -
- - Success: The action with ID has been successfully deleted. -
- - - - -

- - Back -

-

- Edit · - - Affectionate - - - Sexual - - - Affectionate Sexual - - Unverified - Untested -

- -
- -
- This action requires consent. Since this action constitues a sexual act, verbal consent from both parties is absolutely required. Both parties must be in a mental state where they are able to consent. Furthermore, if one of the parties involved wishes to stop, the request must be immediately honoured. -
- -
- This action is better with consent. This action is extremely personal to all parties involved, and it is best to ask if they wish to do this. If they ask to stop the action, you must stop immediately and reverse any potential effects. -
- - - - ", strip_tags($selected["description"]))); ?> - -

No description provided for this action. Enter edit mode to add a description to this action.

- - - -
-

Available toys:

- - - - - -
- - 1; ?> - Example:
- - -
    - -
  • - -
- - - - -

No example provided for this action. Enter edit mode to add an example to this action.

- - -
- - Steps to reproduce in real life:
- - - -

This action is not reproducible in real life.

- - -
- -

Similar actions

-
- $action["id"], - "type" => $action["type"], - "ponies" => $action["ponies"] - ]; - } - - foreach ($names as $name => $data) { - if ($data["type"] === $selected["type"] || $selected["type"] !== "affectionate") { - $namesByDistance[] = [ - "name" => $name, - "distance" => levenshtein($currentName, $name) + ((int)($data["type"] !== $selected["type"]) * 2), - "id" => $data["id"], - "type" => $data["type"], - "ponies" => $data["ponies"] - ]; - } - } - - uasort($namesByDistance, function ($a, $b) use ($selected) { - return $a["distance"] - $b["distance"]; - }); - - foreach ($namesByDistance as $item) { - echo(""); - } - - $index = 0; - foreach ($namesByDistance as $item): if ($index < 3): - ?> - - -
- - - - - -

Actions database

-

actions ( affectionate, sexual, untested, incomplete)

- -

TODO: fill everything and add keywords

- - - - - -
- -
-
-

Not finding what you are looking for? Create an action.

-
- - - - - - -
-
- - - - - - - diff --git a/pages/api.inc b/pages/api.inc index 1d83985..f71ac10 100644 --- a/pages/api.inc +++ b/pages/api.inc @@ -8,8 +8,8 @@ if (str_ends_with($_GET['_'], "/")) { $toplevel = explode("/", $pagename)[1]; -if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/api/" . $toplevel . ".php")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/api/" . $toplevel . ".php"; +if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/api/" . $toplevel . ".php")) { + require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/api/" . $toplevel . ".php"; } else { header("HTTP/1.1 500 Internal Server Error"); echo("Endpoint not found"); diff --git a/pages/api/cloudburst-img-round.php b/pages/api/cloudburst-img-round.php new file mode 100644 index 0000000..6400499 --- /dev/null +++ b/pages/api/cloudburst-img-round.php @@ -0,0 +1,94 @@ + count($fronters["members"]) > 1 +])); \ No newline at end of file diff --git a/pages/api/cloudburst.php b/pages/api/cloudburst.php new file mode 100644 index 0000000..2750a98 --- /dev/null +++ b/pages/api/cloudburst.php @@ -0,0 +1,6 @@ + [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: ⚠️🆘 EMERGENCY ⚠️🆘\r\n" . + "Priority: urgent\r\n" . + "Tags: emergency\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!" + ] +])); + +die(); \ No newline at end of file diff --git a/pages/api/emergency.php b/pages/api/emergency.php new file mode 100644 index 0000000..e0726e7 --- /dev/null +++ b/pages/api/emergency.php @@ -0,0 +1,22 @@ + [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: [Test] ⚠️🆘 EMERGENCY ⚠️🆘\r\n" . + "Priority: urgent\r\n" . + "Tags: emergency\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]" + ] +])); + +die(); \ No newline at end of file diff --git a/pages/api/fronter.php b/pages/api/fronter.php new file mode 100644 index 0000000..51ee4ee --- /dev/null +++ b/pages/api/fronter.php @@ -0,0 +1,113 @@ + -1 ? $index - 1 : $index); + + break; + + default: + peh_error("Invalid type name", 400); + break; +} + +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/$system.json", json_encode($list)); + +die(); \ No newline at end of file diff --git a/pages/api/pluralkit-integration.php b/pages/api/pluralkit-integration.php new file mode 100644 index 0000000..0793873 --- /dev/null +++ b/pages/api/pluralkit-integration.php @@ -0,0 +1,176 @@ + [ + 'method' => 'GET', + 'header' => + "Authorization: " . $app["other"]["token"] . "\r\n" + ] + ])); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches"), false, stream_context_create([ + 'http' => [ + 'method' => 'GET', + 'header' => + "Authorization: " . $app["other"]["token"] . "\r\n" + ] + ])); + } else { + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/fronters")); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches")); + } + + $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true); + $currentFronter = $fronters["members"][0]["id"]; + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/last.json", json_encode($currentFronter)); + + $ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"]; + + if (count($fronters["members"]) > 0 && ($system !== $app["other"]["id"] || !isset($app["other"]))) { + foreach ($fronters["members"] as $member) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member["id"] . ".json")) { + $metadata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member["id"] . ".json"), true); + + if (!isset($metadata["birth"])) { + showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); + } else if (isset($metadata['birth']["age"]) && $metadata["birth"]["age"] === 0 && (!isset($metadata['birth']["year"]) || $metadata["birth"]["year"] < 1900)) { + showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); + } else if (isset($metadata['birth']["year"]) && $metadata["birth"]["year"] < 1900) { + showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); + } else if (!isset($metadata['birth']["year"]) && !isset($metadata['birth']["age"])) { + showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); + } + } + } + } + + if ($system !== $app["other"]["id"] || !isset($app["other"])) { + if (count($fronters["members"]) > 1) { + $context = stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 Switch occurred in the $name\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Open " . $fronters["members"][0]["display_name"] . " on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true;view, Open " . $fronters["members"][1]["display_name"] . " on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][1]["name"] . "/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " and " . ($fronters["members"][1]["display_name"] ?? $fronters["members"][1]["name"]) . " switched in just now" + ] + ]); + } else if (count($fronters["members"]) > 0) { + $context = stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 Switch occurred in the $name\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Open on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " switched in just now" + ] + ]); + } else { + $context = stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 Switch occurred in the $name\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Open on Cold Haze, https://ponies.equestria.horse/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "The fallback pony switched in just now" + ] + ]); + } + + file_get_contents('https://' . $ntfy["server"] . '/public-switches', false, $context); + } + + if ($system === "gdapd") { + $topic = "public-switches-raindrops"; + + if (count($fronters["members"]) > 0) { + file_get_contents('https://' . $ntfy["server"] . '/public-switches-fr', false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 $name vient de switch\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Voir sur Cold Haze, https://fr.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " est désormais au front" + ] + ])); + } else { + file_get_contents('https://' . $ntfy["server"] . '/public-switches-fr', false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 $name vient de switch\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Voir sur Cold Haze, https://fr.equestria.horse/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "Le poney de trait est désormais au front" + ] + ])); + } + } else if ($system === "ynmuc") { + $topic = "public-switches-cloudburst"; + } else { + $topic = "main"; + } + + file_get_contents('https://' . $ntfy["server"] . '/' . $topic, false, $context); +} \ No newline at end of file diff --git a/pages/api/raindrops-img-round.php b/pages/api/raindrops-img-round.php new file mode 100644 index 0000000..f733cc8 --- /dev/null +++ b/pages/api/raindrops-img-round.php @@ -0,0 +1,94 @@ + count($fronters["members"]) > 1 +])); \ No newline at end of file diff --git a/pages/api/raindrops.php b/pages/api/raindrops.php new file mode 100644 index 0000000..c44faa6 --- /dev/null +++ b/pages/api/raindrops.php @@ -0,0 +1,6 @@ + [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🥱 Wake up!\r\n" . + "Priority: high\r\n" . + "Tags: wakeup\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "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 new file mode 100644 index 0000000..69b0a68 --- /dev/null +++ b/pages/api/wakeup.php @@ -0,0 +1,28 @@ + [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: [Test] 🥱 Wake up!\r\n" . + "Priority: high\r\n" . + "Tags: wakeup\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "[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/app.inc b/pages/app.inc deleted file mode 100644 index ceed71e..0000000 --- a/pages/app.inc +++ /dev/null @@ -1,3 +0,0 @@ - Travelling - + Must front diff --git a/pages/dashboard.inc b/pages/dashboard.inc deleted file mode 100644 index 08e063b..0000000 --- a/pages/dashboard.inc +++ /dev/null @@ -1,231 +0,0 @@ - - -
-
-
-

Date

- - -
-

Next fronters (edit)

- - -
Fronters today
-
    - $id): $member = getMemberWithoutSystem($id[0]); ?> -
  • - - Merged members - - " style="height: 24px; vertical-align: middle;"> - - - and " style="height: 24px; vertical-align: middle;"> - - with " style="height: 24px; vertical-align: middle;"> - and " style="height: 24px; vertical-align: middle;"> - -
  • - -
- -
Fronters tomorrow
-
    - $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id[0]); ?> -
  • - - Merged members - - " style="height: 24px; vertical-align: middle;"> - - - and " style="height: 24px; vertical-align: middle;"> - - with " style="height: 24px; vertical-align: middle;"> - and " style="height: 24px; vertical-align: middle;"> - -
  • - -
- -
Fronters on
-
    - $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id[0]); ?> -
  • - - Merged members - - " style="height: 24px; vertical-align: middle;"> - - - and " style="height: 24px; vertical-align: middle;"> - - with " style="height: 24px; vertical-align: middle;"> - and " style="height: 24px; vertical-align: middle;"> - -
  • - -
- -
-

Next events

- parseFile($_SERVER['DOCUMENT_ROOT'] . "/includes/data/calendar/calendar.ics"); - $events = []; - - foreach ($cal->getEvents()->sorted() as $event) { - $events[] = [ - "id" => $event['UID'], - "date" => [ - "created" => $event['CREATED']->format('c'), - "modified" => $event['LAST-MODIFIED']->format('c'), - "start" => $event['DTSTART']->format('c'), - "end" => $event['DTEND']->format('c'), - "duration" => strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')), - "full_day" => strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')) >= 86400, - "days" => ( - strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')) >= 86400 ? - round((strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c'))) / 86400) : - null - ) - ], - "name" => $event['SUMMARY'], - "description" => $event['DESCRIPTION'] ?? "", - ]; - } - - $events = array_values(array_filter($events, function ($i) { - return ( - strtotime($i["date"]["end"]) > time() && - strtotime($i["date"]["start"]) < time() + 2629800 - ); - })); - - ?> -
    - -
  • - - - - Started , ends - - - - · - - - - - · - - - for - · - -
  • - -
-
-
- - diff --git a/pages/demo.inc b/pages/demo.inc deleted file mode 100644 index 47e0775..0000000 --- a/pages/demo.inc +++ /dev/null @@ -1,4 +0,0 @@ - - -
-
-
- -
-
- - diff --git a/pages/docs.inc b/pages/docs.inc index 5e0ac65..3b212df 100644 --- a/pages/docs.inc +++ b/pages/docs.inc @@ -11,7 +11,7 @@ if ($select === "add") { file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $id . ".json", json_encode([ "name" => "Untitled document ($id)", "category" => null, - "contents" => "
This is a new document you just created.
", + "contents" => "This is a new document you just created.", "last" => [ "author" => $_PROFILE["login"], "date" => time() diff --git a/pages/edit-private.inc b/pages/edit-private.inc index 9564f7a..4d89b5c 100644 --- a/pages/edit-private.inc +++ b/pages/edit-private.inc @@ -1,21 +1,8 @@ - -
-
-
-

- - -

" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#222; padding: 10px; margin-top: 15px;"> - -
- " style="color: white !important; text-decoration: none;">
- ">
- -
- " style="color: white !important; text-decoration: none;">
- ">
- -
-
-
-
-
-

- - Cloudburst System -

-
-

" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#023100; padding: 10px;"> - - -
-

" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#002d31; padding: 10px;"> - - -
-
-
-
-
-

- - Raindrops System -

-
-

" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#023100; padding: 10px;"> - - -
-

" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#002d31; padding: 10px;"> - - -
-
-
-
-
-

" data-bs-toggle="tooltip" data-bs-html="true" style="margin-top: 15px;"> - -
-
-

" data-bs-toggle="tooltip" data-bs-html="true" style="margin-top: 15px;"> - -
-
-
-
- - - - diff --git a/pages/home.inc b/pages/home.inc index 4dd838e..d206100 100644 --- a/pages/home.inc +++ b/pages/home.inc @@ -1,11 +1,17 @@ - +
- +
- +
@@ -17,16 +23,16 @@
- 2.png" style="width:128px;"> -

+ .png" style="width:128px;"> +


" data-bs-toggle="tooltip" style="overflow: hidden;" href="/">" style="height:32px;position:absolute;z-index:99;">

- ;z-index: 9;margin-left: 8px;opacity: .75;"> + ;z-index: 9;margin-left: 8px;opacity: .75;">
-
+

Cold Haze

poneys dans une tête

@@ -55,7 +61,7 @@
- + diff --git a/pages/login.inc b/pages/login.inc index cfe363c..8d71574 100644 --- a/pages/login.inc +++ b/pages/login.inc @@ -16,7 +16,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnl
- You are already logged in. If you want to login to a different account or using a different authentication method, you may do so now. + You are already logged in. If you want to log into a different account or using a different authentication method, you may do so now.

Cold Haze.

@@ -24,10 +24,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnl
-

- +
diff --git a/pages/metadata.inc b/pages/metadata.inc index 0a987f3..db5589d 100644 --- a/pages/metadata.inc +++ b/pages/metadata.inc @@ -1,23 +1,10 @@ $i - ]; - $r["type"] = "marefriends"; - return $r; - }, $member["_metadata"]["marefriends"] ?? []), - ...array_map(function ($i) { - $r = [ - "name" => $i - ]; - $r["type"] = "sisters"; - return $r; - }, $member["_metadata"]["sisters"] ?? []), - ...array_map(function ($i) { - $r = [ - "name" => $i - ]; - $r["type"] = "caretaking"; - return $r; - }, $member["_metadata"]["caretakers"] ?? []) - ] as $rel) { - $id = $rel["name"]; - $otherMember = getSystemMember(explode("/", $id)[0], explode("/", $id)[1]); - - $parts = [ - $member["id"], - $otherMember["id"] - ]; - - asort($parts); - - $relations[implode("-", $parts)] = [ - "id" => implode("", $parts), - "name" => getMiniName($member["display_name"] ?? $member["name"]) . " and " . getMiniName($otherMember["display_name"] ?? $otherMember["name"]), - "type" => $rel["type"], - "images" => [ - getAsset($member['system'], $member["id"], "heads"), - getAsset($otherMember['system'], $otherMember["id"], "heads") - ] - ]; - } -} - -$nicknames = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/nicknames/nicknames.json"), true); - -?> - -
- - - - - diff --git a/pages/page.inc b/pages/page.inc index 3bdeb2e..7fe039c 100644 --- a/pages/page.inc +++ b/pages/page.inc @@ -5,7 +5,7 @@ global $lang; global $pages; global $isLoggedIn; global $isLowerLoggedIn; $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); -if (!isset($_GET['_']) || trim($_GET['_']) === "") header("Location: /?error=Invalid request") and die(); +if (!isset($_GET['_']) || trim($_GET['_']) === "") peh_error("Invalid request", 400); $parts = explode("/", $_GET['_']); @@ -42,7 +42,7 @@ if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== $a $system = $parts[0]; $member = (isset($parts[1]) ? $parts[1] : null) === "" ? null : (isset($parts[1]) ? $parts[1] : null); -if ($system !== "cloudburst" && $system !== "raindrops" && ($system !== $app["other"]["slug"] && !$isLowerLoggedIn && !$isLoggedIn)) header("Location: /?error=" . $lang["page"]["system"]) and die(); +if ($system !== "cloudburst" && $system !== "raindrops" && ($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"] : "Raindrops System"); $systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["id"] : "gdapd"); @@ -58,7 +58,7 @@ if ($member === null) { $pageFile = $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc'; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc'; } else { - header("Location: /?error=" . $lang["page"]["system"] . " " . $parts[2]) and die(); + peh_error("System page not found: " . strip_tags($parts[2]), 404); } } else { $memberFoundInAnotherSystem = false; @@ -105,7 +105,7 @@ if ($member === null) { $pageFile = $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.inc'; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.inc'; } else { - header("Location: /?error=" . $lang["page"]["system"] . " " . $parts[3]) and die(); + peh_error("Member page not found: " . strip_tags($parts[3]), 404); } die(); } diff --git a/pages/parser.inc b/pages/parser.inc deleted file mode 100644 index 47e0775..0000000 --- a/pages/parser.inc +++ /dev/null @@ -1,4 +0,0 @@ - - -
-
-
- -
-
- - diff --git a/pages/prefix.inc b/pages/prefix.inc deleted file mode 100644 index 47e0775..0000000 --- a/pages/prefix.inc +++ /dev/null @@ -1,4 +0,0 @@ -

- +
"> " style="width:24px;"> diff --git a/pages/rules-old.inc b/pages/rules-old.inc deleted file mode 100644 index a567bc5..0000000 --- a/pages/rules-old.inc +++ /dev/null @@ -1,4 +0,0 @@ - - -
-
-
-

Score system testing

- -

Raindrops System ()

-
- - -

Cloudburst System ()

-
    - $name, - "page" => "/" . $member["name"], - "score" => $score["total"], - "details" => $score - ]; - } - } - - uasort($scores, function($a, $b) { - return $b["score"] - $a["score"]; - }); - - ?> - - -
  • -
    - "> () -
    -
    -
  • - -
- -

Global ()

-
    - $name, - "page" => "/" . $member["name"], - "score" => $score["total"], - "details" => $score - ]; - } - } - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = [ - "name" => $name, - "page" => "/" . $member["name"], - "score" => $score["total"], - "details" => $score - ]; - } - } - - uasort($scores, function($a, $b) { - return $b["score"] - $a["score"]; - }); - - ?> - - -
  • -
    - "> () -
    -
    -
  • - -
-
-
- - diff --git a/pages/terminology.inc b/pages/terminology.inc index ec810eb..d94eddc 100644 --- a/pages/terminology.inc +++ b/pages/terminology.inc @@ -8,7 +8,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
- +
diff --git a/pages/thinkpad.inc b/pages/thinkpad.inc deleted file mode 100644 index af1bcfa..0000000 --- a/pages/thinkpad.inc +++ /dev/null @@ -1,50 +0,0 @@ - - -
-
-
-

ThinkPad

- - -
Error:
- - -
Success:
- - -
- -

- -
-
-
- - diff --git a/pages/together-dev.inc b/pages/together-dev.inc deleted file mode 100644 index 6ea9704..0000000 --- a/pages/together-dev.inc +++ /dev/null @@ -1,4 +0,0 @@ - - - - - - - - - - - - - -
-
- -
- - -
- -
- Notification. -
-Skip -
-
-
- -
-
-
-
-
-
-
-
-
- -0:00 -
- - - -
-
- -
- \ No newline at end of file diff --git a/pages/toys.inc b/pages/toys.inc deleted file mode 100644 index 4c172c6..0000000 --- a/pages/toys.inc +++ /dev/null @@ -1,905 +0,0 @@ - $item) { - if ($item["id"] === $id) { - $selectedIndex = $index; - $selected = $item; - break; - } - } - - if ($selected === null) { - header("Location: /-/toys"); - die(); - } - - unset($data[$selectedIndex]); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json", utf8_encode(json_encode($data))); - header("Location: /-/toys/?d&id=" . $id); - die(); -} - -if (isset($_POST['updateAction'])) { - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); - - $selected = null; - $selectedIndex = -1; - $id = $_POST['action']; - - foreach ($data as $index => $item) { - if ($item["id"] === $id) { - $selectedIndex = $index; - $selected = $item; - break; - } - } - - if ($selected === null) { - header("Location: /-/toys"); - die(); - } - - if (isset($_POST["sexual"])) { - $selected["sexual"] = true; - } else { - $selected["sexual"] = false; - } - - if (isset($_POST["name"])) $selected["name"] = strip_tags(trim($_POST["name"])); - if (isset($_POST["usage"])) $selected["usage"] = strip_tags(trim($_POST["usage"])); - if (isset($_POST["irl"])) $selected["irl"] = strip_tags(trim($_POST["irl"])); - if (isset($_POST["keywords"])) $selected["keywords"] = array_map(function ($i) { - return trim($i); - }, explode(",", strip_tags(trim($_POST["keywords"])))); - if (isset($_POST["description"])) $selected["description"] = strip_tags(trim($_POST["description"])); - if (isset($_POST["water"])) $selected["water"] = match ($_POST["water"]) { - "0" => "out", - "1" => "in", - "2" => "both", - "3" => "playground" - }; - - if (isset($_POST["relations"])) { - $ponies = []; - - foreach ($_POST["relations"] as $relation => $d) { - $ponies[] = [ - "members" => explode("-", $relation), - "deprecated" => isset($d["deprecated"]), - "sexual" => isset($d["sexual"]) - ]; - } - - $selected["ponies"] = $ponies; - } - - global $_PROFILE; - if ($_PROFILE['login'] === "raindrops" && isset($_POST["verified"])) { - $selected["verified"] = true; - } else { - unset($selected["verified"]); - } - - if (isset($_POST["untested"])) { - $selected["untested"] = true; - } else { - unset($selected["untested"]); - } - - $data[$selectedIndex] = $selected; - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json", utf8_encode(json_encode($data))); - - header("Location: /-/toys/" . $id); - die(); -} - -if (isset($_POST['createAction'])) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.inc"; - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); - - if (!isset($_POST["name"]) || !isset($_POST["water"])) { - header("Location: /-/toys"); - die(); - } - if (trim($_POST["name"]) === "" || !is_numeric($_POST["water"])) { - header("Location: /-/toys"); - die(); - } - - $water = match ($_POST["water"]) { - "0" => "out", - "1" => "in", - "2" => "both", - "3" => "playground" - }; - $name = strip_tags(trim($_POST["name"])); - $id = random(); - - $ponies = []; - - if (isset($_POST["relations"])) { - foreach ($_POST["relations"] as $relation => $_) { - $ponies[] = [ - "members" => explode("-", $relation), - "deprecated" => false - ]; - } - } - - if (isset($_POST["sexual"])) { - $sexual = true; - } else { - $sexual = false; - } - - $data[] = [ - "id" => $id, - "name" => $name, - "water" => $water, - "description" => null, - "ponies" => $ponies, - "usage" => null, - "irl" => null, - "keywords" => [], - "sexual" => $sexual - ]; - - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json", utf8_encode(json_encode($data))); - header("Location: /-/toys/" . $id); - die(); -} - -global $pagename; -$parts = explode("/", $pagename); -$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); - -$selected = null; - -if (isset($parts[1])) { - $id = $parts[1]; - - foreach ($data as $item) { - if ($item["id"] === $id) { - $selected = $item; - break; - } - } - - if ($selected === null) { - header("Location: /-/toys/?nf&id=" . $id); - die(); - } else { - $title = $selected["name"] . " · " . $title; - } -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/keywords.inc'; - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json", "[]"); - -global $_PROFILE; -global $pagename; -$parts = explode("/", $pagename); - -?> - - - -
-
-
"> - -
- - Error: The requested toy () was not found, it may have been deleted or has never existed. -
- - - -
- - Success: The toy with ID has been successfully deleted. -
- - - - -

- - Back -

-

- Edit · - - Sexual - - Pleasurable - - Unverified - Untested - - Underwater - - Outside of water - - In playground - - Underwater - Outside of water - -

- - - ", strip_tags($selected["description"]))); ?> - -

No description provided for this toy. Enter edit mode to add a description to this toy.

- - -
- - -
- - Usage:
- - 1) echo("
    "); - - foreach ($lines as $line) { - if (count($lines) > 1) echo("
  • "); - - $parts = explode(":", $line); - - if (count($parts) > 1 && strlen($parts[0]) < 30) { - $p0 = $parts[0]; array_shift($parts); - echo(replaceKeyWords("" . $p0 . ":" . implode(":", $parts))); - } else { - echo(replaceKeyWords(implode(":", $parts))); - } - - if (count($lines) > 1) echo("
  • "); - } - - if (count($lines) > 1) echo("
"); - - ?> - -

No usage provided for this toy. Enter edit mode to add usage information to this toy.

- - -
- - Instructions to craft in real life:
- - - -

This toy is not craftable in real life.

- - -
- -

Similar toys

-
- $action["id"], - "water" => $action["water"], - "ponies" => $action["ponies"], - "sexual" => $action["sexual"] - ]; - } - - foreach ($names as $name => $data) { - $namesByDistance[] = [ - "name" => $name, - "distance" => levenshtein($currentName, $name) + ((int)($data["water"] !== $selected["water"]) * 2), - "id" => $data["id"], - "water" => $data["water"], - "ponies" => $data["ponies"], - "sexual" => $data["sexual"] - ]; - } - - uasort($namesByDistance, function ($a, $b) use ($selected) { - return $a["distance"] - $b["distance"]; - }); - - foreach ($namesByDistance as $item) { - echo(""); - } - - $index = 0; - foreach ($namesByDistance as $item): if ($index < 3): - ?> - - -
- - - - - -

Toys database

-

toys ( non-sexual, sexual, untested, incomplete)

- - - - - -
- -
-
-

Not finding what you are looking for? Add a toy.

-
- - - - - - -
-
- - - - - - - diff --git a/pages/travelling.inc b/pages/travelling.inc index 46b1a7f..2064ce1 100644 --- a/pages/travelling.inc +++ b/pages/travelling.inc @@ -141,7 +141,7 @@ global $travelling; Equestria - ">.png"> System + "> System () -- cgit