diff options
author | Minteck <contact@minteck.org> | 2023-02-25 19:59:31 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-25 19:59:31 +0100 |
commit | 3d77712a9ab014635c75a33ea0f491bbda6aead3 (patch) | |
tree | 616bef5215db4f1d1cea2566079db2a130363e6b /pages | |
parent | 15bb1453008237edbc2cb4e82a9eb44db6f99794 (diff) | |
download | pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.tar.gz pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.tar.bz2 pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.zip |
Updated 16 files and added 2 files (automated)
Diffstat (limited to 'pages')
-rw-r--r-- | pages/api/fronter.php | 71 | ||||
-rw-r--r-- | pages/home.inc | 55 | ||||
-rw-r--r-- | pages/home.old.inc | 95 | ||||
-rw-r--r-- | pages/travelling.inc | 2 |
4 files changed, 161 insertions, 62 deletions
diff --git a/pages/api/fronter.php b/pages/api/fronter.php index 51ee4ee..b380a56 100644 --- a/pages/api/fronter.php +++ b/pages/api/fronter.php @@ -12,14 +12,17 @@ $index = (int)$_GET['i'] ?? null; $type = $_GET['t'] ?? null; $date = $_GET['d'] ?? null; -if (!isset($system) || trim($system) === "" || strlen($system) !== 5 || !preg_match("/[a-z]/i", $system) || ($system !== "gdapd" && $system !== "ynmuc")) +if (!isset($system) || trim($system) === "" || strlen($system) !== 5 || !preg_match("/[a-z]/i", $system) || ($system !== "gdapd" && $system !== "ynmuc")) { peh_error("System not found", 404); +} -if (!isset($type) || trim($type) === "") +if (!isset($type) || trim($type) === "") { peh_error("Type not found", 404); +} -if (!isset($date) || trim($date) === "" || strlen($date) !== 10 || !preg_match("/[\d-]/i", $date)) +if (!isset($date) || trim($date) === "" || strlen($date) !== 10 || !preg_match("/[\d-]/i", $date)) { peh_error("Date not found", 404); +} $list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/$system.json"), true); @@ -30,36 +33,42 @@ function moveElement(&$array, $a, $b) { switch ($type) { case "add": - if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) + if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) { if ($member !== null && $member !== "null") peh_error("System member not found", 404); + } if (!isset($list[$date])) $list[$date] = []; $list[$date][] = [$member, null]; break; case "cofront": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } - if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) + if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) { if ($member !== null && $member !== "null") peh_error("System member not found", 404); + } $list[$date][$index][1] = $member; break; case "delete": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } unset($day[$index]); $list[$date] = array_values($day); @@ -67,38 +76,46 @@ switch ($type) { break; case "codelete": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } $list[$date][$index][1] = null; break; case "down": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); - - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; + + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } + moveElement($list[$date], $index, $index + 1 < count($list[$date]) ? $index + 1 : $index); break; case "up": - if (!isset($index) || trim($index) === "" || is_integer($index)) - if ($index !== null && $index !== "null") peh_error("Invalid index", 400); - - if (!isset($day[$index])) - if ($index !== null && $index !== "null") peh_error("Index not found", 404); + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } $day = $list[$date]; + + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } + moveElement($list[$date], $index, $index - 1 > -1 ? $index - 1 : $index); break; diff --git a/pages/home.inc b/pages/home.inc index 4249947..82ff3d5 100644 --- a/pages/home.inc +++ b/pages/home.inc @@ -25,9 +25,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE <div style="text-align: center;"> <img alt="" src="/assets/logo/newlogo<?= $isLoggedIn || $isLowerLoggedIn ? "3" : "" ?>.png" style="width:128px;"> <p style="z-index:999;position:relative;background:transparent;margin: 20px -10px 0 -20px;padding-right:30px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);"> - <?php foreach ($byColor as $member): ?><a data-bs-html="true" class="rainbow-item tooltip-nohelp" title="<b><?= $member["display_name"] ?? $member["name"] ?></b><br><?= ($travelling[$member['id']]["travelling"] ? $member["_system"] === "ynmuc" : $member["_system"] === "gdapd") ? "Raindrops System" : ($member["_system"] === "ynmuc" ? "Cloudburst System" : $app["other"]["name"]) ?>" data-bs-toggle="tooltip" style="overflow: hidden;" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="height:32px;position:absolute;z-index:99;"></a><?php endforeach; ?> + <?php foreach ($byColor as $member): ?><a class="rainbow-item" style="overflow: hidden;"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="height:32px;position:absolute;z-index:99;"></a><?php endforeach; ?> </p> - <div style="margin-top:-33px;margin-bottom:0;margin-left:-20px;margin-right:20px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);"> + <div style="margin-top:-33px;margin-bottom:0;margin-left:-20px;margin-right:20px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);position:relative;left:10px;"> <?php foreach ($byColor as $member): ?><div> <span style="display: inline-block;background: transparent;position:absolute;width: 0;height: 0;margin-top: 17px;box-shadow: 0 6px 20px 20px #<?= $member["color"] ?>;z-index: 9;margin-left: 8px;opacity: .75;"></span> </div><?php endforeach; ?> @@ -45,50 +45,37 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE <?php endif; ?> </div> </div> - <hr style="border-color:rgba(255, 255, 255, .25);"> - <!--<?php global $isLoggedIn; if ($isLoggedIn && ((int)date('H') >= 20 || (int)date('H') < 6)): ?> - <a href="/-/emergency" style="text-decoration: none;margin-top:15px;display:block;"> - <div class="alert alert-danger"> - <b>Are you in need of help?</b> If you need immediate help from a loved one, you may want to enable the emergency alert by clicking here, even if that wakes up the <?= $_PROFILE['name'] === "Raindrops System" ? "Cloudburst System" : "Raindrops System" ?>. Use it as you need. - </div> - </a> - <?php endif; ?>--> - - <!--<div class="alert alert-info"> - <b>Coming soon:</b> Free hosting for Project Scout (the software powering Cold Haze), so you can have your own website for your system. If you are interested and/or want to pre-register, feel free to <a href="https://equestria.horse/contact" target="_blank">contact us</a>. - </div>--> - - <div id="homepage-desktop" style="margin-top:10px;"> + <div id="new-homepage" style="margin-top:20px;"> - <?php cloudburst(false); ?> - <?php raindrops(false); ?> - <?php if ($isLoggedIn || $isLowerLoggedIn) other(false); ?> + <div id="new-homepage-systems" <?php if ($isLoggedIn || $isLowerLoggedIn): ?>style="grid-template-columns: repeat(3, 1fr);"<?php endif; ?>> + <?php newHomepage("ynmuc", "cloudburst", true); ?> + <?php newHomepage("gdapd", "raindrops", true); ?> + <?php if ($isLoggedIn || $isLowerLoggedIn) newHomepage($app["other"]["id"], $app["other"]["slug"], true); ?> + </div> - <hr> + </div> - <div id="hpd-legacy" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px 10px 10px 20px;display:grid;grid-template-columns: 128px 1fr;margin-bottom:10px;"> - <a style="display:flex;margin: -10px -20px;align-items:center;justify-content:center;text-align:center;padding: 10px 20px;border-radius: 10px;background: #77777755;width: 148px;text-decoration:none;color:white;filter:none !important;" class="hpd-system"> - <div style="text-align:center;"><img src="/assets/icons/legacy.svg" style="width:64px;"><br>Pony Legacy</div> - </a> + <div id="hpd-legacy" style="margin-top: 20px; background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px 10px 10px 20px;display:grid;grid-template-columns: 128px 1fr;margin-bottom:10px;"> + <a style="display:flex;margin: -10px -20px;align-items:center;justify-content:center;text-align:center;padding: 10px 20px;border-radius: 10px;background: #77777755;width: 148px;text-decoration:none;color:white;filter:none !important;" class="hpd-system"> + <div style="text-align:center;"><img src="/assets/icons/legacy.svg" style="width:64px;"><br>Pony Legacy</div> + </a> - <div style="display:grid;grid-template-columns:repeat(6, 1fr);padding-left:10px;grid-gap:10px;"> - <?php foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/legacy"), function ($i) { - return !str_starts_with($i, "."); - }) as $id): - $id = substr($id, 0, -5); - $member = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/legacy/" . $id . ".json"), true); + <div style="display:grid;grid-template-columns:repeat(6, 1fr);padding-left:10px;grid-gap:10px;"> + <?php foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/legacy"), function ($i) { + return !str_starts_with($i, "."); + }) as $id): + $id = substr($id, 0, -5); + $member = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/legacy/" . $id . ".json"), true); - echo('<a style="text-decoration:none !important;filter:none !important;"><div class="hpd-item-card" style="background-color:rgba(255, 255, 255, .1);border:1px solid ' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';outline-color:' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;opacity:5;"><div> + echo('<a style="text-decoration:none !important;filter:none !important;"><div class="hpd-item-card" style="background-color:rgba(255, 255, 255, .1);border:1px solid ' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';outline-color:' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;opacity:5;"><div> <img alt="" src="' . $member["avatar"] . '" style="border-radius:999px;background-color:rgba(0, 0, 0, .25);height:48px;display:block;margin-left:auto;margin-right:auto;"> <div style="text-decoration:none;color:white;margin-top:5px;">' . ($member['name'] ?? $id) . '</div> <div style="text-decoration:none !important;color:white !important;">' . date('j M Y', strtotime($member["date"])) . '</div> </div></div></a>'); - endforeach; ?> - </div> + endforeach; ?> </div> - </div> </div> diff --git a/pages/home.old.inc b/pages/home.old.inc new file mode 100644 index 0000000..4249947 --- /dev/null +++ b/pages/home.old.inc @@ -0,0 +1,95 @@ +<?php + +if (isset($_GET["ec"])) { + header("HTTP/1.1 " . $_GET["ec"] . " Error"); +} + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnly; global $isNormallyLoggedIn; global $_PROFILE; global $lang; global $pages; global $isLowerLoggedIn; global $app; global $isLoggedIn; ?> + +<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; ?> + + <?php if ($readOnly && $isNormallyLoggedIn || $readOnly && $isLowerLoggedIn): ?> + <div class="alert alert-warning"> + <b>Notice: </b>This website is temporarily under maintenance and the administrators have locked the database. Although you are logged in as <?= $_PROFILE['name'] ?>, you cannot access any of the logged-in features while the website is under maintenance. <a href="/-/emergency">Alerts dispatching</a> remains possible in case of an emergency. + </div> + <?php endif; ?> + + <?php global $travelling; $byColor = getMembersByColor($_SERVER['HTTP_HOST'] === "fr.equestria.horse"); ?> + <div style="text-align: center;"> + <img alt="" src="/assets/logo/newlogo<?= $isLoggedIn || $isLowerLoggedIn ? "3" : "" ?>.png" style="width:128px;"> + <p style="z-index:999;position:relative;background:transparent;margin: 20px -10px 0 -20px;padding-right:30px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);"> + <?php foreach ($byColor as $member): ?><a data-bs-html="true" class="rainbow-item tooltip-nohelp" title="<b><?= $member["display_name"] ?? $member["name"] ?></b><br><?= ($travelling[$member['id']]["travelling"] ? $member["_system"] === "ynmuc" : $member["_system"] === "gdapd") ? "Raindrops System" : ($member["_system"] === "ynmuc" ? "Cloudburst System" : $app["other"]["name"]) ?>" data-bs-toggle="tooltip" style="overflow: hidden;" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="height:32px;position:absolute;z-index:99;"></a><?php endforeach; ?> + </p> + <div style="margin-top:-33px;margin-bottom:0;margin-left:-20px;margin-right:20px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);"> + <?php foreach ($byColor as $member): ?><div> + <span style="display: inline-block;background: transparent;position:absolute;width: 0;height: 0;margin-top: 17px;box-shadow: 0 6px 20px 20px #<?= $member["color"] ?>;z-index: 9;margin-left: 8px;opacity: .75;"></span> + </div><?php endforeach; ?> + </div> + <div style="padding:5px 10px;background:#3332328a;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;position:relative;z-index: 999;backdrop-filter: blur(30px);"> + <h2 style="margin-top: 20px;">Cold Haze</h2> + <?php if ($_SERVER['HTTP_HOST'] === "fr.equestria.horse"): ?> + <p><?= count($byColor) ?> poneys dans une tĂȘte</p> + <?php else: ?> + <?php if ($isLoggedIn || $isLowerLoggedIn): ?> + <p><?= count($byColor) ?> ponies in 3 plural systems</p> + <?php else: ?> + <p><?= count($byColor) ?> <?= $lang["home"]["intro"] ?></p> + <?php endif; ?> + <?php endif; ?> + </div> + </div> + <hr style="border-color:rgba(255, 255, 255, .25);"> + + <!--<?php global $isLoggedIn; if ($isLoggedIn && ((int)date('H') >= 20 || (int)date('H') < 6)): ?> + <a href="/-/emergency" style="text-decoration: none;margin-top:15px;display:block;"> + <div class="alert alert-danger"> + <b>Are you in need of help?</b> If you need immediate help from a loved one, you may want to enable the emergency alert by clicking here, even if that wakes up the <?= $_PROFILE['name'] === "Raindrops System" ? "Cloudburst System" : "Raindrops System" ?>. Use it as you need. + </div> + </a> + <?php endif; ?>--> + + <!--<div class="alert alert-info"> + <b>Coming soon:</b> Free hosting for Project Scout (the software powering Cold Haze), so you can have your own website for your system. If you are interested and/or want to pre-register, feel free to <a href="https://equestria.horse/contact" target="_blank">contact us</a>. + </div>--> + + <div id="homepage-desktop" style="margin-top:10px;"> + + <?php cloudburst(false); ?> + <?php raindrops(false); ?> + <?php if ($isLoggedIn || $isLowerLoggedIn) other(false); ?> + + <hr> + + <div id="hpd-legacy" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px 10px 10px 20px;display:grid;grid-template-columns: 128px 1fr;margin-bottom:10px;"> + <a style="display:flex;margin: -10px -20px;align-items:center;justify-content:center;text-align:center;padding: 10px 20px;border-radius: 10px;background: #77777755;width: 148px;text-decoration:none;color:white;filter:none !important;" class="hpd-system"> + <div style="text-align:center;"><img src="/assets/icons/legacy.svg" style="width:64px;"><br>Pony Legacy</div> + </a> + + <div style="display:grid;grid-template-columns:repeat(6, 1fr);padding-left:10px;grid-gap:10px;"> + <?php foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/legacy"), function ($i) { + return !str_starts_with($i, "."); + }) as $id): + $id = substr($id, 0, -5); + $member = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/legacy/" . $id . ".json"), true); + + echo('<a style="text-decoration:none !important;filter:none !important;"><div class="hpd-item-card" style="background-color:rgba(255, 255, 255, .1);border:1px solid ' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';outline-color:' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;opacity:5;"><div> +<img alt="" src="' . $member["avatar"] . '" style="border-radius:999px;background-color:rgba(0, 0, 0, .25);height:48px;display:block;margin-left:auto;margin-right:auto;"> +<div style="text-decoration:none;color:white;margin-top:5px;">' . ($member['name'] ?? $id) . '</div> +<div style="text-decoration:none !important;color:white !important;">' . date('j M Y', strtotime($member["date"])) . '</div> +</div></div></a>'); + + endforeach; ?> + </div> + </div> + + </div> +</div> + +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/pages/travelling.inc b/pages/travelling.inc index 2064ce1..e0fbfb1 100644 --- a/pages/travelling.inc +++ b/pages/travelling.inc @@ -165,7 +165,7 @@ global $travelling; Start travelling </button> <ul class="dropdown-menu"> - <li><a class="dropdown-item" href="?toggleTravel&member=<?= $member['id'] ?>"><img style="width:24px;border-radius:5px;" src="/assets/uploads/<?= $system === "gdapd" ? "cloudburst" : "raindrops" ?>.png"> <?= $system === "gdapd" ? "Cloudburst" : "Raindrops" ?> System</a></li> + <li><a class="dropdown-item" href="?toggleTravel&member=<?= $member['id'] ?>"><img style="width:24px;border-radius:5px;" src="<?= getAsset($system === "gdapd" ? "ynmuc" : "gdapd") ?>"> <?= $system === "gdapd" ? "Cloudburst" : "Raindrops" ?> System</a></li> <li><a class="dropdown-item" href="?toggleTravel&equestria&member=<?= $member['id'] ?>"><img style="width:24px;" src="/assets/logo/equestria.png"> Equestria</a></li> </ul> </div> |