summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-12-17 12:23:19 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-12-17 12:23:19 +0100
commit31fed783e82dd065c71b234ba08ece596a081f05 (patch)
tree9cda68ddf5b5beb9d81b0d708dfe9ed15b42945a
parent1e5d2072fb4e257e82e2a97b4fb62e5b553b8e6d (diff)
downloadpluralconnect-31fed783e82dd065c71b234ba08ece596a081f05.tar.gz
pluralconnect-31fed783e82dd065c71b234ba08ece596a081f05.tar.bz2
pluralconnect-31fed783e82dd065c71b234ba08ece596a081f05.zip
Updated 15 files and deleted 3 files (automated)
-rw-r--r--assets/logo/custom-2023.css5
-rw-r--r--includes/components/2023ui.inc6
-rw-r--r--includes/components/emergency.inc129
-rw-r--r--includes/components/pleasure.inc90
-rw-r--r--includes/components/wakeup.inc122
-rw-r--r--includes/fragments/dashboard.inc4
-rw-r--r--includes/reminder.php2
-rw-r--r--includes/util/homepage.inc6
-rw-r--r--pages/alerts.inc7
-rw-r--r--pages/api/emergency-real.php31
-rw-r--r--pages/api/emergency.php31
-rw-r--r--pages/api/pleasure-real.php23
-rw-r--r--pages/api/pleasure.php23
-rw-r--r--pages/docs.inc423
-rw-r--r--pages/emergency.inc4
-rw-r--r--pages/money.inc4
-rw-r--r--pages/pleasure.inc6
-rw-r--r--pages/wakeup.inc15
18 files changed, 160 insertions, 771 deletions
diff --git a/assets/logo/custom-2023.css b/assets/logo/custom-2023.css
index 85b3266..4d296f5 100644
--- a/assets/logo/custom-2023.css
+++ b/assets/logo/custom-2023.css
@@ -974,11 +974,6 @@ body {
margin-left: 300px;
}
-.modal.show {
- left: 300px;
- width: calc(100% - 300px);
-}
-
.modal {
left: 150px;
}
diff --git a/includes/components/2023ui.inc b/includes/components/2023ui.inc
index d0792ec..40c2d00 100644
--- a/includes/components/2023ui.inc
+++ b/includes/components/2023ui.inc
@@ -210,15 +210,9 @@
</a>
<?php if ($isLoggedIn): ?>
- <div class="mobile-hide" style="margin: 10px 0; width: 48px; height: 2px; background-color: var(--palette-2);"></div>
- <div class="mobile-show" style="display: none; margin: 0 10px; height: 48px; width: 2px; background-color: var(--palette-2); vertical-align: middle;"></div>
-
<a data-bs-toggle="tooltip" data-bs-placement="right" title="Money tracker" class="ui2023-side-bar-item" href="/-/money" style="padding: 10px; height: 48px; width: 48px; display: block; border-radius: 999px;">
<img src="<?= icon("money") ?>" style="max-width: 28px; max-height: 28px;">
</a>
- <a data-bs-toggle="tooltip" data-bs-placement="right" title="Documents" class="ui2023-side-bar-item" href="/-/docs" style="padding: 10px; height: 48px; width: 48px; display: block; border-radius: 999px;">
- <img src="<?= icon("documents") ?>" style="max-width: 28px; max-height: 28px;">
- </a>
<a data-bs-toggle="tooltip" data-bs-placement="right" title="System travelling" class="ui2023-side-bar-item" href="/-/travelling" style="padding: 10px; height: 48px; width: 48px; display: block; border-radius: 999px;">
<img src="<?= icon("travelling") ?>" style="max-width: 28px; max-height: 28px;">
</a>
diff --git a/includes/components/emergency.inc b/includes/components/emergency.inc
index 0a1401c..03d468c 100644
--- a/includes/components/emergency.inc
+++ b/includes/components/emergency.inc
@@ -6,9 +6,25 @@
</h2>
<span data-bs-toggle="modal" data-bs-target="#turn-on" id="btn-on" style="background: #7f0000;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;display: block;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>ON</b></span>
-<span data-bs-toggle="modal" data-bs-target="#turn-off" id="btn-off" style="display:none;background: #007f0b;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>OFF</b></span>
+<span data-bs-toggle="modal" onclick="disableAlert();" id="btn-off" style="display:none;background: #007f0b;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>OFF</b></span>
<p style="text-align:center;margin-top:10px;">Sending next notification <b><span id="next-notification">never</span></b></p>
+<hr>
+
+<div style="margin-bottom: 10px;">
+ <b>Targets:</b>
+</div>
+
+<label style="display: block; margin-left: 10px;">
+ <input type="checkbox" checked id="enable-raindrops"> Raindrops System
+</label>
+<label style="display: block; margin-left: 10px;">
+ <input type="checkbox" id="enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>"> <?= $GLOBALS["ColdHazeApp"]["other"]["name"] ?>
+</label>
+<label style="display: block; margin-left: 10px;">
+ <input type="checkbox" id="enable-moonglow"> Moonglow
+</label>
+
<style>
<?php global $use2023UI; if (!$use2023UI): ?>
.modal-header {
@@ -31,78 +47,25 @@
}
</style>
-<div class="modal" id="turn-on">
+<div class="modal fade" id="turn-on">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
- <h4 class="modal-title">This is to be treated seriously.</h4>
+ <h4 class="modal-title">Important notice</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="alert alert-danger">
- <b>WARNING:</b> This alert should be used IF AND ONLY IF you are in a situation that requires immediate help from a loved one. If your life is at immediate risk, please do not use this emergency system and call your local emergency services.
- </div>
- <div class="alert alert-danger">
Keep this page open until you receive help. If you close the page, alert notifications will not be sent.
</div>
- <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-danger" style="font-size:20px;font-weight:bold;display:block;width:100%;">I understand the risk, enable the alert now.</button>
-
- <hr>
-
- <div class="alert alert-danger">
- Once enabled, disable the alert system ONLY once you are safe. <b>Your mental health is more important than sleep.</b>
- </div>
+ <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-danger" style="font-size:20px;font-weight:bold;display:block;width:100%;">Enable the alert now.</button>
- <div class="alert alert-warning">
- This emergency alert system is designed to make sure a loved one can get in touch with you as soon as possible. Therefore, it will emit sudden alerts, and may surprise somepony if e.g. they are sleeping. Keep that in mind.
+ <div class="alert alert-light" style="margin-top: 20px;">
+ <b>Disclaimer:</b> This alert should be used <b>if and only if</b> you are in a situation that requires immediate help from a loved one. If your life is at immediate risk, please do not use this emergency system and call your local emergency services.
</div>
-
- <p>
- <b>Disclaimer:</b> This emergency alert system MUST NOT be used in life-threatening situations. Although it has been extensively tested in multiple conditions, it may stop working correctly or stop working at all at any time and without warning. If your life is at immediate risk, call your local emergency services.
- </p>
- <p>
- © <?= date('Y') ?> Equestria.dev
- </p>
- </div>
- </div>
- </div>
-</div>
-
-<div class="modal" id="turn-off">
- <div class="modal-dialog">
- <div class="modal-content">
-
- <div class="modal-header">
- <h4 class="modal-title">Make sure you are safe.</h4>
- <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
- </div>
-
- <div class="modal-body">
- <div class="alert alert-danger">
- Make sure you are safe, and you got in touch with a loved one before disabling this alert system. It can be re-enabled later at any time. Remember, <b>your mental health is more important than sleep.</b>
- </div>
-
- <p class="text-muted">
- Scroll until the bottom of the page to disable the alert.
- </p>
-
- <p>
- <b>Read this if you want to disable the alert before receiving help:</b> Remember you are loved, cared for. Ponies rely on you, need you, love you. We never want to lose any of you, so please, keep the alert enabled until you are safe. If you are unsure, always keep the alert enabled.
- </p>
- <p>
- <b>Disclaimer:</b> This emergency alert system MUST NOT be used in life-threatening situations. Although it has been extensively tested in multiple conditions, it may stop working correctly or stop working at all at any time and without warning. If your life is at immediate risk, call your local emergency services.
- </p>
- <p>
- This service makes use of the ntfy platform, provided by a third party. Do note that their privacy policy applies when delivering the notifications; although they should not contain personal information in any way.
- </p>
- <p>
- © <?= date('Y') ?> Equestria.dev
- </p>
-
- <button id="disable-button" onclick="disableAlert();" data-bs-dismiss="modal" class="btn btn-success disabled" style="display:block;width:100%;">I am safe, disable the alert now. <span id="disable-timer">(X)</span></button>
</div>
</div>
</div>
@@ -110,40 +73,18 @@
<script>
window.alertInterval = null;
- window.alertDisablerCounter = 9;
- window.alertDisablerEnabled = false;
- window.alertDisablerCounterInterval = null;
window.alertInterval = null;
window.alertIntervalAmount = 15;
window.alertIntervalCounter = window.alertIntervalAmount;
- setInterval(() => {
- if (document.getElementById("turn-off").offsetWidth > 0 || document.getElementById("turn-off").offsetHeight > 0) {
- if (!window.alertDisablerEnabled) {
- window.alertDisablerEnabled = true;
- window.alertDisablerCounter = 9;
-
- document.getElementById("disable-timer").innerText = "(" + window.alertDisablerCounter + ")";
- document.getElementById("disable-button").classList.add("disabled");
-
- window.alertDisablerCounterInterval = setInterval(() => {
- window.alertDisablerCounter--;
-
- if (window.alertDisablerCounter > 0) {
- document.getElementById("disable-timer").innerText = "(" + window.alertDisablerCounter + ")";
- document.getElementById("disable-button").classList.add("disabled");
- } else {
- document.getElementById("disable-timer").innerText = "";
- document.getElementById("disable-button").classList.remove("disabled");
- }
- }, 1000);
- }
- } else {
- window.alertDisablerEnabled = false;
- try { clearInterval(window.alertDisablerCounterInterval) } catch (e) {}
- window.alertDisablerCounter = 9;
- }
- });
+ function buildTargets() {
+ let targets = [
+ document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").checked ? "<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>" : null,
+ document.getElementById("enable-raindrops").checked ? "raindrops" : null,
+ document.getElementById("enable-moonglow").checked ? "moonglow" : null,
+ ].filter(i => i);
+ return "?" + targets.join("&");
+ }
function sendNotification() {
window.alertIntervalCounter = -1;
@@ -154,7 +95,7 @@
window.alertIntervalCounter = window.alertIntervalAmount;
document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
} else {
- window.fetch("/api/emergency").then(() => {
+ window.fetch("/api/emergency" + buildTargets()).then(() => {
window.alertIntervalCounter = window.alertIntervalAmount;
document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
})
@@ -165,7 +106,7 @@
window.alertIntervalCounter = window.alertIntervalAmount;
document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
} else {
- window.fetch("/api/emergency-real").then(() => {
+ window.fetch("/api/emergency-real" + buildTargets()).then(() => {
window.alertIntervalCounter = window.alertIntervalAmount;
document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
})
@@ -179,6 +120,9 @@
document.getElementById("btn-off").style.display = "block";
document.getElementById("test-mode").disabled = true;
document.getElementById("fake-requests").disabled = true;
+ document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").disabled = true;
+ document.getElementById("enable-raindrops").disabled = true;
+ document.getElementById("enable-moonglow").disabled = true;
window.alertInterval = setInterval(() => {
window.alertIntervalCounter--;
@@ -199,5 +143,8 @@
document.getElementById("btn-off").style.display = "none";
document.getElementById("test-mode").disabled = false;
document.getElementById("fake-requests").disabled = false;
+ document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").disabled = false;
+ document.getElementById("enable-raindrops").disabled = false;
+ document.getElementById("enable-moonglow").disabled = false;
}
</script> \ No newline at end of file
diff --git a/includes/components/pleasure.inc b/includes/components/pleasure.inc
index 5749bd7..9d2825c 100644
--- a/includes/components/pleasure.inc
+++ b/includes/components/pleasure.inc
@@ -49,6 +49,22 @@
<span onclick="disableAlert()" id="btn-off" style="display:none;background: #007f0b;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>OFF</b></span>
<p style="text-align:center;margin-top:10px;">Sending next notification <b><span id="next-notification">never</span></b> · Local time for Raindrops: <span id="raindrops-time">--:--</span></p>
+<hr>
+
+<div style="margin-bottom: 10px;">
+ <b>Targets:</b>
+</div>
+
+<label style="display: block; margin-left: 10px;">
+ <input type="radio" name="target" checked id="enable-raindrops"> Raindrops System
+</label>
+<label style="display: block; margin-left: 10px;">
+ <input type="radio" name="target" id="enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>"> <?= $GLOBALS["ColdHazeApp"]["other"]["name"] ?>
+</label>
+<label style="display: block; margin-left: 10px;">
+ <input type="radio" name="target" id="enable-moonglow"> Moonglow
+</label>
+
<script>
function updateTime() {
let time = (new Intl.DateTimeFormat("en-US", {
@@ -90,30 +106,25 @@
}
</style>
-<div class="modal" id="turn-on">
+<div class="modal fade" id="turn-on">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
- <h4 class="modal-title">Somepony will be awoken.</h4>
+ <h4 class="modal-title">Important notice</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
- <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-success" style="font-size:20px;font-weight:bold;display:block;width:100%;">I wish to proceed.</button>
+ <div class="alert alert-danger">
+ Keep this page open until your pony wakes up. If you close the page, alert notifications will not be sent.
+ </div>
- <hr>
+ <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-danger" style="font-size:20px;font-weight:bold;display:block;width:100%;">Enable the alert now.</button>
- <div class="alert alert-warning">
- This alert system is designed to emit sudden alerts, and may surprise somepony if e.g. they are sleeping. Keep that in mind.
+ <div class="alert alert-light" style="margin-top: 20px;">
+ <b>Disclaimer:</b> This alert is not to be used in an emergency. If you need immediate help, use the <a href="/-/emergency">Emergency alert</a> instead.
</div>
-
- <p>
- <b>Disclaimer:</b> This is NOT an emergency alert system, use the "Emergency alert" option is you need immediate help and comfort.
- </p>
- <p>
- © <?= date('Y') ?> Equestria.dev
- </p>
</div>
</div>
</div>
@@ -124,6 +135,15 @@
window.alertIntervalAmount = 5;
window.alertIntervalCounter = window.alertIntervalAmount;
+ function buildTargets() {
+ let targets = [
+ document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").checked ? "<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>" : null,
+ document.getElementById("enable-raindrops").checked ? "raindrops" : null,
+ document.getElementById("enable-moonglow").checked ? "moonglow" : null,
+ ].filter(i => i);
+ return "?" + targets.join("&");
+ }
+
function sendNotification() {
window.alertIntervalCounter = -1;
@@ -133,7 +153,7 @@
window.alertIntervalCounter = window.alertIntervalAmount;
document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
} else {
- window.fetch("/api/pleasure").then(() => {
+ window.fetch("/api/pleasure" + buildTargets()).then(() => {
window.alertIntervalCounter = window.alertIntervalAmount;
document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
})
@@ -144,7 +164,7 @@
window.alertIntervalCounter = window.alertIntervalAmount;
document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
} else {
- window.fetch("/api/pleasure-real").then(() => {
+ window.fetch("/api/pleasure-real" + buildTargets()).then(() => {
window.alertIntervalCounter = window.alertIntervalAmount;
document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
})
@@ -158,6 +178,9 @@
document.getElementById("btn-off").style.display = "block";
document.getElementById("test-mode").disabled = true;
document.getElementById("fake-requests").disabled = true;
+ document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").disabled = true;
+ document.getElementById("enable-raindrops").disabled = true;
+ document.getElementById("enable-moonglow").disabled = true;
window.alertInterval = setInterval(() => {
window.alertIntervalCounter--;
@@ -177,37 +200,8 @@
document.getElementById("btn-off").style.display = "none";
document.getElementById("test-mode").disabled = false;
document.getElementById("fake-requests").disabled = false;
+ document.getElementById("enable-<?= $GLOBALS["ColdHazeApp"]["other"]["slug"] ?>").disabled = false;
+ document.getElementById("enable-raindrops").disabled = false;
+ document.getElementById("enable-moonglow").disabled = false;
}
-</script>
-
-<?php if ($_PROFILE["login"] !== "cloudburst"): ?>
-<hr>
-
-<p><?= $_PROFILE["login"] === "raindrops" ? "These ponies will have sex with " . $app["other"]["name"] : "These ponies will have sex with you" ?>:</p>
-<ul>
- <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === "gdapd" && isset($pony["_metadata"]["other"]) && $pony["_metadata"]["other"]): ?>
- <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a> (<?= $pony["_metadata"]["sexually_active"] ? "no consent is required" : "consent is mandatory" ?>)</li>
- <?php endif; endforeach; ?>
-</ul>
-
-<p><?= $_PROFILE["login"] === "raindrops" ? "These ponies may have sex with " . $app["other"]["name"] . " but are unsure about it" : "These ponies may have sex with you but are unsure about it" ?>:</p>
-<ul>
- <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === "gdapd" && isset($pony["_metadata"]["other2"]) && $pony["_metadata"]["other2"]): ?>
- <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li>
- <?php endif; endforeach; ?>
-</ul>
-
-<p><?= $_PROFILE["login"] === "raindrops" ? "These ponies will have sex with you" : "These ponies will have sex with Raindrops" ?>:</p>
-<ul>
- <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === $app["other"]["id"] && isset($pony["_metadata"]["other3"]) && $pony["_metadata"]["other3"]): ?>
- <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li>
- <?php endif; endforeach; ?>
-</ul>
-
-<p><?= $_PROFILE["login"] === "raindrops" ? "These ponies may have sex with you but are unsure about it" : "These ponies may have sex with Raindrops but are unsure about it" ?>:</p>
-<ul>
- <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === $app["other"]["id"] && isset($pony["_metadata"]["other4"]) && $pony["_metadata"]["other4"]): ?>
- <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li>
- <?php endif; endforeach; ?>
-</ul>
-<?php endif; ?>
+</script> \ No newline at end of file
diff --git a/includes/components/wakeup.inc b/includes/components/wakeup.inc
deleted file mode 100644
index 994bbdc..0000000
--- a/includes/components/wakeup.inc
+++ /dev/null
@@ -1,122 +0,0 @@
-<h2>Wake-up alert
- <details style="display: inline-block;font-size:12px;">
- <summary class="text-muted" style="opacity:.5;"></summary>
- <label><input id="test-mode" type="checkbox"> Test Mode</label> · <label><input id="fake-requests" type="checkbox"> Fake Requests</label>
- </details>
-</h2>
-
-<span data-bs-toggle="modal" data-bs-target="#turn-on" id="btn-on" style="background: #7f0000;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;display: block;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>ON</b></span>
-<span onclick="disableAlert()" id="btn-off" style="display:none;background: #007f0b;font-size: 48px;padding: 10px 50px;border-radius: 10px;width: max-content;margin-left: auto;margin-right: auto;cursor: pointer;">Turn <b>OFF</b></span>
-<p style="text-align:center;margin-top:10px;">Sending next notification <b><span id="next-notification">never</span></b></p>
-
-<style>
- <?php global $use2023UI; if (!$use2023UI): ?>
- .modal-header {
- border-bottom: 1px solid #353738;
- }
-
- .modal-content {
- border: 1px solid rgba(255, 255, 255, .2);
- background-color: #111;
- }
-
- .btn-close {
- filter: invert(1);
- }
- <?php endif; ?>
-
- #btn-on.disabled, #btn-off.disabled {
- opacity: .5;
- pointer-events: none;
- }
-</style>
-
-<div class="modal" id="turn-on">
- <div class="modal-dialog">
- <div class="modal-content">
-
- <div class="modal-header">
- <h4 class="modal-title">Somepony will be awoken.</h4>
- <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
- </div>
-
- <div class="modal-body">
- <button onclick="enableAlert();" data-bs-dismiss="modal" class="btn btn-success" style="font-size:20px;font-weight:bold;display:block;width:100%;">I wish to proceed.</button>
-
- <hr>
-
- <div class="alert alert-warning">
- This alert system is designed to emit sudden alerts, and may surprise somepony if e.g. they are sleeping. Keep that in mind.
- </div>
-
- <p>
- <b>Disclaimer:</b> This is NOT an emergency alert system, use the "Emergency alert" option is you need immediate help and comfort.
- </p>
- <p>
- © <?= date('Y') ?> Equestria.dev
- </p>
- </div>
- </div>
- </div>
-</div>
-
-<script>
- window.alertInterval = null;
- window.alertIntervalAmount = 5;
- window.alertIntervalCounter = window.alertIntervalAmount;
-
- function sendNotification() {
- window.alertIntervalCounter = -1;
-
- if (document.getElementById("test-mode").checked) {
- document.getElementById("next-notification").innerText = "now";
- if (document.getElementById("fake-requests").checked) {
- window.alertIntervalCounter = window.alertIntervalAmount;
- document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
- } else {
- window.fetch("/api/wakeup").then(() => {
- window.alertIntervalCounter = window.alertIntervalAmount;
- document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
- })
- }
- } else {
- document.getElementById("next-notification").innerText = "now";
- if (document.getElementById("fake-requests").checked) {
- window.alertIntervalCounter = window.alertIntervalAmount;
- document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
- } else {
- window.fetch("/api/wakeup-real").then(() => {
- window.alertIntervalCounter = window.alertIntervalAmount;
- document.getElementById("next-notification").innerText = "in " + window.alertIntervalAmount + " seconds";
- })
- }
- }
- }
-
- function enableAlert() {
- sendNotification();
- document.getElementById("btn-on").style.display = "none";
- document.getElementById("btn-off").style.display = "block";
- document.getElementById("test-mode").disabled = true;
- document.getElementById("fake-requests").disabled = true;
-
- window.alertInterval = setInterval(() => {
- window.alertIntervalCounter--;
-
- if (window.alertIntervalCounter === 0) {
- sendNotification();
- } else if (window.alertIntervalCounter > -1) {
- document.getElementById("next-notification").innerText = "in " + window.alertIntervalCounter + " second" + (window.alertIntervalCounter > 1 ? "s" : "");
- }
- }, 1000);
- }
-
- function disableAlert() {
- clearInterval(window.alertInterval);
- document.getElementById("next-notification").innerText = "never";
- document.getElementById("btn-on").style.display = "block";
- document.getElementById("btn-off").style.display = "none";
- document.getElementById("test-mode").disabled = false;
- document.getElementById("fake-requests").disabled = false;
- }
-</script> \ No newline at end of file
diff --git a/includes/fragments/dashboard.inc b/includes/fragments/dashboard.inc
index 7aa61d6..bb58df1 100644
--- a/includes/fragments/dashboard.inc
+++ b/includes/fragments/dashboard.inc
@@ -240,8 +240,8 @@ global $use2023UI;
<a href="/moonglow" class="list-group-item list-group-item-action" style="display: flex; align-items: center;">
<img src="/assets/avatars/d1cd97eb9c924e4294cd4397a5074ff9.webp" style="margin-right: 5px; width: 24px;"><div style="vertical-align: middle; display: flex; align-items: center; color: var(--bs-body-color);">Moonglow</div>
</a>
- <a href="/-/wakeup" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;">
- <img src="/assets/icons/new/wakeup.svg?color=474747" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">Wake-up alert</div>
+ <a href="/-/emergency" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;">
+ <img src="/assets/icons/new/emergency.svg?color=474747" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">Emergency alert</div>
</a>
<a href="/-/byfront" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;">
<img src="/assets/icons/new/front.svg?color=474747" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">By last fronted date</div>
diff --git a/includes/reminder.php b/includes/reminder.php
index 34a9485..05b7bd5 100644
--- a/includes/reminder.php
+++ b/includes/reminder.php
@@ -1,6 +1,6 @@
<?php
-require_once './composer/vendor/autoload.php';
+;
$_SERVER['DOCUMENT_ROOT'] = "..";
require_once './util/functions.inc';
diff --git a/includes/util/homepage.inc b/includes/util/homepage.inc
index 497fe2e..a78c28d 100644
--- a/includes/util/homepage.inc
+++ b/includes/util/homepage.inc
@@ -20,12 +20,12 @@ function newHomepage($id, $page, $title) {
<div class="new-homepage-system-list" id="new-homepage-system-<?= $id ?>-list">
<?php $list = array_values(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $id . "/members.json"), true), $id), $id)); foreach ($list as $index => $member): ?>
<a href="/<?= $member["name"] ?>" class="new-homepage-link <?= $index === count($list) - 1 ? "new-homepage-link-last" : "" ?>" style="color: white; text-decoration: none !important; display: block; background-color: #<?= $member["color"] ?>22; padding: 5px 10px;">
- <img src="<?= getAsset(($travelling[$member["id"]]["travelling"] && !$travelling[$member["id"]]["equestria"]) ? ($id === "gdapd" ? "ynmuc" : "gdapd") : $id, $member["id"]) ?>" style="width: 32px; height: 32px; vertical-align: middle; background-color: rgba(0, 0, 0, .25); border-radius: 999px;">
+ <img src="<?= getAsset(isset($travelling[$member["id"]]) && ($travelling[$member["id"]]["travelling"] && !$travelling[$member["id"]]["equestria"]) ? ($id === "gdapd" ? "ynmuc" : "gdapd") : $id, $member["id"]) ?>" style="width: 32px; height: 32px; vertical-align: middle; background-color: rgba(0, 0, 0, .25); border-radius: 999px;">
<span style="width: calc(100% - 37px); vertical-align: middle; margin-left: 5px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;"><?= $member["display_name"] ?? $member["name"] ?></span>
<span style="vertical-align: middle; float:right;">
- <?php if ($travelling[$member["id"]]["travelling"] && $travelling[$member["id"]]["equestria"]): ?>
+ <?php if (isset($travelling[$member["id"]]) && $travelling[$member["id"]]["travelling"] && $travelling[$member["id"]]["equestria"]): ?>
<img src="/assets/logo/<?= $member["_metadata"]["fictive"] ? "equestria" : ($member["_metadata"]["fictive2"] ? "celeste" : "") ?>.png" style="width: 24px; height: 24px; margin-top: 5px;">
- <?php elseif ($travelling[$member["id"]]["travelling"]): ?>
+ <?php elseif (isset($travelling[$member["id"]]) && $travelling[$member["id"]]["travelling"]): ?>
<img src="<?= getAsset($id === "gdapd" ? "ynmuc" : "gdapd") ?>" style="width: 24px; height: 24px; margin-top: 5px;">
<?php endif; ?>
</span>
diff --git a/pages/alerts.inc b/pages/alerts.inc
index ec6c988..46d514d 100644
--- a/pages/alerts.inc
+++ b/pages/alerts.inc
@@ -2,6 +2,7 @@
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $_PROFILE; global $isLowerLoggedIn;
+if ($_PROFILE["login"] === "cloudburst") die();
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
<br>
@@ -24,11 +25,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
}, 1000);
</script><?php endif; ?>
</a>
- <?php if (!$isLowerLoggedIn): ?>
- <a href="/-/wakeup" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;">
- <img src="<?= icon('wakeup', null, true) ?>" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">Wake-up alert</div>
- </a>
- <?php endif; if ($_PROFILE["login"] !== "Moonwind"): ?>
+ <?php if ($isLowerLoggedIn || $_PROFILE["login"] === "raindrops"): ?>
<a href="/-/pleasure" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;">
<img src="<?= icon('pleasure', null, true) ?>" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">Pleasure alert</div>
</a>
diff --git a/pages/api/emergency-real.php b/pages/api/emergency-real.php
index a67f549..700a6a7 100644
--- a/pages/api/emergency-real.php
+++ b/pages/api/emergency-real.php
@@ -1,6 +1,7 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; global $_PROFILE;
+if ($_PROFILE["login"] === "cloudburst") die();
if (!$isLoggedIn && !$isLowerLoggedIn) {
header("Location: /-/login");
@@ -10,31 +11,27 @@ if (!$isLoggedIn && !$isLowerLoggedIn) {
global $_PROFILE;
$ntfy = $GLOBALS["ColdHazeApp"]["ntfy"];
+$channels = [];
-file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy["topic"], false, stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: " . formatPonypush("⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" .
- "Priority: urgent\r\n" .
- "Tags: emergency\r\n" .
- "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!")
- ]
-]));
+if (isset($_GET["raindrops"])) $channels[] = "emergency-raindrops";
+if (isset($_GET["moonglow"])) $channels[] = "emergency-moonglow";
+if (isset($_GET[$GLOBALS["ColdHazeApp"]["other"]["slug"]])) $channels[] = "emergency";
-file_get_contents('https://' . $ntfy["server"] . '/emergency', false, stream_context_create([
+$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' =>
"Content-Type: text/plain\r\n" .
- "Title: " . formatPonypush("⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" .
+ "Title: " . formatPonypush("⚠️ Emergency alert") . "\r\n" .
"Priority: urgent\r\n" .
"Tags: emergency\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!")
+ 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of immediate help. Please act now!")
]
-]));
+]);
+
+foreach ($channels as $channel) {
+ file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context);
+}
die(); \ No newline at end of file
diff --git a/pages/api/emergency.php b/pages/api/emergency.php
index 24c975a..a8a6e20 100644
--- a/pages/api/emergency.php
+++ b/pages/api/emergency.php
@@ -1,6 +1,7 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; global $_PROFILE;
+if ($_PROFILE["login"] === "cloudburst") die();
if (!$isLoggedIn && !$isLowerLoggedIn) {
header("Location: /-/login");
@@ -10,31 +11,27 @@ if (!$isLoggedIn && !$isLowerLoggedIn) {
global $_PROFILE;
$ntfy = $GLOBALS["ColdHazeApp"]["ntfy"];
+$channels = [];
-file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy["topic"], false, stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: " . formatPonypush("[Test] ⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" .
- "Priority: urgent\r\n" .
- "Tags: emergency\r\n" .
- "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]")
- ]
-]));
+if (isset($_GET["raindrops"])) $channels[] = "emergency-raindrops";
+if (isset($_GET["moonglow"])) $channels[] = "emergency-moonglow";
+if (isset($_GET[$GLOBALS["ColdHazeApp"]["other"]["slug"]])) $channels[] = "emergency";
-file_get_contents('https://' . $ntfy["server"] . '/emergency', false, stream_context_create([
+$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' =>
"Content-Type: text/plain\r\n" .
- "Title: " . formatPonypush("[Test] ⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" .
+ "Title: " . formatPonypush("[Test] ⚠️ Emergency alert") . "\r\n" .
"Priority: urgent\r\n" .
"Tags: emergency\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]")
+ 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of immediate help. Please act now! [This notification is test]")
]
-]));
+]);
+
+foreach ($channels as $channel) {
+ file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context);
+}
die(); \ No newline at end of file
diff --git a/pages/api/pleasure-real.php b/pages/api/pleasure-real.php
index b523c1a..adfe732 100644
--- a/pages/api/pleasure-real.php
+++ b/pages/api/pleasure-real.php
@@ -1,6 +1,7 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; global $_PROFILE;
+if ($_PROFILE["login"] === "cloudburst") die();
if (!$isLoggedIn && !$isLowerLoggedIn) {
header("Location: /-/login");
@@ -11,18 +12,26 @@ global $_PROFILE;
$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"];
$frontOther = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/fronters.json"), true)["members"];
+$frontMoonglow = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/hrbom/fronters.json"), true)["members"];
if ($_PROFILE["login"] === "raindrops" && isset($frontRaindrops[0])) {
$pony = $frontRaindrops[0]["display_name"] ?? $frontRaindrops[0]["name"];
-} else if ($_PROFILE["login"] !== "raindrops" && isset($frontOther[0])) {
+} else if ($_PROFILE["login"] === "Moonwind" && isset($frontMoonglow[0])) {
+ $pony = $frontMoonglow[0]["display_name"] ?? $frontMoonglow[0]["name"];
+} else if ($_PROFILE["login"] !== "raindrops" && $_PROFILE["login"] !== "Moonwind" && isset($frontOther[0])) {
$pony = $frontOther[0]["display_name"] ?? $frontOther[0]["name"];
} else {
$pony = "somepony";
}
$ntfy = $GLOBALS["ColdHazeApp"]["ntfy"];
+$channels = [];
-file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_context_create([
+if (isset($_GET["raindrops"])) $channels[] = "emergency-raindrops";
+if (isset($_GET["moonglow"])) $channels[] = "emergency-moonglow";
+if (isset($_GET[$GLOBALS["ColdHazeApp"]["other"]["slug"]])) $channels[] = "pleasure";
+
+$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' =>
@@ -31,8 +40,12 @@ file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_cont
"Priority: high\r\n" .
"Tags: pleasure\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => formatPonypush("Hey, $pony wants to play and have fun for a bit, get up!")
+ 'content' => formatPonypush("Hey, $pony wants to play and have fun with you, get up!")
]
-]));
+]);
+
+foreach ($channels as $channel) {
+ file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context);
+}
die(); \ No newline at end of file
diff --git a/pages/api/pleasure.php b/pages/api/pleasure.php
index 58def71..7d331ce 100644
--- a/pages/api/pleasure.php
+++ b/pages/api/pleasure.php
@@ -1,6 +1,7 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; global $_PROFILE;
+if ($_PROFILE["login"] === "cloudburst") die();
if (!$isLoggedIn && !$isLowerLoggedIn) {
header("Location: /-/login");
@@ -11,18 +12,26 @@ global $_PROFILE;
$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"];
$frontOther = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/fronters.json"), true)["members"];
+$frontMoonglow = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/hrbom/fronters.json"), true)["members"];
if ($_PROFILE["login"] === "raindrops" && isset($frontRaindrops[0])) {
$pony = $frontRaindrops[0]["display_name"] ?? $frontRaindrops[0]["name"];
-} else if ($_PROFILE["login"] !== "raindrops" && isset($frontOther[0])) {
+} else if ($_PROFILE["login"] === "Moonwind" && isset($frontMoonglow[0])) {
+ $pony = $frontMoonglow[0]["display_name"] ?? $frontMoonglow[0]["name"];
+} else if ($_PROFILE["login"] !== "raindrops" && $_PROFILE["login"] !== "Moonwind" && isset($frontOther[0])) {
$pony = $frontOther[0]["display_name"] ?? $frontOther[0]["name"];
} else {
$pony = "somepony";
}
$ntfy = $GLOBALS["ColdHazeApp"]["ntfy"];
+$channels = [];
-file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_context_create([
+if (isset($_GET["raindrops"])) $channels[] = "emergency-raindrops";
+if (isset($_GET["moonglow"])) $channels[] = "emergency-moonglow";
+if (isset($_GET[$GLOBALS["ColdHazeApp"]["other"]["slug"]])) $channels[] = "pleasure";
+
+$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' =>
@@ -31,8 +40,12 @@ file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_cont
"Priority: high\r\n" .
"Tags: pleasure\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => formatPonypush("[This is a test] Hey, $pony wants to play and have fun for a bit, get up!")
+ 'content' => formatPonypush("[This notification is a test] Hey, $pony wants to play and have fun with you, get up! [This notification is a test]")
]
-]));
+]);
+
+foreach ($channels as $channel) {
+ file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context);
+}
die(); \ No newline at end of file
diff --git a/pages/docs.inc b/pages/docs.inc
deleted file mode 100644
index 403a4f9..0000000
--- a/pages/docs.inc
+++ /dev/null
@@ -1,423 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $_PROFILE;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/random.inc";
-
-$parts = explode("/", $_GET['_']);
-$select = $parts[2] ?? null;
-
-if ($select === "add") {
- $id = random();
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $id . ".json", json_encode([
- "name" => "Untitled document ($id)",
- "category" => null,
- "contents" => "This is a new document you just created.",
- "last" => [
- "author" => $_PROFILE["login"],
- "date" => time()
- ]
- ]));
-
- header("Location: /-/docs/$id");
- die();
-} elseif (isset($select)) {
- if (ctype_alnum($select) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json")) {
- $id = $_documentId = $select;
- $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $select . ".json"), true);
- $titleBase = " · " . $title . " · Ponycule";
- $title = $data["name"] . " · " . $title;
- } else {
- header("Location: /-/docs");
- die();
- }
-}
-
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
-
-function showDocument($item) { ?>
- <div style="display: grid; grid-template-columns: 2fr repeat(3, 1fr);">
- <span>
- <?= $item["name"] ?>
- <?php if (isset($item["nsfw"]) && $item["nsfw"]): ?>
- <span class="badge bg-danger rounded-pill">NSFW</span>
- <?php endif; ?>
- </span>
- <?php if (str_starts_with(strip_tags($item["contents"]), "/delete")): ?>
- <span class="badge bg-warning rounded-pill text-black" style="width: max-content;">Deleting in <?= round((($item["last"]["date"] + 86400) - time()) / 3600) ?> hours</span>
- <?php else: ?>
- <span class="text-muted"><?= prettySize(filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $item["id"] . ".json")) ?></span>
- <span class="relative-time text-muted" data-relative-timestamp="<?= $item["last"]["date"] ?>"><?= timeAgo($item["last"]["date"]) ?></span>
- <span class="text-muted"><?= $item["last"]["author"] === "raindrops" ? "Raindrops System" : "Cloudburst System" ?></span>
- <?php endif; ?>
- </div>
-<?php }
-
-?>
-
-<br>
-<div class="container">
- <div>
- <?php if (isset($data)): ?><div id="page-content">
- <h2>
- <span contenteditable="true" id="document-name" style="outline: none;"><?= $data["name"] ?></span>
- <a href="/-/docs" class="small btn btn-outline-light" style="float:right;margin-top:5px;vertical-align:middle;opacity:1 !important; color:white;">Back</a>
- </h2>
- <p><b>Category:</b> <span id="category" contenteditable="true" style="outline: none;"><?= $data["category"] ?? "Unsorted" ?></span> · <label style="margin-bottom:5px;">
- <input <?= (isset($data["nsfw"]) && $data["nsfw"]) ? "checked" : "" ?> class="form-check-input" type="checkbox" id="explicit">
- Explicit
- </label></p>
- <p>
- <?php if ($data["last"]["date"] === 0): ?>
- Last modified <span id="last-edit-time" class="relative-time" data-relative-timestamp="">never</span>
- <?php else: ?>
- Last modified <span id="last-edit-time" class="relative-time" data-relative-timestamp="<?= $data["last"]["date"] ?>"><?= timeAgo($data["last"]["date"]) ?></span>
- <?php if ($data["last"]["author"] !== $_PROFILE["login"]): ?>
- <span id="last-edit-author">by <?= $data["last"]["author"] === "raindrops" ? "the Raindrops System" : "the Cloudburst System" ?></span>
- <?php endif; ?>
- <?php endif; ?>
- · <span id="editor-save-status" class="text-muted">Saved</span>
- </p>
-
- <?php $timeDiff = round((1800 - (time() - $data["last"]["date"])) / 60); if ($timeDiff >= 0 && $data["last"]["author"] !== $_PROFILE["login"]): ?>
- <div class="alert alert-warning">
- <b>This document is currently in use by <?= $data["last"]["author"] === "raindrops" ? "the Raindrops System" : "the Cloudburst System" ?>.</b> It has been open in read-only to prevent conflicts with the changes they make. If they stopped editing the document, it will become editable for you after you refresh the page in <?= $timeDiff ?> minute<?= $timeDiff > 1 ? "s" : "" ?>.
- </div>
- <?= $data["contents"] ?>
- <?php else: ?>
- <textarea id="editor"><?= $data["contents"] ?></textarea>
-
- <script src="/assets/editor/editor.js"></script>
- <script>
- let editor;
- ClassicEditor
- .create( document.querySelector( '#editor' ), {
- toolbar: [
- 'undo', 'redo', '|', 'removeFormat', '|', 'heading', '|', 'fontSize', 'fontColor', 'fontBackgroundColor', 'alignment', '|', 'bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|', 'code', '|', 'outdent', 'indent', '|', 'bulletedList', 'numberedList', '|', 'link', 'imageUpload', 'mediaEmbed', 'blockQuote', 'insertTable', 'codeBlock', '|', 'horizontalLine'
- ]
- } )
-
- .then( newEditor => {
- editor = newEditor;
- } )
- .catch( error => {
- console.error( error );
- } );
- </script>
- <!--suppress CssUnresolvedCustomProperty -->
- <style>
- :root {
- --ck-color-base-background: transparent;
- }
-
- .ck-toolbar {
- filter: invert(1);
- border-bottom-left-radius: var(--ck-border-radius) !important;
- border-bottom-right-radius: var(--ck-border-radius) !important;
- border-bottom-width: 1px !important;
- }
-
- .ck-tooltip__text {
- color: white !important;
- }
-
- .ck-dropdown__panel {
- background: #ddd !important;
- }
-
- .ck-color-grid__tile {
- filter: invert(1);
- }
-
- .ck-balloon-rotator {
- background-color: #ccc !important;
- }
-
- .ck-balloon-panel {
- filter: invert(1);
- }
-
- .ck-editor__editable {
- border-color: transparent !important;
- }
-
- .ck.ck-sticky-panel__content_sticky {
- top: 59px !important;
- }
- </style>
- <script>
-
- let titleBase = "<?= $titleBase ?>";
- let lastSavedData = getData();
- let lastFetchedData = getData();
- let timeSinceLastModified = 0;
- let saving = false;
-
- async function save() {
- let data = editor.getData();
- document.getElementById("editor-save-status").innerHTML = "Saving...";
- document.getElementById("editor-save-status").classList.remove("text-danger");
- document.getElementById("editor-save-status").classList.remove("text-muted");
- document.getElementById("editor-save-status").classList.remove("text-warning");
- document.getElementById("editor-save-status").classList.add("text-primary");
- saving = true;
-
- try {
- await window.fetch("/api/docs?id=<?= $_documentId ?>", {
- method: "POST",
- body: JSON.stringify({ content: data, name: document.getElementById("document-name").innerText, category: document.getElementById("category").innerText, explicit: document.getElementById("explicit").checked })
- });
- document.getElementById("last-edit-time").setAttribute("data-relative-timestamp", (new Date().getTime() / 1000).toFixed(0));
- if (document.getElementById("last-edit-author")) document.getElementById("last-edit-author").outerHTML = "";
- document.title = document.getElementById("document-name").innerText + titleBase;
- document.getElementById("editor-save-status").innerHTML = "Saved";
- document.getElementById("editor-save-status").classList.remove("text-danger");
- document.getElementById("editor-save-status").classList.add("text-muted");
- document.getElementById("editor-save-status").classList.remove("text-warning");
- document.getElementById("editor-save-status").classList.remove("text-primary");
- lastSavedData = getData();
- saving = false;
- } catch (e) {
- console.error(e);
- document.getElementById("editor-save-status").innerHTML = "Failed to save";
- document.getElementById("editor-save-status").classList.add("text-danger");
- document.getElementById("editor-save-status").classList.remove("text-muted");
- document.getElementById("editor-save-status").classList.remove("text-warning");
- document.getElementById("editor-save-status").classList.remove("text-primary");
- }
- }
-
- document.onclick = async () => {
- if (saving) return;
-
- if (getData() !== lastSavedData) {
- await save();
- }
- }
-
- function getData() {
- return JSON.stringify({
- document: editor.getData(),
- name: document.getElementById("document-name").innerText,
- category: document.getElementById("category").innerText,
- explicit: document.getElementById("explicit").checked
- });
- }
-
- setInterval(async () => {
- if (saving) return;
-
- if (getData() !== lastSavedData) {
- document.getElementById("editor-save-status").innerHTML = "Modified";
- document.getElementById("editor-save-status").classList.remove("text-danger");
- document.getElementById("editor-save-status").classList.remove("text-muted");
- document.getElementById("editor-save-status").classList.add("text-warning");
- document.getElementById("editor-save-status").classList.remove("text-primary");
-
- if (getData() !== lastFetchedData) {
- lastFetchedData = getData();
- timeSinceLastModified = 0;
- } else {
- timeSinceLastModified++;
- }
-
- if (timeSinceLastModified > 20 || !document.hasFocus()) {
- await save();
- }
- } else {
- timeSinceLastModified = 0;
- }
- }, 100)
-
- </script>
- <?php endif; ?>
- </div><?php else: ?>
- <h2>Documents</h2>
- <div id="list">
- <?php
-
- $documents = array_map(function ($i) {
- return [
- "id" => substr($i, 0, -5),
- ...(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $i), true) ?? [])
- ];
- }, array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs"), function ($i) {
- return !str_starts_with($i, ".") && str_ends_with($i, ".json");
- }));
-
- $deletable = array_values(array_filter($documents, function ($i) {
- return str_starts_with(strip_tags($i["contents"]), "/delete");
- }));
- $unsorted_pre = array_values(array_filter($documents, function ($i) {
- return !str_starts_with(strip_tags($i["contents"]), "/delete");
- }));
-
- $categoryFirst = [];
- $unsorted = [];
- $categories = [];
- foreach ($unsorted_pre as $item) {
- if (isset($item["category"])) {
- $existing_categories = [...array_keys($categories), ...array_keys($categoryFirst)];
- $matched_category = null;
-
- foreach ($existing_categories as $existing_category) {
- if (levenshtein($item["category"], $existing_category) < 3) {
- $matched_category = $existing_category;
- }
- }
-
- $selected_category = $matched_category ?? $item["category"];
-
- if (str_starts_with($item["category"], ".")) {
- if (!isset($categoryFirst[$selected_category])) $categoryFirst[$selected_category] = [];
- $categoryFirst[$selected_category][] = $item;
- } else {
- if (!isset($categories[$selected_category])) $categories[$selected_category] = [];
- $categories[$selected_category][] = $item;
- }
- } else {
- $unsorted[] = $item;
- }
- }
-
- foreach ($categories as $category => $_) {
- uasort($categories[$category], function ($a, $b) {
- return preg_replace("/[^a-z\d]/m", "", strtolower($b["name"])) < preg_replace("/[^a-z\d]/m", "", strtolower($a["name"]));
- });
- }
-
- foreach ($categoryFirst as $category => $_) {
- uasort($categoryFirst[$category], function ($a, $b) {
- return preg_replace("/[^a-z\d]/m", "", strtolower($b["name"])) < preg_replace("/[^a-z\d]/m", "", strtolower($a["name"]));
- });
- }
-
- uasort($unsorted, function ($a, $b) {
- return preg_replace("/[^a-z\d]/m", "", strtolower($b["name"])) < preg_replace("/[^a-z\d]/m", "", strtolower($a["name"]));
- });
-
- uasort($deletable, function ($a, $b) {
- return preg_replace("/[^a-z\d]/m", "", strtolower($b["name"])) < preg_replace("/[^a-z\d]/m", "", strtolower($a["name"]));
- });
-
- $fullList = [...$categoryFirst, ...$categories];
-
- ?>
-
- <?php foreach ($fullList as $category => $items): if ($category != "Archives"): ?>
- <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 (str_starts_with(strip_tags($item["contents"]), "/delete")): ?>opacity-75<?php endif; ?>">
- <?php showDocument($item) ?>
- </a>
- <?php endforeach; ?></div>
- <hr>
- <?php endif; endforeach; ?>
-
- <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 (str_starts_with(strip_tags($item["contents"]), "/delete")): ?>opacity-75<?php endif; ?>">
- <?php showDocument($item) ?>
- </a>
- <?php endforeach; ?></div>
-
- <hr>
- <details>
- <summary>Show archives and marked for deletion</summary>
-
- <h4 style="margin-top: 10px;">Archives</h4>
- <div class="list-group">
- <?php foreach ($categories["Archives"] as $item): ?>
- <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; ?>">
- <?php showDocument($item) ?>
- </a>
- <?php endforeach; ?></div>
-
- <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 (str_starts_with(strip_tags($item["contents"]), "/delete")): ?>opacity-75<?php endif; ?>">
- <?php showDocument($item) ?>
- </a>
- <?php endforeach; ?></div>
- </details>
- </div>
-
- <hr>
- <div id="page-content">
- <a href="/-/docs/add">Create a new document</a>
- </div>
- <?php endif; ?>
- </div>
-</div>
-
-<script>
- setInterval(async () => {
- Array.from(document.getElementsByClassName("relative-time")).forEach((el) => {
- el.innerText = timeAgo(parseInt(el.getAttribute("data-relative-timestamp")) * 1000);
- })
- }, 1000)
-
- function timeAgo(time) {
- if (!isNaN(parseInt(time))) {
- time = new Date(time).getTime();
- }
-
- let periods = ["sec", "min", "hr", "d", "wk", "mo", "y", "ages"];
-
- let lengths = ["60", "60", "24", "7", "4.35", "12", "100"];
-
- let now = new Date().getTime();
-
- let difference = Math.round((now - time) / 1000);
- let tense;
- let period;
-
- if (difference <= 10 && difference >= 0) {
- return "now";
- } else if (difference > 0) {
- tense = "ago";
- } else {
- tense = "later";
- }
-
- let j;
-
- for (j = 0; difference >= lengths[j] && j < lengths.length - 1; j++) {
- difference /= lengths[j];
- }
-
- difference = Math.round(difference);
-
- period = periods[j];
-
- return `${difference} ${period} ${tense}`;
- }
-</script>
-<style>
- <?php global $use2023UI; if (!$use2023UI): ?>
- .list-group-item {
- color: #fff;
- background-color: #222;
- border: 1px solid rgba(255, 255, 255, .125);
- }
-
- .list-group-item.disabled {
- color: #fff;
- background-color: #222;
- border-color: rgba(255, 255, 255, .125);
- opacity: .75;
- }
-
- .list-group-item:hover {
- background-color: #252525;
- color: #ddd;
- }
-
- .list-group-item:active, .list-group-item:focus {
- background-color: #272727;
- color: #bbb;
- }
- <?php endif; ?>
-</style>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/emergency.inc b/pages/emergency.inc
index 244571b..e51b410 100644
--- a/pages/emergency.inc
+++ b/pages/emergency.inc
@@ -1,6 +1,8 @@
<?php
-$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
+$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $_PROFILE;
+
+if ($_PROFILE["login"] === "cloudburst") die();
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
diff --git a/pages/money.inc b/pages/money.inc
index d1651bc..881c618 100644
--- a/pages/money.inc
+++ b/pages/money.inc
@@ -241,6 +241,10 @@ function getMonthlyEarnings(): array {
<div>
<h2>Money tracker</h2>
+ <div class="alert alert-danger">
+ <b>The Ponycule money tracker is deprecated and will be removed.</b> Data currently in the money tracker will be moved to individual accounts on a dedicated money tracking application that Equestria.dev will not have control over.
+ </div>
+
<hr>
<?php
diff --git a/pages/pleasure.inc b/pages/pleasure.inc
index 883af9a..1a6e50a 100644
--- a/pages/pleasure.inc
+++ b/pages/pleasure.inc
@@ -1,11 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $_PROFILE; global $pages;
-
-if ($_PROFILE["id"] !== "0f3661dd-ff60-4cde-bf13-1b0a59e78f11" && $_PROFILE["id"] !== "ce1606a9-344f-4547-bffe-bc2ab0eebfa8") {
- header("Location: /");
- die();
-}
+if ($_PROFILE["login"] === "cloudburst") die();
$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
diff --git a/pages/wakeup.inc b/pages/wakeup.inc
deleted file mode 100644
index 43fa614..0000000
--- a/pages/wakeup.inc
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
-
-?>
-
-<br>
-<div class="container">
- <div id="page-content">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/wakeup.inc"; ?>
- </div>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>