diff options
author | Minteck <contact@minteck.org> | 2022-11-16 17:58:38 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-11-16 17:58:38 +0100 |
commit | f850a8a53efd719fef6c8784c5af7b89dd9a6a2f (patch) | |
tree | 87ff8becfdc620329516cb6d5348a997fc38df83 /pages | |
parent | 209356b8ade1920b50d1d3a1a5e121c6623d167b (diff) | |
download | pluralconnect-f850a8a53efd719fef6c8784c5af7b89dd9a6a2f.tar.gz pluralconnect-f850a8a53efd719fef6c8784c5af7b89dd9a6a2f.tar.bz2 pluralconnect-f850a8a53efd719fef6c8784c5af7b89dd9a6a2f.zip |
Big update
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> |