From 108525534c28013cfe1897c30e4565f9893f3766 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 10 Oct 2022 20:51:39 +0200 Subject: Update --- pages/about.inc | 96 ++++ pages/actions.inc | 1116 +++++++++++++++++++++++++++++++++++++++++++++++ pages/actions.php | 1130 ------------------------------------------------ pages/alphabet.inc | 38 ++ pages/alphabet.php | 38 -- pages/api.inc | 17 + pages/api.php | 17 - pages/app.inc | 3 + pages/app.php | 3 - pages/bitset.inc | 409 ++++++++++++++++++ pages/bitset.php | 409 ------------------ pages/byfront.inc | 160 +++++++ pages/byfront.php | 160 ------- pages/dashboard.inc | 231 ++++++++++ pages/dashboard.php | 321 -------------- pages/debug.inc | 115 +++++ pages/debug.php | 96 ---- pages/demo.inc | 129 ++++++ pages/demo.php | 131 ------ pages/disclaimers.inc | 15 + pages/disclaimers.php | 15 - pages/docs.inc | 361 ++++++++++++++++ pages/docs.php | 361 ---------------- pages/edit-private.inc | 68 +++ pages/edit-private.php | 68 --- pages/edit.inc | 68 +++ pages/edit.php | 68 --- pages/emergency.inc | 15 + pages/emergency.php | 15 - pages/fronting.inc | 15 + pages/fronting.php | 15 - pages/government.inc | 142 ++++++ pages/home.inc | 73 ++++ pages/home.php | 67 --- pages/login.inc | 49 +++ pages/login.php | 43 -- pages/logout.inc | 15 + pages/logout.php | 15 - pages/nicknames.inc | 115 +++++ pages/nicknames.php | 115 ----- pages/page.inc | 102 +++++ pages/page.php | 102 ----- pages/parser.inc | 255 +++++++++++ pages/parser.php | 255 ----------- pages/pleasure.inc | 15 + pages/pleasure.php | 15 - pages/prefix.inc | 451 +++++++++++++++++++ pages/prefix.php | 449 ------------------- pages/relations.inc | 105 +++++ pages/relations.php | 105 ----- pages/rules.inc | 253 +++++++++++ pages/rules.php | 253 ----------- pages/score.inc | 208 +++++++++ pages/score.php | 208 --------- pages/splitting.inc | 55 +++ pages/splitting.php | 55 --- pages/stats.inc | 441 +++++++++++++++++++ pages/terminology.inc | 15 + pages/terminology.php | 15 - pages/together-dev.inc | 4 + pages/together-dev.php | 4 - pages/together.inc | 939 ++++++++++++++++++++++++++++++++++++++++ pages/together.php | 939 ---------------------------------------- pages/toys.inc | 902 ++++++++++++++++++++++++++++++++++++++ pages/toys.php | 915 --------------------------------------- pages/travelling.inc | 175 ++++++++ pages/travelling.php | 175 -------- pages/wakeup.inc | 15 + pages/wakeup.php | 15 - 69 files changed, 7185 insertions(+), 6592 deletions(-) create mode 100644 pages/about.inc create mode 100644 pages/actions.inc delete mode 100644 pages/actions.php create mode 100644 pages/alphabet.inc delete mode 100644 pages/alphabet.php create mode 100644 pages/api.inc delete mode 100644 pages/api.php create mode 100644 pages/app.inc delete mode 100644 pages/app.php create mode 100644 pages/bitset.inc delete mode 100644 pages/bitset.php create mode 100644 pages/byfront.inc delete mode 100644 pages/byfront.php create mode 100644 pages/dashboard.inc delete mode 100644 pages/dashboard.php create mode 100644 pages/debug.inc delete mode 100644 pages/debug.php create mode 100644 pages/demo.inc delete mode 100644 pages/demo.php create mode 100644 pages/disclaimers.inc delete mode 100644 pages/disclaimers.php create mode 100644 pages/docs.inc delete mode 100644 pages/docs.php create mode 100644 pages/edit-private.inc delete mode 100644 pages/edit-private.php create mode 100644 pages/edit.inc delete mode 100644 pages/edit.php create mode 100644 pages/emergency.inc delete mode 100644 pages/emergency.php create mode 100644 pages/fronting.inc delete mode 100644 pages/fronting.php create mode 100644 pages/government.inc create mode 100644 pages/home.inc delete mode 100644 pages/home.php create mode 100644 pages/login.inc delete mode 100644 pages/login.php create mode 100644 pages/logout.inc delete mode 100644 pages/logout.php create mode 100644 pages/nicknames.inc delete mode 100644 pages/nicknames.php create mode 100644 pages/page.inc delete mode 100644 pages/page.php create mode 100644 pages/parser.inc delete mode 100644 pages/parser.php create mode 100644 pages/pleasure.inc delete mode 100644 pages/pleasure.php create mode 100644 pages/prefix.inc delete mode 100644 pages/prefix.php create mode 100644 pages/relations.inc delete mode 100644 pages/relations.php create mode 100644 pages/rules.inc delete mode 100644 pages/rules.php create mode 100644 pages/score.inc delete mode 100644 pages/score.php create mode 100644 pages/splitting.inc delete mode 100644 pages/splitting.php create mode 100644 pages/stats.inc create mode 100644 pages/terminology.inc delete mode 100644 pages/terminology.php create mode 100644 pages/together-dev.inc delete mode 100644 pages/together-dev.php create mode 100644 pages/together.inc delete mode 100644 pages/together.php create mode 100644 pages/toys.inc delete mode 100644 pages/toys.php create mode 100644 pages/travelling.inc delete mode 100644 pages/travelling.php create mode 100644 pages/wakeup.inc delete mode 100644 pages/wakeup.php (limited to 'pages') diff --git a/pages/about.inc b/pages/about.inc new file mode 100644 index 0000000..d6b0eeb --- /dev/null +++ b/pages/about.inc @@ -0,0 +1,96 @@ + 1024) { + if ($bytes > 1024**2) { + if ($bytes > 1024**3) { + return round($bytes / 1024**3, 1) . " MB"; + } else { + return round($bytes / 1024**2, 1) . " MB"; + } + } else { + return round($bytes / 1024, 1) . " KB"; + } + } else { + return $bytes . " B"; + } +} + +?> + +
+
+
+

