diff options
Diffstat (limited to 'includes/session.php')
-rw-r--r-- | includes/session.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/includes/session.php b/includes/session.php index 5b72a3d..0e48d6e 100644 --- a/includes/session.php +++ b/includes/session.php @@ -2,6 +2,12 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/proprietary/nsfw.php")) require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/proprietary/nsfw.php"; +$species = [ + "name" => "an earth pony", + "code" => "earth", + "tag" => "earth pony" +]; + if (!isset($_COOKIE["booru_auth"])) { header("Location: /auth"); die(); @@ -63,6 +69,42 @@ if (file_exists("/peh") && file_exists("/peh/gdapd") && file_exists("/peh/ynmuc" $info = json_decode(file_get_contents("/peh/metadata/" . $id . ".json"), true); + if (isset($info["species"][0])) { + switch ($info["species"][0]) { + case "unicorn": + $species = [ + "name" => "a unicorn", + "code" => "unicorn", + "tag" => "unicorn" + ]; + break; + + case "pegasus": + $species = [ + "name" => "a pegasus", + "code" => "pegasus", + "tag" => "pegasus" + ]; + break; + + case "alicorn": + $species = [ + "name" => "an alicorn", + "code" => "alicorn", + "tag" => "alicorn" + ]; + break; + + case "batpony": + $species = [ + "name" => "a bat pony", + "code" => "batpony", + "tag" => "bat pony" + ]; + break; + } + } + if ($debug) echo(" Defined fixed age: " . (isset($info["birth"]["age"]) && ($info["birth"]["age"] > 0 || $info["birth"]["age"] === -1) ? "yes (" . ($info["birth"]["age"] === -1 ? "eternal" : $info["birth"]["age"]) . ")" : "no") . "\n"); if ($debug) echo(" Below 16 by fixed age: "); |