diff options
author | RaindropsSys <raindrops@equestria.dev> | 2023-11-18 11:34:36 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2023-11-18 11:34:36 +0100 |
commit | 9337aae8b1c87fad34884dacd5cd79d9591c60db (patch) | |
tree | 5340f9fa67cd6236e4c879f0057d51d0b1e21361 /includes/components/explicit.php | |
parent | 953ddd82e48dd206cef5ac94456549aed13b3ad5 (diff) | |
download | pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.gz pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.bz2 pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.zip |
Updated 39 files, added 86 files, deleted 40 files and renamed 2 files (automated)
Diffstat (limited to 'includes/components/explicit.php')
-rw-r--r-- | includes/components/explicit.php | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/includes/components/explicit.php b/includes/components/explicit.php deleted file mode 100644 index 3e7675c..0000000 --- a/includes/components/explicit.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php global $isLoggedIn; global $isLowerLoggedIn; global $_PROFILE; global $app; if ($isLoggedIn || $isLowerLoggedIn): ?> -<div class="modal" id="explicit-modal" data-bs-backdrop="static" data-bs-keyboard="false"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-body" style="text-align: center;"> - <img alt="" style="width: 64px; height: 64px;" src="/assets/icons/explicit.svg"> - <h3>This content is sexually explicit</h3> - - <p>This page shows uncensored graphically explicit sexual content that you may not want to see in some cases. Please refrain from visiting this part of the website in a public place.</p> - <p>By continuing, you agree to be presented with sexually explicit content that is not appropriate for everyone.</p> - - <span onclick="explicitConfirm();" id="explicit-modal-confirm" class="btn btn-primary">Continue</span> - <span onclick="explicitCancel();" id="explicit-modal-cancel" class="btn btn-outline-secondary">Go back</span> - - <label style="margin-top:10px; display: block; text-align: left; opacity: .5;"> - <input checked type="checkbox" class="form-check-input" id="explicit-modal-hour"> - Don't show for the next hour - </label> - </div> - </div> - </div> -</div> - -<?php global $use2023UI; if (!$use2023UI): ?> - <style> - #explicit-modal .modal-header { - border-bottom: 1px solid #353738; - } - - #explicit-modal .modal-content { - border: 1px solid rgba(255, 255, 255, .2); - background-color: #111; - } - </style> -<?php endif; ?> - -<!--suppress JSVoidFunctionReturnValueUsed --> -<script> - window.explicitModal = new bootstrap.Modal(document.getElementById("explicit-modal")); - window.ip = "<?= $_SERVER['REMOTE_ADDR'] ?>"; - window.front = "<?php - - $front = []; - $id = null; - - if ($_PROFILE["login"] === "raindrops") { - $id = "gdapd"; - } else if ($_PROFILE["login"] === "cloudburst") { - $id = "ynmuc"; - } else { - $id = $app["other"]["id"]; - } - - $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/fronters.json"), true)["members"]; - $front = array_map(function ($i) { - return $i["id"]; - }, $fronters); - - echo(implode(",", $front)); - - ?>"; - window.age = <?php - - if (isset($front[0]) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $front[0] . ".json")) { - $metadata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $front[0] . ".json"), true); - $age = null; - - if (isset($metadata["birth"]["age"]) && $metadata["birth"]["age"] !== 0) { - $age = $metadata["birth"]["age"]; - } else if (isset($metadata["birth"]["year"]) && $metadata["birth"]["year"] > 1990) { - $age = (int)date('Y') - $metadata["birth"]["year"] + (strtotime(date('Y') . "-" . $metadata["birth"]["date"]) <= time() ? 0 : -1); - } - - if (is_string($age) && isset(explode("-", $age)[1]) && is_numeric(explode("-", $age)[1])) { - $age = (int)explode("-", $age)[1]; - } - - echo($age); - } - - ?>; - window.explicitCancelAction = "back"; - - function requestExplicit(ifNotAgreed, allowUnderage) { - window.explicitCancelAction = ifNotAgreed; - - if (!allowUnderage && window.age !== -1 && (window.age < 15 || !window.age)) { - document.getElementById("explicit-modal-confirm").classList.add("disabled"); - document.getElementById("explicit-modal-hour").disabled = true; - - window.explicitModal.show(); - document.getElementById("explicit-modal").classList.add("fade"); - } - - if (!localStorage.getItem("explicit-consent")) { - window.explicitModal.show(); - document.getElementById("explicit-modal").classList.add("fade"); - } else { - let parts = localStorage.getItem("explicit-consent").split("|"); - - if (parts[0] !== window.front || parts[1] !== window.ip || new Date().getTime() - parseInt(parts[2]) > 3600000) { - window.explicitModal.show(); - document.getElementById("explicit-modal").classList.add("fade"); - } - } - } - - function explicitConfirm() { - window.explicitModal.hide(); - - if (document.getElementById("explicit-modal-hour").checked) { - localStorage.setItem("explicit-consent", window.front + "|" + window.ip + "|" + new Date().getTime()); - } - } - - function explicitCancel() { - if (window.explicitCancelAction === "refresh") { - location.reload(); - } else { - if (history.length > 1) { - if (history.back() === undefined) { - location.href = "https://ponies.equestria.horse"; - } - } else { - location.href = "https://ponies.equestria.horse"; - } - } - } -</script> -<?php endif; ?> |