About Cold Haze

+

+ Cold Haze Engine version 2...
+ Version date:
+ Version ID:
+ Install path:
+ Server software: , via
+ Transport protocol: +

+ +

+ PHP
+ Zend Engine:
+ Server API:
+ Memory usage:
+ Server OS:
+ Server domain name:
+ Server architecture: +

+ +

+ Disk space usage
+ Engine:
+ Database: +

+
+
+ + diff --git a/pages/actions.inc b/pages/actions.inc new file mode 100644 index 0000000..527b336 --- /dev/null +++ b/pages/actions.inc @@ -0,0 +1,1116 @@ + $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; + +?> + + + +
+
+
"> + +
+ + 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/actions.php b/pages/actions.php deleted file mode 100644 index 939ed7e..0000000 --- a/pages/actions.php +++ /dev/null @@ -1,1130 +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/oldactions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions/" . date('c') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/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.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/oldactions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions/" . date('c') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json", utf8_encode(json_encode($data))); - - header("Location: /-/actions/" . $id); - die(); -} - -if (isset($_POST['createAction'])) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.php"; - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/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/oldactions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions/" . date('c') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/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.json"), true); -$toys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/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.php'; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/keywords.php'; - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json", "[]"); - -global $_PROFILE; - -?> - - - -
-
-
"> - -
- - 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:

- - - -
- Can be done by: - - -
    -
  • - Affectionately: -
      - -
    • - .png"> - .png"> - - and -
    • - - -
    • - - .png"> - .png"> - - and - - Deprecated -
    • - -
    -
  • -
  • - Sexually: -
      - -
    • - .png"> - .png"> - - and -
    • - - -
    • - - .png"> - .png"> - - and - - Deprecated -
    • - -
    -
  • -
- -
    - -
  • - .png"> - .png"> - - and -
  • - - -
  • - - .png"> - .png"> - - and - - Deprecated -
  • - -
- - -
- - 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: add ponies for all actions (+ keywords)

- - - - - -
- -
-
-

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

-
- - - - - - -
-
- - - - - - - diff --git a/pages/alphabet.inc b/pages/alphabet.inc new file mode 100644 index 0000000..167ba92 --- /dev/null +++ b/pages/alphabet.inc @@ -0,0 +1,38 @@ + + +
+
+ +
+ + diff --git a/pages/alphabet.php b/pages/alphabet.php deleted file mode 100644 index b59772d..0000000 --- a/pages/alphabet.php +++ /dev/null @@ -1,38 +0,0 @@ - - -
-
- -
- - diff --git a/pages/api.inc b/pages/api.inc new file mode 100644 index 0000000..1d83985 --- /dev/null +++ b/pages/api.inc @@ -0,0 +1,17 @@ + + +
+
+
+

Bitset calculator

+
+
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
1
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
+
+

+ Input:
+ Output: 0b000000000000000000000000000000000000100000000000, 0x000008000000, 2048 +

+ + +

+ Shared memory access: + +
+ Food: + +
+ Little/younger: + +
+ Species: + + + +
+ Magic: + +
+ Sensitivity: + +

+

+
+
+
+
+
+
+
+
+
+
+
+
+

+
+ + diff --git a/pages/bitset.php b/pages/bitset.php deleted file mode 100644 index 0d2d10e..0000000 --- a/pages/bitset.php +++ /dev/null @@ -1,409 +0,0 @@ - - -
-
-
-

Bitset calculator

-
-
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
1
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
-
-

- Input:
- Output: 0b000000000000000000000000000000000000100000000000, 0x000008000000, 2048 -

- - -

- Shared memory access: - -
- Food: - -
- Little/younger: - -
- Species: - - - -
- Magic: - -
- Sensitivity: - -

-

-
-
-
-
-
-
-
-
-
-
-
-
-

-
- - diff --git a/pages/byfront.inc b/pages/byfront.inc new file mode 100644 index 0000000..280d981 --- /dev/null +++ b/pages/byfront.inc @@ -0,0 +1,160 @@ + + +
+
+
+

Members by last fronted

+ +

Cloudburst System

+ 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"; + }))); uasort($members, function ($a, $b) { + return $b["_lastFronted"] - $a["_lastFronted"]; + }); foreach ($members as $member): ?> +
+ "> + " style="width:24px;">  + +  Not sharing memory + + + +
+ + Never fronted + + Last fronted () + +
+
+ + +
+

Raindrops System

+ 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"; + }))); uasort($members, function ($a, $b) { + return $b["_lastFronted"] - $a["_lastFronted"]; + }); foreach ($members as $member): ?> +
+ "> + " style="width:24px;">  + +  Not sharing memory + + + +
+ + Never fronted + + Last fronted () + +
+
+ +
+ + +
+ + diff --git a/pages/byfront.php b/pages/byfront.php deleted file mode 100644 index eb9050c..0000000 --- a/pages/byfront.php +++ /dev/null @@ -1,160 +0,0 @@ - - -
-
-
-

Members by last fronted

- -

Cloudburst System

- 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"; - }))); uasort($members, function ($a, $b) { - return $b["_lastFronted"] - $a["_lastFronted"]; - }); foreach ($members as $member): ?> -
- "> - .png" style="width:24px;">  - -  Not sharing memory - - - -
- - Never fronted - - Last fronted () - -
-
- - -
-

Raindrops System

- 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"; - }))); uasort($members, function ($a, $b) { - return $b["_lastFronted"] - $a["_lastFronted"]; - }); foreach ($members as $member): ?> -
- "> - .png" style="width:24px;">  - -  Not sharing memory - - - -
- - Never fronted - - Last fronted () - -
-
- -
- - -
- - diff --git a/pages/dashboard.inc b/pages/dashboard.inc new file mode 100644 index 0000000..59396e5 --- /dev/null +++ b/pages/dashboard.inc @@ -0,0 +1,231 @@ + + +
+
+
+

Date

+ + +
+

Next fronters (edit)

+ + +
Fronters today
+
    + $id): $member = getMemberWithoutSystem($id[0]); ?> +
  • + + Merged members + + " style="width:24px; height: 24px; vertical-align: middle;"> + + + and " style="width:24px; height: 24px; vertical-align: middle;"> + + with " style="width:24px; height: 24px; vertical-align: middle;"> + and " style="width:24px; height: 24px; vertical-align: middle;"> + +
  • + +
