1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
<?php global $system; 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($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), 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 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion") {
$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), 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;"><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;">
<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($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json"), 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'; ?>
|