diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/docs.inc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pages/docs.inc b/pages/docs.inc index 6d01489..ff97ed3 100644 --- a/pages/docs.inc +++ b/pages/docs.inc @@ -215,10 +215,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; })); $deletable = array_values(array_filter($documents, function ($i) { - return strip_tags($i["contents"]) === "/delete"; + return str_starts_with(strip_tags($i["contents"]), "/delete"); })); $unsorted_pre = array_values(array_filter($documents, function ($i) { - return strip_tags($i["contents"]) !== "/delete"; + return !str_starts_with(strip_tags($i["contents"]), "/delete"); })); $categoryFirst = []; @@ -264,9 +264,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; <?php foreach ($fullList as $category => $items): ?> <h4><?= str_starts_with($category, ".") ? substr($category, 1) : $category ?></h4><div class="list-group"> <?php foreach ($items as $item): ?> - <a href="/-/docs/<?= $item["id"] ?>" id="document-<?= $item["id"] ?>" class="list-group-item list-group-item-action document-listing <?php if (strip_tags($item["contents"]) === "/delete"): ?>opacity-75<?php endif; ?>"> + <a href="/-/docs/<?= $item["id"] ?>" id="document-<?= $item["id"] ?>" class="list-group-item list-group-item-action document-listing <?php if (str_starts_with(strip_tags($item["contents"]), "/delete")): ?>opacity-75<?php endif; ?>"> <?= $item["name"] ?> - <?php if (strip_tags($item["contents"]) === "/delete"): ?> + <?php if (str_starts_with(strip_tags($item["contents"]), "/delete")): ?> <span class="badge bg-warning rounded-pill text-black">Deleting in <?= round((($item["last"]["date"] + 86400) - time()) / 3600) ?> hours</span> <?php else: ?> <span class="relative-time text-muted" data-relative-timestamp="<?= $item["last"]["date"] ?>"><?= timeAgo($item["last"]["date"]) ?></span> @@ -278,9 +278,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; <h4>Unsorted</h4><div class="list-group"> <?php foreach ($unsorted as $item): ?> - <a href="/-/docs/<?= $item["id"] ?>" id="document-<?= $item["id"] ?>" class="list-group-item list-group-item-action document-listing <?php if (strip_tags($item["contents"]) === "/delete"): ?>opacity-75<?php endif; ?>"> + <a href="/-/docs/<?= $item["id"] ?>" id="document-<?= $item["id"] ?>" class="list-group-item list-group-item-action document-listing <?php if (str_starts_with(strip_tags($item["contents"]), "/delete")): ?>opacity-75<?php endif; ?>"> <?= $item["name"] ?> - <?php if (strip_tags($item["contents"]) === "/delete"): ?> + <?php if (str_starts_with(strip_tags($item["contents"]), "/delete")): ?> <span class="badge bg-warning rounded-pill text-black">Deleting in <?= round((($item["last"]["date"] + 86400) - time()) / 3600) ?> hours</span> <?php else: ?> <span class="relative-time text-muted" data-relative-timestamp="<?= $item["last"]["date"] ?>"><?= timeAgo($item["last"]["date"]) ?></span> @@ -291,9 +291,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; <hr> <h4 id="deletable">Marked for deletion</h4><div class="list-group"> <?php foreach ($deletable as $item): ?> - <a href="/-/docs/<?= $item["id"] ?>" id="document-<?= $item["id"] ?>" class="list-group-item list-group-item-action document-listing <?php if (strip_tags($item["contents"]) === "/delete"): ?>opacity-75<?php endif; ?>"> + <a href="/-/docs/<?= $item["id"] ?>" id="document-<?= $item["id"] ?>" class="list-group-item list-group-item-action document-listing <?php if (str_starts_with(strip_tags($item["contents"]), "/delete")): ?>opacity-75<?php endif; ?>"> <?= $item["name"] ?> - <?php if (strip_tags($item["contents"]) === "/delete"): ?> + <?php if (str_starts_with(strip_tags($item["contents"]), "/delete")): ?> <span class="badge bg-warning rounded-pill text-black">Deleting in <?= round((($item["last"]["date"] + 86400) - time()) / 3600) ?> hours</span> <?php else: ?> <span class="relative-time text-muted" data-relative-timestamp="<?= $item["last"]["date"] ?>"><?= timeAgo($item["last"]["date"]) ?></span> |