+ +
Fronters tomorrow
+
    + $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id[0]); ?> +
  • + + Merged members + + " style="width:24px; height: 24px; vertical-align: middle;"> + + + and " style="width:24px; height: 24px; vertical-align: middle;"> + + with " style="width:24px; height: 24px; vertical-align: middle;"> + and " style="width:24px; height: 24px; vertical-align: middle;"> + +
  • + +
+ +
Fronters on
+
    + $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id[0]); ?> +
  • + + Merged members + + " style="width:24px; height: 24px; vertical-align: middle;"> + + + and " style="width:24px; height: 24px; vertical-align: middle;"> + + with " style="width:24px; height: 24px; vertical-align: middle;"> + and " style="width:24px; 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/dashboard.php b/pages/dashboard.php deleted file mode 100644 index a861636..0000000 --- a/pages/dashboard.php +++ /dev/null @@ -1,321 +0,0 @@ - - -
-
-
-

Date

- - -
-
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
-
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
-
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
-
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
-
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
-
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
-
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
-
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
- -
-
" data-bs-toggle="tooltip"> - -
-
-
-
-
- -
- -
-

Next fronters (edit)

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

Next events

- parseFile($_SERVER['DOCUMENT_ROOT'] . "/includes/data/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/debug.inc b/pages/debug.inc new file mode 100644 index 0000000..77001d0 --- /dev/null +++ b/pages/debug.inc @@ -0,0 +1,115 @@ + "General info about $systemName", + "members" => "Members in the $systemName", + "fronters" => "Current fronter(s) in the $systemName", + "switches" => "Switch history from the $systemName", + default => "$type in $systemName", + }; + } + + if (str_starts_with($item, "images-")) { + $system = explode("-", $item)[1]; + $id = explode("-", $item)[2]; + $systemName = $system === "gdapd" ? "Raindrops" : "Cloudburst"; + $member = getSystemMember($system, $id) ?? [ "name" => $id, "display_name" => $id, "id" => $id ]; + + if ($member["name"] === "unknown") { + return "Unknown (" . $systemName . ")'s images"; + } else { + return getMiniName($member["display_name"] ?? $member["name"]) . "'s images"; + } + } + + return "$item"; +} + +?> + +
+
+ + +
+

Data updater debugging

+

This page provides debugging information to troubleshoot unexpectedly long update times or reported failures.

+ + 360): ?> +
+

+ The data is not updated periodically anymore. +

+ This can be due to multiple things: +
    +
  • the data updater has been disabled temporarily for maintenance;
  • +
  • the data updater cannot start on the server;
  • +
  • the server was down for an extended period of time
  • +
+ If you are an administrator and think this is not normal, you may investigate the issue. +
+ + +

General information

+
    +
  • Update date: format("l j F Y, G:i:s.u T")); ?>
  • +
  • Total duration: ms
  • +
  • Longest operation: ( ms, %)
  • +
+ +

Processing times

+
+ $time): ?>%"> +
+
    + $time): ?> +
  • : ms
  • + +
+ +

Reported failures

+ +

The data updater has not reported any update failure in the last run.

+ +

The following files have failed to update:

+
    + +
  • + +
+ +
+
+ + + + diff --git a/pages/debug.php b/pages/debug.php deleted file mode 100644 index fdd6fec..0000000 --- a/pages/debug.php +++ /dev/null @@ -1,96 +0,0 @@ - "General info about $systemName", - "members" => "Members in the $systemName", - "fronters" => "Current fronter(s) in the $systemName", - "switches" => "Switch history from the $systemName", - default => "$type in $systemName", - }; - } - - if (str_starts_with($item, "images-")) { - $system = explode("-", $item)[1]; - $id = explode("-", $item)[2]; - $systemName = $system === "gdapd" ? "Raindrops" : "Cloudburst"; - $member = getSystemMember($system, $id) ?? [ "name" => $id, "display_name" => $id, "id" => $id ]; - - if ($member["name"] === "unknown") { - return "Unknown (" . $systemName . ")'s images"; - } else { - return getMiniName($member["display_name"] ?? $member["name"]) . "'s images"; - } - } - - return "$item"; -} - -?> - -
-
- - -
-

Data updater debugging

-

This page provides debugging information to troubleshoot unexpectedly long update times or reported failures.

- -

General information

-
    -
  • Update date: format("l j F Y, G:i:s.u T")); ?>
  • -
  • Total duration: ms
  • -
  • Longest operation: ( ms, %)
  • -
- -

Processing times

-
- $time): ?>%"> -
-
    - $time): ?> -
  • : ms
  • - -
- -

Reported failures

- -

The data updater has not reported any update failure in the last run.

- -

The following files have failed to update:

-
    - -
  • - -
- -
-
- - - - diff --git a/pages/demo.inc b/pages/demo.inc new file mode 100644 index 0000000..d469908 --- /dev/null +++ b/pages/demo.inc @@ -0,0 +1,129 @@ + + + +
+
+
+ + + +
+
+ + + + + + + + diff --git a/pages/demo.php b/pages/demo.php deleted file mode 100644 index 381a7e4..0000000 --- a/pages/demo.php +++ /dev/null @@ -1,131 +0,0 @@ - - - -
-
-
- - -
-

Cliquez sur quelqu'un pour avoir plus d'information sur elle.

- -
-
-
- - - - - - - - diff --git a/pages/disclaimers.inc b/pages/disclaimers.inc new file mode 100644 index 0000000..ae3d04e --- /dev/null +++ b/pages/disclaimers.inc @@ -0,0 +1,15 @@ + + +
+
+
+ +
+
+ + diff --git a/pages/disclaimers.php b/pages/disclaimers.php deleted file mode 100644 index b47e33a..0000000 --- a/pages/disclaimers.php +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
-
- -
-
- - diff --git a/pages/docs.inc b/pages/docs.inc new file mode 100644 index 0000000..f893e95 --- /dev/null +++ b/pages/docs.inc @@ -0,0 +1,361 @@ + "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 = $select; + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json"), true); + $titleBase = " · " . $title . " · Cold Haze"; + $title = $data["name"] . " · " . $title; + } else { + header("Location: /-/docs"); + die(); + } +} + +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; + +?> + +
+
+
+
+

