aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-05 13:00:47 +0100
committerMinteck <contact@minteck.org>2023-02-05 13:00:47 +0100
commit6410652618ae54460aef71871f82c8534e8ea9bf (patch)
treef1030a3fd969cd5f0ac3f1f56b548b6ec5733032
parent1646d1cc94380a7222bdfd7ff4c512d90a9d22a9 (diff)
downloadbooru-6410652618ae54460aef71871f82c8534e8ea9bf.tar.gz
booru-6410652618ae54460aef71871f82c8534e8ea9bf.tar.bz2
booru-6410652618ae54460aef71871f82c8534e8ea9bf.zip
Updated 7 files (automated)
-rw-r--r--categories/get.php11
-rw-r--r--categories/save.php6
-rw-r--r--includes/footer.php2
-rw-r--r--includes/header.php10
-rw-r--r--nsfw/home/index.php2
-rw-r--r--nsfw/index.php2
-rw-r--r--saved/index.php32
7 files changed, 51 insertions, 14 deletions
diff --git a/categories/get.php b/categories/get.php
index 7e87299..860e4f3 100644
--- a/categories/get.php
+++ b/categories/get.php
@@ -1,18 +1,25 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $userName;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $userName; global $id;
while (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/saved.json")) === "") {}
+$uid = $id;
+
+if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/proprietary/nsfw.php")) require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/proprietary/nsfw.php";
+
$list = [];
$saved = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/saved.json"), true)[$userName];
foreach ($saved as $id => $group) {
if ($id === "favorites") continue;
- $list[] = [
+ $item = [
"id" => $id,
+ "enabled" => !isset($group["owner"]) || $group["owner"] === $uid,
"name" => $group["name"]
];
+
+ $list[] = $item;
}
die(json_encode($list)); \ No newline at end of file
diff --git a/categories/save.php b/categories/save.php
index 56bede9..8b1ce1e 100644
--- a/categories/save.php
+++ b/categories/save.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $userName;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $userName; global $id;
while (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/saved.json")) === "") {}
$isSaved = false;
@@ -18,6 +18,10 @@ if (!in_array($_GET["id"], $saved[$userName][$_GET["category"]]["items"])) {
$saved[$userName][$_GET["category"]]["items"][] = $_GET["id"];
}
+if (isset($saved[$userName][$_GET["category"]]["owner"]) && $saved[$userName][$_GET["category"]]["owner"] !== $id) {
+ die();
+}
+
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/saved.json", json_encode($saved, JSON_PRETTY_PRINT));
while (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/saved.json")) === "") {
diff --git a/includes/footer.php b/includes/footer.php
index 278b08c..93e3fe1 100644
--- a/includes/footer.php
+++ b/includes/footer.php
@@ -122,7 +122,7 @@
<ul class="dropdown-menu" id="dropdown-save-menu">
<li><a class="dropdown-item" href="#image-preview" onclick="saveItem('favorites', '${data['id']}')">Favorites</a></li>
${saveCategories.length > 1 ? `<li><hr class="dropdown-divider"></li>` : ``}
- ${saveCategories.map(i => `<li><a class="dropdown-item" href="#image-preview" onclick="saveItem('${i.id}', '${data['id']}')">${i.name}</a></li>`).join('')}
+ ${saveCategories.map(i => `<li><a class="dropdown-item ${!i.enabled ? "disabled" : ""}" href="#image-preview" onclick="saveItem('${i.id}', '${data['id']}')">${i.name}</a></li>`).join('')}
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#image-preview" onclick="saveItem('new', '${data['id']}')">New category</a></li>
</ul>
diff --git a/includes/header.php b/includes/header.php
index 85a26d5..f2d52d8 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -131,7 +131,7 @@ function parseFilters($filters, $ignore = []) {
}
.form-control, .form-select, .form-check-input {
- filter: invert(1) hue-rotate(180deg);
+ filter: invert(1) hue-rotate(180deg) !important;
}
.icon {
@@ -159,8 +159,12 @@ function parseFilters($filters, $ignore = []) {
}
.list-group-item {
- background-color: #222;
- color: white;
+ background-color: #222 !important;
+ color: white !important;
+ }
+
+ .list-group-item.disabled {
+ opacity: .75;
}
.list-group-item-action:hover {
diff --git a/nsfw/home/index.php b/nsfw/home/index.php
index a2092b5..2b11d5b 100644
--- a/nsfw/home/index.php
+++ b/nsfw/home/index.php
@@ -1,4 +1,4 @@
-<?php $title = "Explicit"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php"; global $allowFillyNsfw; global $allowNsfw;
+<?php $title = "Explicit"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php"; global $allowNsfw;
?>
diff --git a/nsfw/index.php b/nsfw/index.php
index d24ab89..6167f91 100644
--- a/nsfw/index.php
+++ b/nsfw/index.php
@@ -15,7 +15,7 @@ $title = "Warning"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.p
This section of the app presents uncensored graphically explicit sexual content that you may not want to see in some cases. Some of the content you see might be more explicit or realistic than the rest, and content filters might not be 100% perfect.
</p>
<p>
- We have determined you are allowed (old enough) to view sexually explicit content, so you can continue if you wish to do so. Make sure you are in a safe place with no one eavesdropping on you. Please refrain from visiting this part of the website in a public place.
+ We have determined you are allowed to view sexually explicit content, so you can continue if you wish to do so. Make sure you are in a safe place with no one eavesdropping on you. Please refrain from visiting this part of the website in a public place.
</p>
By continuing, you agree to be presented with sexually explicit content that is not appropriate for everyone.
</div>
diff --git a/saved/index.php b/saved/index.php
index 5387392..0f9850a 100644
--- a/saved/index.php
+++ b/saved/index.php
@@ -1,7 +1,29 @@
-<?php $title = "Saved"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php"; global $userName; global $allowNsfw;
+<?php
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $userName; global $allowNsfw; global $id;
$saved = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/saved.json"), true)[$userName];
+$title = "Saved";
+
+if (isset($_GET["id"])) {
+ $category = $saved[$_GET["id"]];
+
+ if (!isset($category)) {
+ header("Location: /saved");
+ die();
+ }
+
+ if (isset($category["owner"]) && $category["owner"] !== $id) {
+ header("Location: /saved");
+ die();
+ }
+
+ $title = $category["name"] . " - Saved";
+}
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
+$uid = $id;
+
?>
<?php if (!isset($_GET["id"])): ?>
@@ -26,10 +48,10 @@ $saved = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/da
<div class="list-group saved-list" style="margin-top: 10px;">
<?php foreach ($saved as $id => $category): if ($id !== "favorites"): ?>
- <a href="/saved/?id=<?= $id ?>" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: 5vw 1fr; grid-gap: 15px;">
+ <a href="/saved/?id=<?= $id ?>" class="list-group-item list-group-item-action <?= isset($category["owner"]) && $category["owner"] !== $uid ? "disabled" : "" ?>" style="display: grid; grid-template-columns: 5vw 1fr; grid-gap: 15px;">
<div style="background-color: rgba(255, 255, 255, .1); height: 64px; border-radius: 5px;">
<div style="opacity: 0; transition: opacity 200ms; background-size: cover; background-position: center; height: 100%; width: 100%; border-radius: 5px;" class="category-img" data-category-img="<?= count($category["items"]) > 0 ? $category["items"][count($category["items"]) - 1] : "" ?>">
- <div style="display:none;width: 100%;backdrop-filter: blur(5px);height: 100%;border-radius: 5px;"></div>
+ <div style="display:none;width: 100%;backdrop-filter: blur(<?= isset($category["owner"]) && $category["owner"] !== $uid ? "10px" : "5px" ?>);height: 100%;border-radius: 5px;"></div>
</div>
</div>
<div style="display: flex; align-items: center;">
@@ -84,12 +106,12 @@ if (!isset($category)) die();
<div style="margin: 20px 50px 0;" class="main-app">
<h2 <?= $_GET["id"] !== "favorites" ? "contenteditable" : "" ?> id="category-title"><?= $category["name"] ?></h2>
- <p <?php if (!$allowNsfw): ?>style="display:none;"<?php endif; ?>>
+ <div style="margin-bottom: 10px;<?php if (!isset($category["owner"]) && (!$allowNsfw || (function_exists("proprietary_nsfw_7") && proprietary_nsfw_7()))): ?>display:none;<?php endif; ?>">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="show-nsfw" name="show-nsfw" disabled onchange="toggleNSFW();">
<label class="form-check-label" for="show-nsfw">Display NSFW images</label>
</div>
- </p>
+ </div>
<div style="display: grid; grid-template-columns: repeat(6, 1fr); grid-gap: 10px;" id="grid">
<?php foreach ($category["items"] as $id) { ?>