summaryrefslogtreecommitdiff
path: root/includes/util/evening.inc
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
commit9337aae8b1c87fad34884dacd5cd79d9591c60db (patch)
tree5340f9fa67cd6236e4c879f0057d51d0b1e21361 /includes/util/evening.inc
parent953ddd82e48dd206cef5ac94456549aed13b3ad5 (diff)
downloadpluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.gz
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.bz2
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.zip
Updated 39 files, added 86 files, deleted 40 files and renamed 2 files (automated)
Diffstat (limited to 'includes/util/evening.inc')
-rw-r--r--includes/util/evening.inc68
1 files changed, 0 insertions, 68 deletions
diff --git a/includes/util/evening.inc b/includes/util/evening.inc
deleted file mode 100644
index 58e511e..0000000
--- a/includes/util/evening.inc
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", "[]");
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", "{}");
-
-if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
-global $use2023UI;
-
-$pairs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/pairs.json"), true);
-$ignored = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json"), true);
-$locked = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json"), true);
-
-if (isset($_GET["ignore"]) && isset($_GET["day"])) {
- if ($_GET["ignore"] === "1") {
- if (preg_match("/^\d{4}-\d{2}-\d{2}$/m", $_GET["day"]) === false) {
- header("Location: /$_GET[_]");
- die();
- }
-
- if (!in_array($_GET["day"], $ignored)) {
- $ignored[] = $_GET["day"];
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", json_encode($ignored));
- header("Location: /$_GET[_]");
- die();
- } elseif ($_GET["ignore"] === "0") {
- if (preg_match("/^\d{4}-\d{2}-\d{2}$/m", $_GET["day"]) === false) {
- header("Location: /$_GET[_]");
- die();
- }
-
- if (in_array($_GET["day"], $ignored)) {
- unset($ignored[array_search($_GET["day"], $ignored)]);
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", json_encode($ignored));
- header("Location: /$_GET[_]");
- die();
- }
-
- die();
-}
-
-if (isset($_GET["lock"]) && isset($_GET["day"]) && isset($_GET["data"])) {
- if (isset($locked[$_GET["day"]])) {
- unset($locked[$_GET["day"]]);
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", json_encode($locked));
- header("Location: /$_GET[_]");
- die();
- } else {
- $locked[$_GET["day"]] = $_GET["data"];
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", json_encode($locked));
- header("Location: /$_GET[_]");
- die();
- }
-} \ No newline at end of file