+ + Back +

+

Category:

+

+ + Last modified never + + Last modified "> + + by + + + · Saved +

+ + + + + + + + +
+

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 strip_tags($i["contents"]) === "/delete"; + })); + $unsorted_pre = array_values(array_filter($documents, function ($i) { + return strip_tags($i["contents"]) !== "/delete"; + })); + + $unsorted = []; + $categories = []; + foreach ($unsorted_pre as $item) { + if (isset($item["category"])) { + $existing_categories = array_keys($categories); + $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 (!isset($categories[$selected_category])) $categories[$selected_category] = []; + $categories[$selected_category][] = $item; + } else { + $unsorted[] = $item; + } + } + + uasort($unsorted, function ($a, $b) { + return $b["last"]["date"] - $a["last"]["date"]; + }); + + uasort($deletable, function ($a, $b) { + return $b["last"]["date"] - $a["last"]["date"]; + }); + + ?> + + $items): ?> +

+
+ + +

Unsorted

+ +
+

Marked for deletion

+
+ +
+ + +
+
+ + + + + diff --git a/pages/docs.php b/pages/docs.php deleted file mode 100644 index bbc3054..0000000 --- a/pages/docs.php +++ /dev/null @@ -1,361 +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 = $select; - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json"), true); - $titleBase = " · " . $title . " · Cold Haze"; - $title = $data["name"] . " · " . $title; - } else { - header("Location: /-/docs"); - die(); - } -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; - -?> - -
-
-
-
-

- - Back -

-

Category:

-

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

- - - - - - - - -
-

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 strip_tags($i["contents"]) === "/delete"; - })); - $unsorted_pre = array_values(array_filter($documents, function ($i) { - return strip_tags($i["contents"]) !== "/delete"; - })); - - $unsorted = []; - $categories = []; - foreach ($unsorted_pre as $item) { - if (isset($item["category"])) { - $existing_categories = array_keys($categories); - $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 (!isset($categories[$selected_category])) $categories[$selected_category] = []; - $categories[$selected_category][] = $item; - } else { - $unsorted[] = $item; - } - } - - uasort($unsorted, function ($a, $b) { - return $b["last"]["date"] - $a["last"]["date"]; - }); - - uasort($deletable, function ($a, $b) { - return $b["last"]["date"] - $a["last"]["date"]; - }); - - ?> - - $items): ?> -

-
- - -

Unsorted

- -
-

Marked for deletion

-
- -
- - -
-
- - - - - diff --git a/pages/edit-private.inc b/pages/edit-private.inc new file mode 100644 index 0000000..880effe --- /dev/null +++ b/pages/edit-private.inc @@ -0,0 +1,68 @@ + + +
+
+
+ +
+
+ + diff --git a/pages/emergency.php b/pages/emergency.php deleted file mode 100644 index 55ed49a..0000000 --- a/pages/emergency.php +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
-
- -
-
- - diff --git a/pages/fronting.inc b/pages/fronting.inc new file mode 100644 index 0000000..c1d8ead --- /dev/null +++ b/pages/fronting.inc @@ -0,0 +1,15 @@ + + +
+
+
+ +
+
+ + diff --git a/pages/fronting.php b/pages/fronting.php deleted file mode 100644 index 3e613c6..0000000 --- a/pages/fronting.php +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
-
- -
-
- - diff --git a/pages/government.inc b/pages/government.inc new file mode 100644 index 0000000..4698c55 --- /dev/null +++ b/pages/government.inc @@ -0,0 +1,142 @@ + + +
+
+
+

Cold Haze Government

+ + +
+ Systems Council +
+ " style="color: white !important; text-decoration: none;">
+ ">
+ +
+ " style="color: white !important; text-decoration: none;">
+ ">
+ +
+
+
+
+
+

+ + Cloudburst System +

+ +
+
+
+

+ + Raindrops System +

+ +
+
+
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/pages/home.inc b/pages/home.inc new file mode 100644 index 0000000..4f4b0f6 --- /dev/null +++ b/pages/home.inc @@ -0,0 +1,73 @@ + + +
+
+ +
+ + Error: +
+ + + +
+ Notice: This website is temporarily under maintenance and the administrators have locked the database. Although you are logged in as , you cannot access any of the logged-in features while the website is under maintenance. Alerts dispatching remains possible in case of an emergency. +
+ + + +
+ +

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

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

Cold Haze

+

ponies in 2 plural systems

+
+
+
+ +
+ + + + + +
+
+ + + Cold Haze
+ + + Just a small safe place for two plural systems + +
+
+ +
+ + + = 20 || (int)date('H') < 6)): ?> + +
+ Are you in need of help? If you need immediate help from a loved one, you may want to enable the emergency alert by clicking here, even if that will wake up the . Use it as you need. +
+
+ + +
+ + + + +
+
+ + \ No newline at end of file diff --git a/pages/home.php b/pages/home.php deleted file mode 100644 index a2fe0c3..0000000 --- a/pages/home.php +++ /dev/null @@ -1,67 +0,0 @@ - - -
-
- -
- - Error: -
- - - -
- -

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

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

Cold Haze

-

ponies in 2 plural systems

-
-
-
- -
- - - - - -
-
- - - Cold Haze
- - - Just a small safe place for two plural systems - -
-
- -
- - - = 20 || (int)date('H') < 6)): ?> - -
- Are you in need of help? If you need immediate help from a loved one, you may want to enable the emergency alert by clicking here, even if that will wake up the . Use it as you need. -
-
- - -
- - - - -
-
- - \ No newline at end of file diff --git a/pages/login.inc b/pages/login.inc new file mode 100644 index 0000000..ffbe2d7 --- /dev/null +++ b/pages/login.inc @@ -0,0 +1,49 @@ + + +
+
+
+

Login

+ +
+ Login is temporarily disabled. Login on this website has been temporarily disabled by the administrators for maintenance purposes. +
+ + +
+ 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. +
+ +

Select how you want to log into Cold Haze.

+
+
+
+
+ +

Equestria.dev Private Authentication

+

For website administrators, allows to change content and access private information.

