summaryrefslogtreecommitdiff
path: root/includes/fragments/member.inc
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/fragments/member.inc
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/fragments/member.inc')
-rw-r--r--includes/fragments/member.inc104
1 files changed, 3 insertions, 101 deletions
diff --git a/includes/fragments/member.inc b/includes/fragments/member.inc
index e927fd4..10cd241 100644
--- a/includes/fragments/member.inc
+++ b/includes/fragments/member.inc
@@ -88,24 +88,6 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".pn
document.getElementById("private-page-hidden").style.display = "block";
}
- function updateDesignName(id) {
- if (id === "_main" && document.getElementById("design-" + id + "-name").value.trim() === "") {
- document.getElementById("design-" + id + "-name").value = "Main";
- } else {
- fetch("/api/design/?member=<?= $memberID ?>&type=name&id=" + id + "&value=" + encodeURIComponent(btoa(document.getElementById("design-" + id + "-name").value))).then((a) => {
- a.text().then((b) => {
- if (b.trim() === "&") {
- location.reload();
- }
- })
- })
- }
- }
-
- function updateDesignNote(id) {
- fetch("/api/design/?member=<?= $memberID ?>&type=note&id=" + id + "&value=" + encodeURIComponent(btoa(document.getElementById("design-" + id + "-note").value)));
- }
-
function _arrayBufferToBase64( buffer ) {
var binary = '';
var bytes = new Uint8Array( buffer );
@@ -115,63 +97,12 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".pn
}
return window.btoa( binary );
}
-
- async function uploadNewDesign() {
- let handles = await window.showOpenFilePicker({
- multiple: false
- });
-
- if (handles.length >= 1) {
- let file = await handles[0].getFile();
-
- if (file.size > 2*1024**2) {} else {
- let reader = new FileReader();
- reader.readAsArrayBuffer(file);
-
- reader.onload = () => {
- let content = _arrayBufferToBase64(reader.result);
-
- fetch("/api/design/?member=<?= $memberID ?>&type=upload", {
- method: "post",
- body: JSON.stringify({
- file: content
- })
- }).then(() => {
- location.reload();
- });
- }
-
- reader.onerror = () => {}
- }
- }
- }
</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" ?>;<?php if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") && !($isLoggedIn && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html"))): ?> padding-bottom: 0 !important;<?php endif; ?>">
+ <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"; ?>
- <?php $member = $memberData; if (($isLoggedIn || $isLowerLoggedIn) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png")): ?>
- <div style="padding-top: 20px; padding-bottom: 20px;" id="member-designs">
- <div id="member-designs-inner" style="background-color: rgba(200, 200, 200, .05); border-radius: 10px; padding: 10px 20px; overflow-x: scroll; display: flex; grid-gap: 20px;">
- <?php foreach ($designs as $id => $design): if (isset($design)): ?>
- <div style="display: grid; grid-template-rows: 208px 48px; width: max-content;">
- <div style="display: flex; align-items: center; justify-content: center;">
- <img src="data:image/png;base64,<?= $design["image"] ?>" style="height: 208px;">
- </div>
- <div style="text-align: center; margin-top: 5px; height: 48px; width: max-content;">
- <b><input onkeyup="updateDesignName('<?= $id ?>');" maxlength="100" class="input-inherit" value="<?= $design["name"] ?>" id="design-<?= $id ?>-name"></b><br><input onkeyup="updateDesignNote('<?= $id ?>');" maxlength="100" class="input-inherit" value="<?= $design["note"] ?>" id="design-<?= $id ?>-note">
- </div>
- </div>
- <?php endif; endforeach; global $use2023UI; ?>
-
- <div onclick="uploadNewDesign();" style="cursor: pointer; display: flex; height: 256px; align-items: center; justify-content: center; width: 64px;">
- <img src="<?= $use2023UI ? icon("add") : "/assets/icons/add.svg" ?>" style="filter: invert(1); opacity: .5; width: 64px;">
- </div>
- </div>
- </div>
- <?php endif; ?>
-
<div id="page-content">
<?php if ($memberData["name"] === "unknown"): ?>
<br>
@@ -198,32 +129,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".pn
<?php endif; ?>
</div>
<br>
- <?php else: ?>
- <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") && $isLoggedIn): ?>
- <?php
-
- $text = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html");
- $censor = false;
-
- if (str_contains(strtolower($text), "sex") || str_contains(strtolower($text), "nsfw") || str_contains(strtolower($text), "pleasure") || str_contains(strtolower($text), "dildo") || str_contains(strtolower($text), "dick") || str_contains(strtolower($text), "penis") || str_contains(strtolower($text), "vagina") || str_contains(strtolower($text), "pussy")) {
- $censor = true;
- }
-
- if ($censor) {
- echo("<a href='#' id='private-page-link' onclick='requestExplicit(\"refresh\"); showPrivate();'>Show private page (NSFW)</a><div id='private-page-hidden' style='display: none;'>" . $text . "</div>");
- } else {
- echo($text);
- }
-
- ?>
- <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html")): ?><hr><?php endif; ?>
- <?php endif; ?>
-
- <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html")): ?>
- <?php if (!$isLoggedIn || !file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html")) echo("<br>"); ?>
- <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ?>
- <?php endif; ?>
- <?php endif; ?>
+ <?php else: ?><?php endif; ?>
</div>
</div>
</div>
@@ -234,11 +140,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".pn
<details>
<summary style="list-style: none;">
- <?php if ($systemID === $app["other"]["id"]): ?>
- <small style="opacity:.5;display:block;">(edit: <a href="/-/metadata/<?= $system ?>/<?= $memberData['name'] ?>">metadata</a>, <a href="/-/ponytown/<?= $memberData['id'] ?>">pony town</a>, <a href="/-/edit/<?= $system ?>/<?= $memberData['name'] ?>">page</a>)</small>
- <?php else: ?>
- <small style="opacity:.5;display:block;">(edit: <a href="/-/metadata/<?= $system ?>/<?= $memberData['name'] ?>">metadata</a>, <a href="/-/ponytown/<?= $memberData['id'] ?>">pony town</a>, <a href="/-/edit/<?= $system ?>/<?= $memberData['name'] ?>">public</a>, <a href="/-/edit-private/<?= $system ?>/<?= $memberData['name'] ?>">private</a>)</small>
- <?php endif; ?>
+ <small style="opacity:.5;display:block;"><a href="/-/metadata/<?= $system ?>/<?= $memberData['name'] ?>">Edit metadata</a> ยท <a href="/-/ponytown/<?= $memberData['id'] ?>">Upload Pony Town character</a></small>
</summary>
<div class="alert alert-dark">
<ul style="margin-bottom:0;">