From 5860551daa0f60103ad24e93da29f401a653f144 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 29 Mar 2024 22:05:35 +0100 Subject: Updated 20 files, added 6 files, deleted 144 files and renamed .idea/ponycule.iml (automated) --- pages/metadata.inc | 197 ----------------------------------------------------- 1 file changed, 197 deletions(-) delete mode 100644 pages/metadata.inc (limited to 'pages/metadata.inc') diff --git a/pages/metadata.inc b/pages/metadata.inc deleted file mode 100644 index 53d5c05..0000000 --- a/pages/metadata.inc +++ /dev/null @@ -1,197 +0,0 @@ - "01-01", - "year" => null, - "age" => 0 - ]; - - if (isset($_GET["age"]) && is_numeric($_GET["age"])) { - $toUpdate["birth"]["age"] = (int)$_GET["age"]; - } else if (isset($_GET["age"]) && preg_match("/^\d{1,2}-\d{1,2}$/", $_GET["age"]) === 1) { - $toUpdate["birth"]["age"] = $_GET["age"]; - } - - if (isset($_GET["birth"]) && trim($_GET['birth']) !== "" && !!preg_match("/^\d{4}-\d{2}-\d{2}$/m", $_GET['birth'])) { - $toUpdate["birth"]["year"] = (int)substr($_GET["birth"],0, 4); - $toUpdate["birth"]["date"] = substr($_GET["birth"],5); - } - - if (isset($_GET["membc"])) { - $toUpdate["code"] = $_GET['membc']; - } - - $flags = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/flags.json"), true); - - foreach ($flags as $id => $name) if (!is_array($name)) { - if (isset($_GET['flags'][$id])) { - $toUpdate[$id] = true; - } else { - $toUpdate[$id] = false; - } - } else foreach ($name as $id2 => $_) { - if (isset($_GET['flags'][$id][$id2])) { - $toUpdate[$id][$id2] = true; - } else { - $toUpdate[$id][$id2] = false; - } - } - - foreach ($toUpdate as $item => $value) { - $metadata[$item] = $value; - } - - if (isset($metadata["bitset"])) unset($metadata["bitset"]); - if (isset($metadata["code"])) unset($metadata["code"]); - if (trim($metadata["species"][1]) === "") unset($metadata["species"][1]); - - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", json_encode($metadata)); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/navigation.json", "{}"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json", "{}"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/species.json", "{}"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/relations.json", "{}"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/planner.json", "{}"); - - createJob("RefreshCache", []); - - header("Location: /" . $_GET['_']); - } else { - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/metadata.inc'; - } -} - -exit; \ No newline at end of file -- cgit