+ Continue +
+
+
+
+
+
+ +

Equestria.horse/GitLab/GitHub

+

For website users, allows to view more content, ask questions, and set notes for members.

+ Continue +
+
+
+
+ +
+
+ + diff --git a/pages/login.php b/pages/login.php deleted file mode 100644 index ebae1ae..0000000 --- a/pages/login.php +++ /dev/null @@ -1,43 +0,0 @@ - - -
-
-
-

Login

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

Select how you want to log into Cold Haze.

-
-
-
-
- -

Equestria.dev Private Authentication

-

For website administrators, allows to change content and access private information.

- Continue -
-
-
-
-
-
- -

Equestria.horse/GitLab/GitHub

-

For website users, allows to view more content, ask questions, and set notes for members.

- Continue -
-
-
-
-
-
- - diff --git a/pages/logout.inc b/pages/logout.inc new file mode 100644 index 0000000..0263278 --- /dev/null +++ b/pages/logout.inc @@ -0,0 +1,15 @@ + $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/nicknames.php b/pages/nicknames.php deleted file mode 100644 index 4c06818..0000000 --- a/pages/nicknames.php +++ /dev/null @@ -1,115 +0,0 @@ - $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" => [ - file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-$member[name].png") ? "/assets/uploads/pt-$member[name].png" : "/assets/uploads/pt.png", - file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-$otherMember[name].png") ? "/assets/uploads/pt-$otherMember[name].png" : "/assets/uploads/pt.png", - ] - ]; - } -} - -$nicknames = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/nicknames.json"), true); - -?> - -
-
- -
- - - - diff --git a/pages/page.inc b/pages/page.inc new file mode 100644 index 0000000..22291e2 --- /dev/null +++ b/pages/page.inc @@ -0,0 +1,102 @@ + 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"]; + $namesRaindrops = [...array_map(function ($i) { + return $i['name']; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)), "unknown-rd"]; + + $parts = explode("/", $_GET['_']); + array_unshift($parts, ""); + $parts = array_values($parts); + + if (in_array($parts[1], $namesCloudburst)) { + $parts[0] = "cloudburst"; + } else if (in_array($parts[1], $namesRaindrops)) { + $parts[0] = "raindrops"; + } + + if ($parts[1] === "unknown-rd" || $parts[1] === "unknown-cb") $parts[1] = "unknown"; +} + +$system = $parts[0]; +$member = (isset($parts[1]) ? $parts[1] : null) === "" ? null : (isset($parts[1]) ? $parts[1] : null); + +if ($system !== "cloudburst" && $system !== "raindrops") header("Location: /?error=Invalid system ID") and die(); +$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; +$systemID = $system === "cloudburst" ? "ynmuc" : "gdapd"; + +if ($member === null) { + global $_SystemName; + $_SystemName = $system; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system.inc'; +} else if ($member === "-" && isset($parts[2])) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc')) { + global $_SystemPage; + $_SystemPage = $parts[2]; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc'; + } else { + header("Location: /?error=Page not found: " . $parts[2]) and die(); + } +} else { + $memberFoundInAnotherSystem = false; + $traveller = false; + + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true); + $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true); + $memberData = null; + $memberCommonName = null; + $memberID = null; + + foreach ($members as $m) { + if ($m['name'] === $member) { + $memberData = $m; + $memberCommonName = $m['display_name'] ?? $m['name']; + $memberID = $m['id']; + } + } + + 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) { + $memberFoundInAnotherSystem = true; + } + } + + global $_SystemName; + $_SystemName = $system; + + if (str_ends_with($member, "-travelling")) { + header("Location: /" . substr($member, 0, strlen($member) - 11)) and die(); + } + + if (isset($parts[2]) && $parts[2] === "-" && isset($parts[3])) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.inc')) { + global $_MemberPage; + $_MemberPage = $parts[3]; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.inc'; + } else { + header("Location: /?error=Page not found: " . $parts[3]) and die(); + } + die(); + } + + global $_MemberName; + $_MemberName = $member; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member.inc'; +} + +exit; \ No newline at end of file diff --git a/pages/page.php b/pages/page.php deleted file mode 100644 index cab5dcd..0000000 --- a/pages/page.php +++ /dev/null @@ -1,102 +0,0 @@ - 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"]; - $namesRaindrops = [...array_map(function ($i) { - return $i['name']; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true)), "unknown-rd"]; - - $parts = explode("/", $_GET['_']); - array_unshift($parts, ""); - $parts = array_values($parts); - - if (in_array($parts[1], $namesCloudburst)) { - $parts[0] = "cloudburst"; - } else if (in_array($parts[1], $namesRaindrops)) { - $parts[0] = "raindrops"; - } - - if ($parts[1] === "unknown-rd" || $parts[1] === "unknown-cb") $parts[1] = "unknown"; -} - -$system = $parts[0]; -$member = (isset($parts[1]) ? $parts[1] : null) === "" ? null : (isset($parts[1]) ? $parts[1] : null); - -if ($system !== "cloudburst" && $system !== "raindrops") header("Location: /?error=Invalid system ID") and die(); -$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; -$systemID = $system === "cloudburst" ? "ynmuc" : "gdapd"; - -if ($member === null) { - global $_SystemName; - $_SystemName = $system; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system.php'; -} else if ($member === "-" && isset($parts[2])) { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.php')) { - global $_SystemPage; - $_SystemPage = $parts[2]; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.php'; - } else { - header("Location: /?error=Page not found: " . $parts[2]) and die(); - } -} else { - $memberFoundInAnotherSystem = false; - $traveller = false; - - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-members.json"), true); - $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true); - $memberData = null; - $memberCommonName = null; - $memberID = null; - - foreach ($members as $m) { - if ($m['name'] === $member) { - $memberData = $m; - $memberCommonName = $m['display_name'] ?? $m['name']; - $memberID = $m['id']; - } - } - - 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) { - $memberFoundInAnotherSystem = true; - } - } - - global $_SystemName; - $_SystemName = $system; - - if (str_ends_with($member, "-travelling")) { - header("Location: /" . substr($member, 0, strlen($member) - 11)) and die(); - } - - if (isset($parts[2]) && $parts[2] === "-" && isset($parts[3])) { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.php')) { - global $_MemberPage; - $_MemberPage = $parts[3]; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.php'; - } else { - header("Location: /?error=Page not found: " . $parts[3]) and die(); - } - die(); - } - - global $_MemberName; - $_MemberName = $member; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member.php'; -} - -exit; \ No newline at end of file diff --git a/pages/parser.inc b/pages/parser.inc new file mode 100644 index 0000000..dc07744 --- /dev/null +++ b/pages/parser.inc @@ -0,0 +1,255 @@ + + +
+
+
+

