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

= 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; } } uasort($unsorted, function ($a, $b) { return $b["last"]["date"] - $a["last"]["date"]; }); uasort($deletable, function ($a, $b) { return $b["last"]["date"] - $a["last"]["date"]; }); $fullList = [...$categoryFirst, ...$categories]; ?> $items): ?>


Unsorted


Marked for deletion