diff options
author | RaindropsSys <raindrops@equestria.dev> | 2024-03-30 23:40:33 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2024-03-30 23:40:33 +0100 |
commit | 6b796258d413f00e498ce7f80f73a9f6c061f29c (patch) | |
tree | 49e64a5dd4cde2acff7f0a93ed3f8e20e1cb2dc8 /includes/fragments | |
parent | 5860551daa0f60103ad24e93da29f401a653f144 (diff) | |
download | pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.tar.gz pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.tar.bz2 pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.zip |
Updated 5 files, added 2 files, deleted 495 files and renamed 7 files (automated)
Diffstat (limited to 'includes/fragments')
-rw-r--r-- | includes/fragments/dashboard.inc | 239 | ||||
-rw-r--r-- | includes/fragments/member.inc | 204 | ||||
-rw-r--r-- | includes/fragments/system.inc | 44 |
3 files changed, 0 insertions, 487 deletions
diff --git a/includes/fragments/dashboard.inc b/includes/fragments/dashboard.inc deleted file mode 100644 index 9ad9372..0000000 --- a/includes/fragments/dashboard.inc +++ /dev/null @@ -1,239 +0,0 @@ -<?php - -if (isset($_GET["ec"])) { - header("HTTP/1.1 " . $_GET["ec"] . " Error"); -} - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; $title = "Dashboard"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly; global $isNormallyLoggedIn; global $_PROFILE; global $lang; global $pages; global $isLowerLoggedIn; global $app; global $isLoggedIn; - -global $use2023UI; - -?> - - <br> - <div class="container"> - <?php if (isset($_GET['em'])): ?> - <div class="alert alert-danger alert-dismissible"> - <button onclick='window.history.pushState({"html":null,"pageTitle":document.title},"", "/");' type="button" class="btn-close" data-bs-dismiss="alert"></button> - <b><?= $lang["home"]["error"] ?> </b><?= strip_tags(base64_decode($_GET['em'])) ?> - </div> - <?php endif; ?> - - <div class="alert alert-warning alert-dismissible" id="gpuWarning" style="display: none;"> - <button onclick='window.history.pushState({"html":null,"pageTitle":document.title},"", "/");' type="button" class="btn-close" data-bs-dismiss="alert"></button> - <b>GPU acceleration is turned off or not supported.</b> A lot of visual effects on this website rely on GPU acceleration, which is currently disabled on your browser, meaning the website's overall look will be affected. Please enable GPU acceleration in your browser settings. - </div> - - <div class="alert alert-warning"> - <p><b>Ponycule's user-space pages are going away.</b> Starting in April 2024, we will be discontinuing all the Ponycule public pages to better focus on making Ponycule a central hub for plural integrations with other services. If you need access to all your content, you may request a backup to the administrators.</p> - <div>Emergency features are not guaranteed to work anymore and have been removed. If you need a trusted one to respond within a short amount of time, you can try sending a lot of messages on instant messaging apps (e.g. Signal); if there is an immediate risk for your or someone else's life, please call <?= $_PROFILE["login"] === "Moonglow" || $_PROFILE["login"] === "raindrops" ? "112" : "991" ?> immediately.</div> - </div> - - <style> - .day-gradient { - background-image: linear-gradient(180deg, rgba(7,15,36,1) 0%, rgba(36,56,83,1) 14%, rgba(165,126,57,1) 28%, rgba(37,109,201,1) 42%, rgba(47,165,208,1) 57%, rgba(252,120,15,1) 71%, rgba(38,66,97,1) 85%, rgba(7,15,36,1) 100%); - background-size: 100% 1000%; - } - - .invert { - filter: invert(1) hue-rotate(180deg); - } - - @media (max-width: 800px) { - #schedules { - grid-template-columns: 1fr !important; - } - - .schedules-separator { - display: block !important; - } - } - </style> - - <h2> - <span id="greeting">Hi</span> <span><?php - - $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($_PROFILE["login"] === "raindrops" ? "gdapd" : ($_PROFILE["login"] === "Moonglow" ? "hrbom" : "other")) . "/fronters.json"), true); - $name = ($_PROFILE["login"] === "raindrops" ? "Raindrops System" : ($_PROFILE["login"] === "Moonglow" ? "Moonglow" : $app["other"]["name"])); - - if (isset($fronters["members"][0])) { - $name = implode(" and ", array_map(function ($i) { - return $i["display_name"] ?? $i["name"]; - }, $fronters["members"])); - } - - echo $name; - - ?>!</span> - </h2> - - <div id="schedules" style="margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px;"> - <div> - <div id="live-time-other-outer" class="day-gradient" style="text-align: center; background-color: rgba(255, 255, 255, .1); padding: 20px 0; border-radius: 10px;"> - <b><?= $app["other"]["name"] ?></b><br> - <h3 id="live-time-other">--:--</h3> - </div> - - <hr style="display: none;" class="schedules-separator"> - </div> - - <div> - <div id="live-time-raindrops-outer" class="day-gradient" style="text-align: center; background-color: rgba(255, 255, 255, .1); padding: 20px 0; border-radius: 10px;"> - <b>Raindrops System</b><br> - <h3 id="live-time-raindrops">--:--</h3> - </div> - - <hr style="display: none;" class="schedules-separator"> - </div> - - <div> - <div id="live-time-moonwind-outer" class="day-gradient" style="text-align: center; background-color: rgba(255, 255, 255, .1); padding: 20px 0; border-radius: 10px;"> - <b>Moonglow</b><br> - <h3 id="live-time-moonwind">--:--</h3> - </div> - </div> - </div> - - <script> - function getDayPercentage(time) { - let hours = parseInt(time.split(":")[0]); - let minutes = parseInt(time.split(":")[1].split(" ")[0]); - - if (time.split(":")[1].split(" ")[1] === "PM") hours += 12; - if (hours === 12 && time.split(":")[1].split(" ")[1] === "AM") hours = 0; - if (hours === 24 && time.split(":")[1].split(" ")[1] === "PM") hours = 12; - - let timestamp = new Date("1970-01-01 " + hours + ":" + minutes + " UTC").getTime() / 1000; - - return (timestamp / 86400) * 100; - } - - function updateTime() { - let time1 = (new Intl.DateTimeFormat('en-US', { - timeZone: 'Europe/Paris', - hour: 'numeric', - minute: '2-digit', - hour12: false - })).format(new Date()); - - document.getElementById("live-time-raindrops").innerText = time1.replace("24:", "00:"); - document.getElementById("live-time-raindrops-outer").style.backgroundPositionY = getDayPercentage(time1) + "%"; - - let time4 = (new Intl.DateTimeFormat('en-US', { - timeZone: 'Europe/Kyiv', - hour: 'numeric', - minute: '2-digit', - hour12: false - })).format(new Date()); - - document.getElementById("live-time-moonwind").innerText = time4.replace("24:", "00:"); - document.getElementById("live-time-moonwind-outer").style.backgroundPositionY = getDayPercentage(time4) + "%"; - - let time3 = (new Intl.DateTimeFormat('en-US', { - timeZone: 'America/Chicago', - hour: 'numeric', - minute: '2-digit', - hour12: false - })).format(new Date()); - - document.getElementById("live-time-other").innerText = time3.replace("24:", "00:"); - document.getElementById("live-time-other-outer").style.backgroundPositionY = getDayPercentage(time3) + "%"; - - let greeting = "Hi"; - - switch (new Date().getHours()) { - case 22: - case 23: - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - greeting = "Good night"; - break; - - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - greeting = "Good morning"; - break; - - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - greeting = "Good afternoon"; - break; - - case 18: - case 19: - case 20: - case 21: - greeting = "Good evening"; - break; - } - - document.getElementById("greeting").innerText = greeting; - } - - updateTime(); - - setInterval(() => { - updateTime(); - }, 10000); - </script> - - <div id="timeline-container" style="background: #3332328a;padding: 5px 10px;border-radius: 10px; margin-top: 20px;"> - <div id="timeline"></div> - <script> - async function refreshTimeline() { - document.getElementById("timeline").innerHTML = await (await fetch("/api/timeline?gdapd<?= ($isLowerLoggedIn || $isLoggedIn) ? "&" . $app["other"]["id"] : "" ?>&hrbom")).text(); - - Array.from(document.getElementsByClassName("dynamic-time")).forEach((el) => { - let time = el.getAttribute("data-time"); - el.innerText = new Date(parseInt(time) * 1000).toTimeString().split(":").splice(0, 2).join(":"); - }); - - Array.from(document.getElementsByClassName("dynamic-time-mobile")).forEach((el) => { - let time = el.getAttribute("data-time"); - el.innerText = new Date(parseInt(time) * 1000).toTimeString().split(":")[0] + ":"; - }); - } - - setInterval(refreshTimeline, 10000); - refreshTimeline(); - </script> - </div> - - <div style="display: grid; grid-template-columns: 1fr 2fr; grid-gap: 20px;" id="home-parts"> - <div style="background-color: var(--palette-2) !important; margin-top: 20px; border-radius: 10px;"> - <div class="list-group"> - <a href="/raindrops" class="list-group-item list-group-item-action" style="display: flex; align-items: center;"> - <img src="/assets/avatars/7d9f543ef74240f69d0786c3f2983124.webp" style="margin-right: 5px; width: 24px;"><div style="vertical-align: middle; display: flex; align-items: center; color: var(--bs-body-color);">Raindrops System</div> - </a> - <a href="/<?= $app["other"]["slug"] ?>" class="list-group-item list-group-item-action" style="display: flex; align-items: center;"> - <img src="/assets/avatars/64fb19057fae41cfac0f844e9e186848.webp" style="margin-right: 5px; width: 24px;"><div style="vertical-align: middle; display: flex; align-items: center; color: var(--bs-body-color);"><?= $app["other"]["name"] ?></div> - </a> - <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="https://plex.p.equestria.dev" target="_blank" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;"> - <img src="https://plex.p.equestria.dev/web/favicon.ico" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">Plex</div> - </a> - <a href="https://live.p.equestria.dev" target="_blank" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: max-content 1fr;"> - <img src="https://avatars.githubusercontent.com/u/8463692?s=128" style="margin-right: 5px; height: 24px; width: 24px;"><div style="display: flex; align-items: center; color: var(--bs-body-color);">Streaming server</div> - </a> - </div> - </div> - <div style="background-color: var(--palette-2) !important; text-align: center; margin-top: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center;"> - <div style="color: var(--palette-9);">There is nothing here yet, check back later!</div> - </div> - </div> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> diff --git a/includes/fragments/member.inc b/includes/fragments/member.inc deleted file mode 100644 index c621bc3..0000000 --- a/includes/fragments/member.inc +++ /dev/null @@ -1,204 +0,0 @@ -<?php global $system; global $defaultMember; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; global $lang; global $pages; global $app; global $isLoggedIn; global $isLowerLoggedIn; - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs"); - -if ($memberData["name"] === "fusion") { - $title = ($memberCommonName === "fusion" ? $lang["member"]["merge"] : $memberCommonName); -} else { - $title = $memberCommonName . " ยท " . $systemCommonName; -} - -if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion") { - $metadata = parseMetadata(json_decode(file_get_contents_or_defaults($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", $defaultMember), true)); - - if (isset($metadata["private"]) && $metadata["private"] && !$isLoggedIn && !$isLowerLoggedIn) { - peh_error("Page not found: " . strip_tags($member), 404); - } -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; - -$travelling = []; - -if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion") { - $metadata = parseMetadata(json_decode(file_get_contents_or_defaults($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", $defaultMember), true)); -} - -global $isLoggedIn; - -$frontersRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true); -$frontersOther = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/fronters.json"), true); - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $memberID . ".json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $memberID . ".json", json_encode([ - "_main" => [ - "name" => "Main", - "note" => "Everyday appearance", - "image" => null - ] -])); - -if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".png")) { - $designs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $memberID . ".json"), true); - $designs["_main"]["image"] = base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberData["id"] . ".png")); -} - -?> - -<div id="member-banner-container" style="width: calc(100% - 300px);height: <?= !isset($memberData["banner"]) ? "33vh" : "65vh" ?>;position: fixed;background-image: url('<?= getAsset($systemID, $memberID, !isset($memberData["banner"]) ? "avatars" : "banners") ?>');background-size: cover;background-position: center; top: 0;"> - <div id="member-banner-inner" style="height: 100%;width: 100%;background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,1) 100%);<?= !isset($memberData["banner"]) ? "backdrop-filter:blur(100px);" : "" ?>"></div> -</div> - -<style> - .input-inherit { - all: inherit; - width: 200px; - height: max-content; - margin: 0; - } -</style> - -<script> - document.getElementById("app").onscroll = () => { - document.getElementById("member-banner-container").style.height = (<?= !isset($memberData["banner"]) ? "33" : "65" ?> - ((document.getElementById("app").scrollTop / (window.screen.availHeight - 62)) * 100)) + "vh"; - } - - function showPrivate() { - document.getElementById("private-page-link").style.display = "none"; - document.getElementById("private-page-hidden").style.display = "block"; - } - - function _arrayBufferToBase64( buffer ) { - var binary = ''; - var bytes = new Uint8Array( buffer ); - var len = bytes.byteLength; - for (var i = 0; i < len; i++) { - binary += String.fromCharCode( bytes[ i ] ); - } - return window.btoa( binary ); - } -</script> - -<br> -<div class="container"> - <div id="member-page" style="background-color: rgba(26,26,26,0.8);border-radius: 10px;padding:20px; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);margin-top:<?= !isset($memberData["banner"]) ? "15vh" : "30vh" ?>; padding-bottom: 0 !important;"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/fullbanner.inc"; ?> - <div id="page-content"> - <?php if ($memberData["name"] === "unknown"): ?> - <br> - <div class="alert alert-secondary" style="margin-bottom: 0 !important;"> - <p>Hello there!</p> - <p>I'm currently not totally sure who I am (it's a thing that can happen with plurality), but I am using this pony as a temporary identity to stay calm and not panic while I figure out what is going on and who I am.</p> - <p>I can either be an existing headmate who cannot work out they are fronting (this can sometimes happen when one of us gets pushed out of front), multiple headmates blurring who cannot work out who we are, a new pony trying to figure out their identity (this can sometimes take a while), or some other plurality shenanigans.</p> - <span>In all cases, feel free to ask!</span> - </div> - <br> - <?php else: ?><?php endif; ?> - </div> - </div> -</div> - -<div class="container"> - <?php global $isLoggedIn; global $isLowerLoggedIn; if ($isLoggedIn || ($isLowerLoggedIn && ($systemID === $app["other"]["id"] || $systemID === "hrbom"))): ?> - <hr> - - <details> - <summary style="list-style: none;"> - <small style="opacity:.5;display:block;">Click here for technical details.</small> - </summary> - <div class="alert alert-dark"> - <ul style="margin-bottom:0;"> - <li><b>ID:</b> <code><?= $memberID ?></code> (<code><?= $systemID . "/" . $memberID ?></code>, <?= $memberData["name"] ?>)</li> - <li><b>Files:</b> - <ul> - <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json") . " bytes" : "not found" ?>)</li> - <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") . " bytes" : "not found" ?>)</li> - <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") . " bytes" : "not found" ?>)</li> - </ul> - </li> - <li><b>Date added:</b> <?= date('l j F Y', strtotime($memberData["created"])) ?> (<?= timeAgo($memberData["created"]) ?>, <code><?= $memberData["created"] ?></code>)</li> - <li><b>Pronouns:</b> <?= $memberData['pronouns'] ?></li> - <li><b>Color:</b> <span style="border:1px solid rgba(255, 255, 255, .5);background-color:#<?= $memberData["color"] ?? "ffffff" ?>;display:inline-block;width:16px;height:16px;border-radius:5px;vertical-align: middle;filter: invert(1) hue-rotate(180deg);"></span> <span style="vertical-align: middle;"><code>#<?= $memberData["color"] ?? "ffffff" ?></code></span> - <li><b>Reduced name:</b> <?= getMiniName($memberData["display_name"] ?? $member["name"]) ?></li> - <li> - <b>Metadata:</b> - <ul> - <?php foreach (parseMetadata(json_decode(file_get_contents_or_defaults($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", $defaultMember), true)) as $name => $value): ?> - <li> - <b><?= $name ?></b>: <?php - - if (is_bool($value)) { - echo($value ? "true" : "false"); - } else if (is_numeric($value)) { - echo((string)$value); - } else if (is_string($value)) { - echo("\"$value\""); - } else if (is_null($value)) { - echo("null"); - } else if (is_array($value) && array_keys($value) !== array_keys(array_keys($value))) { // Is associative ?> - <ul> - <?php foreach ($value as $name2 => $value2): ?> - <li> - <b><?= $name2 ?></b>: <?php - - if (is_bool($value2)) { - echo($value2 ? "true" : "false"); - } else if (is_numeric($value2)) { - echo((string)$value2); - } else if (is_string($value2)) { - echo("\"$value2\""); - } else if (is_null($value2)) { - echo("null"); - } else if (is_array($value2)) { - echo("Array"); - } else { - var_dump($value2); - } - - ?> - </li> - <?php endforeach; ?> - </ul><?php - } else if (is_array($value) && array_keys($value) === array_keys(array_keys($value))) { // Is indexes ?> - <ul> - <?php foreach ($value as $value2): ?> - <li> - <?php - - if (is_bool($value2)) { - echo($value2 ? "true" : "false"); - } else if (is_numeric($value2)) { - echo((string)$value2); - } else if (is_string($value2)) { - echo("\"$value2\""); - } else if (is_null($value2)) { - echo("null"); - } else if (is_array($value2)) { - echo("Array"); - } else { - var_dump($value2); - } - - ?> - </li> - <?php endforeach; ?> - </ul><?php - } else if (is_array($value) && count($value) === 0) { - echo("[]"); - } else { - var_dump($value); - } - - ?> - </li> - <?php endforeach; ?> - </ul> - </li> - </ul> - </div> - </details> - <?php endif; ?> -</div> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> diff --git a/includes/fragments/system.inc b/includes/fragments/system.inc deleted file mode 100644 index 717efee..0000000 --- a/includes/fragments/system.inc +++ /dev/null @@ -1,44 +0,0 @@ -<?php global $system; global $isLowerLoggedIn; global $systemCommonName; global $systemID; $title = $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $app; global $isLoggedIn; ?> - -<div id="system-banner-container" style="width: calc(100% - 300px);height: 65vh;position: fixed;background-image: url('<?= getAsset($systemID, null, "banners") ?>');background-size: cover;background-position: center; top: 0;"> - <div id="system-banner-inner" style="height: 100%;width: 100%;background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,1) 100%);"></div> -</div> - -<script> - document.getElementById("app").onscroll = () => { - document.getElementById("system-banner-container").style.height = (65 - ((document.getElementById("app").scrollTop / (window.screen.availHeight - 62)) * 100)) + "vh"; - } -</script> - -<br> -<div class="container"> - - <div id="system-page" style="background-color: rgba(26,26,26,0.8);border-radius: 10px;padding:20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);margin-top:30vh;"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/sysbanner.inc"; ?> - <br> - - <?php if ($system === "raindrops") raindrops(true); elseif ($system === "moonglow") moonglow(true); elseif ($isLoggedIn || $isLowerLoggedIn) other(true); ?> - </div> -</div> - -<div class="container"> - <hr> -</div> - -<style> - #hpd-raindrops, #hpd-moonglow, #hpd-other { - background: transparent !important; - padding: 0 !important; - margin-bottom: 0 !important; - } - - @media (max-width: 767px) { - #system-info > img { - display: block; - margin-left: auto; - margin-right: auto; - } - } -</style> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
\ No newline at end of file |