Message parser

+

Enter a message here, and we will tell you which system member this message came from.

+ +
+ + + +
+ +
+ +
+ Cloudburst System +
+
+ +
+
+
+ Name + (Prefix) +
+
+
+
+ +
+ Raindrops System +
+
+ +
+
+
+ Name + (Prefix) +
+
+
+
+
+ +
+
+ The entered message does not contain a prefix/suffix corresponding to a member of the selected system(s); therefore, the most common fronter was selected as a fallback. While the most common fronter is supposed to use their prefix too, we assume they are talking when there is no prefix/suffix in the current message. +
+ + + +
+ + diff --git a/pages/parser.php b/pages/parser.php deleted file mode 100644 index 1c3dea4..0000000 --- a/pages/parser.php +++ /dev/null @@ -1,255 +0,0 @@ - - -
-
-
-

Message parser

-

Enter a message here, and we will tell you which system member this message came from.

- -
- - - -
- -
- -
- Cloudburst System -
-
- -
-
-
- Name - (Prefix) -
-
-
-
- -
- Raindrops System -
-
- -
-
-
- Name - (Prefix) -
-
-
-
-
- -
-
- The entered message does not contain a prefix/suffix corresponding to a member of the selected system(s); therefore, the most common fronter was selected as a fallback. While the most common fronter is supposed to use their prefix too, we assume they are talking when there is no prefix/suffix in the current message. -
- - - -
- - diff --git a/pages/pleasure.inc b/pages/pleasure.inc new file mode 100644 index 0000000..f59d187 --- /dev/null +++ b/pages/pleasure.inc @@ -0,0 +1,15 @@ + + +
+
+
+ +
+
+ + diff --git a/pages/pleasure.php b/pages/pleasure.php deleted file mode 100644 index 14b5440..0000000 --- a/pages/pleasure.php +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
-
- -
-
- - diff --git a/pages/prefix.inc b/pages/prefix.inc new file mode 100644 index 0000000..d7d8a40 --- /dev/null +++ b/pages/prefix.inc @@ -0,0 +1,451 @@ + + +
+
+
+

Prefix generator

+

This prefix generator will take into account the prefixes from the existing members to try to generate new original prefixes for a potential new member.

+ +
+ + + +
+ +
+ + +
+

Generated Prefix

+

We couldn't generate a prefix for a member who goes by this name, try tuning your settings.

+
+ +
    +
  1. {...}
  2. +
+ +
+ + + +
+ + diff --git a/pages/prefix.php b/pages/prefix.php deleted file mode 100644 index 2b1149b..0000000 --- a/pages/prefix.php +++ /dev/null @@ -1,449 +0,0 @@ - - -
-
-
-

Prefix generator

-

This prefix generator will take into account the prefixes from the existing members to try to generate new original prefixes for a potential new member.

- -
- - - -
- -
- - -
-

Generated Prefix

-

We couldn't generate a prefix for a member who goes by this name, try tuning your settings.

-
- -
    -
  1. {...}
  2. -
- -
- - - -
- - diff --git a/pages/relations.inc b/pages/relations.inc new file mode 100644 index 0000000..80520da --- /dev/null +++ b/pages/relations.inc @@ -0,0 +1,105 @@ + + +
+
+
+

Relations

+ 0 || count($member["_metadata"]["sisters"]) > 0): ?> + + +
+ + +
+ + diff --git a/pages/relations.php b/pages/relations.php deleted file mode 100644 index aac2839..0000000 --- a/pages/relations.php +++ /dev/null @@ -1,105 +0,0 @@ - - -
-
-
-

Relations

- 0 || count($member["_metadata"]["sisters"]) > 0): ?> - - -
- - -
- - diff --git a/pages/rules.inc b/pages/rules.inc new file mode 100644 index 0000000..21ae7e6 --- /dev/null +++ b/pages/rules.inc @@ -0,0 +1,253 @@ + $rule) { + if (!isset($rule["name"]) || !isset($rule["content"]) && !is_numeric($index)) { + header("Location: /-/rules"); + die(); + } + + if (trim($rule["name"]) === "") { + unset($_POST["payload"][$index]); + continue; + } + + if (!isset($rule["approved"])) $rule["approved"] = []; + if (isset($rule["approved"][0])) $rule["approved"][0] = true; else $rule["approved"][0] = false; + if (isset($rule["approved"][1])) $rule["approved"][1] = true; else $rule["approved"][1] = false; + + $_POST["payload"][$index] = $rule; + } + + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json", utf8_encode(json_encode($_POST["payload"]))); + + header("Location: /-/rules"); + die(); +} + +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; + +?> + +
+
+
+

Systems rules

+

Click on a rule to view additional details. Edit rules

+ + + +
    + +
  • +
    + + . + + Unapproved + + + +
    + This rule has not yet been approved. All rules need to be approved by the leaders from both systems. This rule is still missing approval from . +
    + +
    class="list-group-item"> + +
    +
    +
  • + +
+
+
+ + + + + + + + diff --git a/pages/rules.php b/pages/rules.php deleted file mode 100644 index 9148d89..0000000 --- a/pages/rules.php +++ /dev/null @@ -1,253 +0,0 @@ - $rule) { - if (!isset($rule["name"]) || !isset($rule["content"]) && !is_numeric($index)) { - header("Location: /-/rules"); - die(); - } - - if (trim($rule["name"]) === "") { - unset($_POST["payload"][$index]); - continue; - } - - if (!isset($rule["approved"])) $rule["approved"] = []; - if (isset($rule["approved"][0])) $rule["approved"][0] = true; else $rule["approved"][0] = false; - if (isset($rule["approved"][1])) $rule["approved"][1] = true; else $rule["approved"][1] = false; - - $_POST["payload"][$index] = $rule; - } - - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules.json", utf8_encode(json_encode($_POST["payload"]))); - - header("Location: /-/rules"); - die(); -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; - -?> - -
-
-
-

