From 31fed783e82dd065c71b234ba08ece596a081f05 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 17 Dec 2023 12:23:19 +0100 Subject: Updated 15 files and deleted 3 files (automated) --- pages/docs.inc | 423 --------------------------------------------------------- 1 file changed, 423 deletions(-) delete mode 100644 pages/docs.inc (limited to 'pages/docs.inc') diff --git a/pages/docs.inc b/pages/docs.inc deleted file mode 100644 index 403a4f9..0000000 --- a/pages/docs.inc +++ /dev/null @@ -1,423 +0,0 @@ - "Untitled document ($id)", - "category" => null, - "contents" => "This is a new document you just created.", - "last" => [ - "author" => $_PROFILE["login"], - "date" => time() - ] - ])); - - header("Location: /-/docs/$id"); - die(); -} elseif (isset($select)) { - if (ctype_alnum($select) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json")) { - $id = $_documentId = $select; - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json"), true); - $titleBase = " · " . $title . " · Ponycule"; - $title = $data["name"] . " · " . $title; - } else { - header("Location: /-/docs"); - die(); - } -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; - -function showDocument($item) { ?> -
- - - - NSFW - - - - Deleting in hours - - - "> - - -
- - -
-
-
-
-

- - Back -

-

Category: ·

-

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

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

Documents

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

-
- - -

Unsorted

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

Archives

- - -
-

Marked for deletion

-
-
- -
- - -
-
- - - - - -- cgit