diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-08 21:08:03 +0100 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-08 21:08:03 +0100 |
commit | 8f1788919a26d3613a9f0c400bf318c71cb89707 (patch) | |
tree | acb9a0eba98b4f08215fb3d0da5d3cc481fa35f7 | |
parent | c1c8c5e12af20df4aa10ce712e9826e91a0bb1f4 (diff) | |
download | booru-8f1788919a26d3613a9f0c400bf318c71cb89707.tar.gz booru-8f1788919a26d3613a9f0c400bf318c71cb89707.tar.bz2 booru-8f1788919a26d3613a9f0c400bf318c71cb89707.zip |
Updated 2 files (automated)
-rw-r--r-- | includes/header.php | 17 | ||||
-rw-r--r-- | includes/session.php | 8 |
2 files changed, 24 insertions, 1 deletions
diff --git a/includes/header.php b/includes/header.php index 6955ca3..c257e94 100644 --- a/includes/header.php +++ b/includes/header.php @@ -27,13 +27,28 @@ function parseFilters($filters, $ignore = []) { } } - $filters["nsfw_closeup"] = substr($text, 0, -3); + $filters["nsfw_closeup"] = substr($text, 0, -2); } } return $filters; } +function removeFromNsfw($tag) { + $filters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/filters.json"), true); + + $text = ""; + $filter = $filters["nsfw"]; + + foreach ($filter as $item) { + if ($item !== $tag) { + $text .= "-" . $item . ", "; + } + } + + return substr($text, 0, -2); +} + ?> <!doctype html> <html lang="en"> diff --git a/includes/session.php b/includes/session.php index 0e48d6e..b1e6753 100644 --- a/includes/session.php +++ b/includes/session.php @@ -8,6 +8,10 @@ $species = [ "tag" => "earth pony" ]; +$name = null; + +$names = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/names.json"), true); + if (!isset($_COOKIE["booru_auth"])) { header("Location: /auth"); die(); @@ -60,6 +64,10 @@ if (file_exists("/peh") && file_exists("/peh/gdapd") && file_exists("/peh/ynmuc" $name = $fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]; $id = $fronters["members"][0]["id"]; + if (isset($names[$id])) { + $name = $names[$id]; + } + if ($debug) echo("Pony has metadata: "); if (file_exists("/peh/metadata/" . $id . ".json")) { |