Systems rules

-

Click on a rule to view additional details. Edit rules

- - - -
    - -
  • -
    - - . - - Unapproved - - - -
    - This rule has not yet been approved. All rules need to be approved by the primary protectors from both systems. This rule is still missing approval from . -
    - -
    class="list-group-item"> - -
    -
    -
  • - -
-
-
- - - - - - - - diff --git a/pages/score.inc b/pages/score.inc new file mode 100644 index 0000000..e04f9e7 --- /dev/null +++ b/pages/score.inc @@ -0,0 +1,208 @@ + + +
+
+
+

Score system testing

+ +

Raindrops System ()

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

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/score.php b/pages/score.php deleted file mode 100644 index 370d757..0000000 --- a/pages/score.php +++ /dev/null @@ -1,208 +0,0 @@ - - -
-
-
-

Score system testing

- -

Raindrops System ()

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

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.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.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/splitting.inc b/pages/splitting.inc new file mode 100644 index 0000000..1ea2d70 --- /dev/null +++ b/pages/splitting.inc @@ -0,0 +1,55 @@ + + +
+
+
+

Members by splitting date

+ +
+ "> + " style="width:24px;">  + + +
+ Formed at least () +
+
+ +
+ + +
+ + diff --git a/pages/splitting.php b/pages/splitting.php deleted file mode 100644 index d50ede8..0000000 --- a/pages/splitting.php +++ /dev/null @@ -1,55 +0,0 @@ - - -
-
-
-

Members by splitting date

- -
- "> - .png" style="width:24px;">  - - -
- Formed at least () -
-
- -
- - -
- - diff --git a/pages/stats.inc b/pages/stats.inc new file mode 100644 index 0000000..19d4453 --- /dev/null +++ b/pages/stats.inc @@ -0,0 +1,441 @@ + + + + +
+
+
+

Statistics

+ 0, + "raindrops" => 0, + "total" => 0, + "end" => strtotime($switch["timestamp"]), + "start" => null + ]; + + if ($week !== $lastWeek) { + if (isset($weeks[$lastWeek])) { + $weeks[$lastWeek]["start"] = strtotime($switch["timestamp"]); + $lastWeek = $week; + } + } + + $weeks[$week]["raindrops"]++; + $weeks[$week]["total"]++; + } + + $lastWeek = 0; + foreach ($switchesCloudburst as $switch) { + $week = date('YW', strtotime($switch["timestamp"])); + if ($lastWeek === 0) $lastWeek = $week; + + if (!isset($weeks[$week])) $weeks[$week] = [ + "cloudburst" => 0, + "raindrops" => 0, + "total" => 0, + "end" => strtotime($switch["timestamp"]), + "start" => null + ]; + + if ($week !== $lastWeek) { + if (isset($weeks[$lastWeek])) { + $weeks[$lastWeek]["start"] = strtotime($switch["timestamp"]); + $lastWeek = $week; + } + } + + $weeks[$week]["cloudburst"]++; + $weeks[$week]["total"]++; + } + + $index = 0; + foreach ($weeks as $id => $week) { + if ($index >= 20) continue; + $weeksRectified[$id] = $week; + $index++; + } + + $weeksRectified = array_filter(array_reverse($weeksRectified), function ($i) { + return $i["start"] > 1651363200; + }); + + $members = []; + $frontersMonth = []; + + $fronts = []; + $lastFrontIDs = []; + + foreach (array_reverse($switchesRaindrops) as $switch) { + foreach ($lastFrontIDs as $frontID) { + $fronts[$frontID]["end"] = strtotime($switch["timestamp"]); + } + $lastFrontIDs = []; + + $index = 0; foreach ($switch["members"] as $member) { + if (strtotime($switch["timestamp"]) - (time() - 86400*30) < 0) continue; + $fronts[$switch["id"] . ":" . $index] = [ + "member" => $member, + "start" => strtotime($switch["timestamp"]), + "end" => strtotime(date('c')), + "duration" => null + ]; + $lastFrontIDs[] = $switch["id"] . ":" . $index; + } $index++; + } + + foreach ($fronts as $id => $front) { + $fronts[$id]["duration"] = $front["end"] - $front["start"]; + + if (!($front["start"] - (time() - 86400*30) < 0)) { + if (!isset($members[$front["member"]])) $members[$front["member"]] = [ + "time" => 0, + "name" => getMemberWithoutSystem($front["member"])["display_name"], + "color" => getMemberWithoutSystem($front["member"])["color"], + ]; + $members[$front["member"]]["time"] += $fronts[$id]["duration"]; + } + } + + foreach ($fronts as $front) { + if (!isset($frontersMonth[date('Y-m', $front["start"])])) $frontersMonth[date('Y-m', $front["start"])] = []; + if (!isset($frontersMonth[date('Y-m', $front["start"])][$front["member"]])) $frontersMonth[date('Y-m', $front["start"])][$front["member"]] = 0; + $frontersMonth[date('Y-m', $front["start"])][$front["member"]] += $front["duration"]; + } + + $fronts = []; + $lastFrontIDs = []; + + foreach (array_reverse($switchesCloudburst) as $switch) { + foreach ($lastFrontIDs as $frontID) { + $fronts[$frontID]["end"] = strtotime($switch["timestamp"]); + } + $lastFrontIDs = []; + + $index = 0; foreach ($switch["members"] as $member) { + $fronts[$switch["id"] . ":" . $index] = [ + "member" => $member, + "start" => strtotime($switch["timestamp"]), + "end" => strtotime(date('c')), + "duration" => null + ]; + $lastFrontIDs[] = $switch["id"] . ":" . $index; + } $index++; + } + + foreach ($fronts as $id => $front) { + $fronts[$id]["duration"] = $front["end"] - $front["start"]; + + if (!($front["start"] - (time() - 86400*30) < 0)) { + if (!isset($members[$front["member"]])) $members[$front["member"]] = [ + "time" => 0, + "name" => getMemberWithoutSystem($front["member"])["display_name"], + "color" => getMemberWithoutSystem($front["member"])["color"], + ]; + $members[$front["member"]]["time"] += $fronts[$id]["duration"]; + } + } + + foreach ($fronts as $front) { + if (!isset($frontersMonth[date('Y-m', $front["start"])])) $frontersMonth[date('Y-m', $front["start"])] = []; + if (!isset($frontersMonth[date('Y-m', $front["start"])][$front["member"]])) $frontersMonth[date('Y-m', $front["start"])][$front["member"]] = 0; + $frontersMonth[date('Y-m', $front["start"])][$front["member"]] += $front["duration"]; + } + + $fronts = array_reverse($fronts); + uasort($members, function ($a, $b) { + return $b["time"] - $a["time"]; + }); + + $frontersMonthRectified = []; + foreach ($frontersMonth as $monthID => $month) { + $thisMonth = []; + + foreach ($month as $id => $time) { + $thisMonth[$id] = [ + "duration" => $time, + "name" => getMemberWithoutSystem($id)["display_name"], + "color" => getMemberWithoutSystem($id)["color"] + ]; + } + + $frontersMonthRectified[$monthID] = $thisMonth; + } + + uasort($frontersMonthRectified, function ($a, $b) use ($frontersMonthRectified) { + return strtotime(array_search($a, $frontersMonthRectified) . "-01") - strtotime(array_search($b, $frontersMonthRectified) . "-01"); + }); + + $frontersMonthMembers = []; + foreach ($frontersMonthRectified as $month => $fronters) { + foreach ($fronters as $fronter => $data) { + foreach (scoreOrderGlobal() as $member) { + if (!isset($frontersMonthMembers[$member["id"]])) $frontersMonthMembers[$member["id"]] = []; + } + } + + foreach ($frontersMonthMembers as $key => $member) { + $frontersMonthMembers[$key][$month] = $frontersMonthRectified[$month][$key] ?? [ + "duration" => 0 + ]; + /*$frontersMonthMembers[$key][$month] = array_map(function ($i) { + return $i["duration"]; + }, $frontersMonthMembers[$key][$month]);*/ + } + } + + ?> + +

Switches per week

+ + + +
+

Time at front in the last 30 days

+ + + +
+

Time at front per month

+ + +
+
+ + diff --git a/pages/terminology.inc b/pages/terminology.inc new file mode 100644 index 0000000..c115bcf --- /dev/null +++ b/pages/terminology.inc @@ -0,0 +1,15 @@ + + +
+
+
+ +
+
+ + \ No newline at end of file diff --git a/pages/terminology.php b/pages/terminology.php deleted file mode 100644 index 955e470..0000000 --- a/pages/terminology.php +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
-
- -
-
- - \ No newline at end of file diff --git a/pages/together-dev.inc b/pages/together-dev.inc new file mode 100644 index 0000000..6ea9704 --- /dev/null +++ b/pages/together-dev.inc @@ -0,0 +1,4 @@ + + + + + + + + + + + + + +
+
+ +
+ + +
+ +
+ Notification. +
+Skip +
+
+
+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+ -0:00 +
+ + + +
+
+ +
+ \ No newline at end of file diff --git a/pages/together.php b/pages/together.php deleted file mode 100644 index 65786f5..0000000 --- a/pages/together.php +++ /dev/null @@ -1,939 +0,0 @@ - - - - - - - - - - - - - -
-
- -
- - -
- -
- Notification. -
-Skip -
-
-
-
- - - - - - -
-
-
-
-
-
-
-
-
-
- -0:00 -
- - - -
-
- -
- \ No newline at end of file diff --git a/pages/toys.inc b/pages/toys.inc new file mode 100644 index 0000000..8e9ba57 --- /dev/null +++ b/pages/toys.inc @@ -0,0 +1,902 @@ + $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; + +?> + + + +
+
+
"> + +
+ + 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/toys.php b/pages/toys.php deleted file mode 100644 index e0fb1fe..0000000 --- a/pages/toys.php +++ /dev/null @@ -1,915 +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.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.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.json", utf8_encode(json_encode($data))); - - header("Location: /-/toys/" . $id); - die(); -} - -if (isset($_POST['createAction'])) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.php"; - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/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.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.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.php'; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/keywords.php'; - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json", "[]"); - -global $_PROFILE; - -?> - - - -
-
-
"> - -
- - 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.

- - -
- Can be used by: - -
    - -
  • - .png"> - .png"> - - and -
  • - - -
  • - - .png"> - .png"> - - and - - Deprecated -
  • - -
- -
- - 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 new file mode 100644 index 0000000..e808063 --- /dev/null +++ b/pages/travelling.inc @@ -0,0 +1,175 @@ + [ + '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']]["pluralkit"] = null; + $travelling[$_GET['member']]["history"][] = [ + "start" => date("c"), + "end" => null + ]; + + // 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"]; + } + } + } + + header("Location: /-/travelling"); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); + die(); +} + +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; +global $travelling; + +?> + + + +
+
+
+

System travelling

+ +
+ "> + " style="width:24px;">  + + +
+
+ Current system:
+ + ">.png"> System + + () + +
+
+ +
+ + Stop travelling + + Start travelling + +
+
+ +
+ + +
+ + diff --git a/pages/travelling.php b/pages/travelling.php deleted file mode 100644 index 95c7851..0000000 --- a/pages/travelling.php +++ /dev/null @@ -1,175 +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']]["pluralkit"] = null; - $travelling[$_GET['member']]["history"][] = [ - "start" => date("c"), - "end" => null - ]; - - // 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"]; - } - } - } - - header("Location: /-/travelling"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); - die(); -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; -global $travelling; - -?> - - - -
-
-
-

System travelling

- -
- "> - .png" style="width:24px;">  - - -
-
- Current system:
- - ">.png"> System - - () - -
-
- -
- - Stop travelling - - Start travelling - -
-
- -
- - -
- - diff --git a/pages/wakeup.inc b/pages/wakeup.inc new file mode 100644 index 0000000..2438a27 --- /dev/null +++ b/pages/wakeup.inc @@ -0,0 +1,15 @@ + + +
+
+
+ +
+
+ + diff --git a/pages/wakeup.php b/pages/wakeup.php deleted file mode 100644 index c90d93e..0000000 --- a/pages/wakeup.php +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
-
- -
-
- - -- cgit