From 09bd0164ebc020a54b944b7326dcba496fb5d82c Mon Sep 17 00:00:00 2001 From: Minteck Date: Fri, 26 Aug 2022 22:29:23 +0200 Subject: idk when was the last commit so I'm making a new one - Violet Dawn --- pages/bitset.php | 261 ++++++++++++++++++++++++++++++++++++--------------- pages/demo.php | 130 +++++++++++++++++++++++++ pages/emergency.php | 2 +- pages/fronting.php | 2 +- pages/home.php | 14 +-- pages/login.php | 42 ++++++++- pages/logout.php | 19 ++-- pages/page.php | 53 +++++++++-- pages/parser.php | 2 +- pages/pleasure.php | 18 ++++ pages/prefix.php | 2 +- pages/relations.php | 28 ++++-- pages/score.php | 26 ++--- pages/splitting.php | 57 +++++++++++ pages/travelling.php | 81 +++++++++++++++- 15 files changed, 607 insertions(+), 130 deletions(-) create mode 100644 pages/demo.php create mode 100644 pages/pleasure.php create mode 100644 pages/splitting.php (limited to 'pages') diff --git a/pages/bitset.php b/pages/bitset.php index c3cdf0a..11031e2 100644 --- a/pages/bitset.php +++ b/pages/bitset.php @@ -3,7 +3,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /login") and die(); -$title = "Bitset Calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +$title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?> @@ -11,47 +11,68 @@ $title = "Bitset Calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include

Bitset Calculator

-
-
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
1
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
-
0
+
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
1
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0

- Input:
- Output: 0b000000000000100000000000, 0x000800, 2048 + Input:
+ Output: 0b000000000000000000000000000000000000100000000000, 0x000008000000, 2048

+
+
+
+ + +
+

Cliquez sur quelqu'un pour avoir plus d'information sur elle.

+ +
+
+
+ + + + + + + + diff --git a/pages/emergency.php b/pages/emergency.php index 2e38a6f..0405bca 100644 --- a/pages/emergency.php +++ b/pages/emergency.php @@ -4,7 +4,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLogg if (!$isLoggedIn) header("Location: /login") and die(); $emergencyHeader = true; -$title = "Emergency Alert"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +$title = "Emergency alert"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?> diff --git a/pages/fronting.php b/pages/fronting.php index 21d6691..eae0b61 100644 --- a/pages/fronting.php +++ b/pages/fronting.php @@ -1,4 +1,4 @@ - +
diff --git a/pages/home.php b/pages/home.php index 2127712..340df44 100644 --- a/pages/home.php +++ b/pages/home.php @@ -9,11 +9,11 @@
- +

-
" data-bs-toggle="tooltip" style="overflow: hidden;" href="//">.png" style="width:32px;height:32px;position:absolute;z-index:99;">
+
" data-bs-toggle="tooltip" style="overflow: hidden;" href="/">.png" style="width:32px;height:32px;position:absolute;z-index:99;">

@@ -21,8 +21,8 @@
-

Cuties and Plurality

-

A safe place for ponies in 2 plural systems

+

Cold Haze

+

ponies in 2 plural systems


@@ -37,7 +37,7 @@
- Cuties and Plurality
+ Cold Haze
Just a small safe place for two plural systems @@ -48,8 +48,8 @@
- = 20 || (int)date('H') < 6)): ?> - + = 20 || (int)date('H') < 6)): ?> +
Are you in need of help? If you need immediate help from a loved one, you may want to enable the emergency alert by clicking here, even if that will wake up the . Use it as you need.
diff --git a/pages/login.php b/pages/login.php index a6f075f..8611f5f 100644 --- a/pages/login.php +++ b/pages/login.php @@ -1,2 +1,42 @@ + +
+
+ + diff --git a/pages/logout.php b/pages/logout.php index ea1bfce..0263278 100644 --- a/pages/logout.php +++ b/pages/logout.php @@ -1,16 +1,15 @@ 2) || $parts[1] === "-")) { + $namesCloudburst = [...array_map(function ($i) { + return $i['name']; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true)), "unknown-cb"]; + $namesRaindrops = [...array_map(function ($i) { + return $i['name']; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true)), "unknown-rd"]; + + $parts = explode("/", $_GET['_']); + array_unshift($parts, ""); + $parts = array_values($parts); + + if (in_array($parts[1], $namesCloudburst)) { + $parts[0] = "cloudburst"; + } else if (in_array($parts[1], $namesRaindrops)) { + $parts[0] = "raindrops"; + } + + if ($parts[1] === "unknown-rd" || $parts[1] === "unknown-cb") $parts[1] = "unknown"; +} + $system = $parts[0]; $member = ($parts[1] ?? null) === "" ? null : $parts[1]; @@ -12,12 +34,16 @@ $systemCommonName = $system === "cloudburst" ? "Cloudburst System" : "Raindrops $systemID = $system === "cloudburst" ? "ynmuc" : "gdapd"; if ($member === null) { + global $_SystemName; + $_SystemName = $system; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system.php'; } else if ($member === "-" && isset($parts[2])) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.php')) { + global $_SystemPage; + $_SystemPage = $parts[2]; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.php'; } else { - header("Location: /?error=Page not found") and die(); + header("Location: /?error=Page not found: " . $parts[2]) and die(); } } else { $memberFoundInAnotherSystem = false; @@ -44,25 +70,32 @@ if ($member === null) { $memberCommonName = $m['display_name'] ?? $m['name']; $memberID = $m['id']; $system = $systemID === "gdapd" ? "cloudburst" : "raindrops"; - $systemCommonName = $system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; $systemID = $system === "cloudburst" ? "ynmuc" : "gdapd"; } else if ($m['name'] === $member) { $memberFoundInAnotherSystem = true; } } - if ($memberData === null) { - if ($memberFoundInAnotherSystem) { - header("Location: /" . ($systemID === "gdapd" ? "cloudburst" : "raindrops") . "/" . $member) and die(); - } else { - header("Location: /?error=System member not found") and die(); - } + global $_SystemName; + $_SystemName = $system; + + if (str_ends_with($member, "-travelling")) { + header("Location: /" . substr($member, 0, strlen($member) - 11)) and die(); } - if ($travelling[$memberID]['travelling'] && !$traveller) { - header("Location: /" . ($systemID === "gdapd" ? "cloudburst" : "raindrops") . "/" . $member) and die(); + if (isset($parts[2]) && $parts[2] === "-" && isset($parts[3])) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.php')) { + global $_MemberPage; + $_MemberPage = $parts[3]; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.php'; + } else { + header("Location: /?error=Page not found: " . $parts[3]) and die(); + } + die(); } + global $_MemberName; + $_MemberName = $member; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member.php'; } diff --git a/pages/parser.php b/pages/parser.php index e3d70b8..cb07179 100644 --- a/pages/parser.php +++ b/pages/parser.php @@ -1,4 +1,4 @@ - +
diff --git a/pages/pleasure.php b/pages/pleasure.php new file mode 100644 index 0000000..db63f5a --- /dev/null +++ b/pages/pleasure.php @@ -0,0 +1,18 @@ + + +
+
+
+ +
+
+ + diff --git a/pages/prefix.php b/pages/prefix.php index 721baa5..73e9c8a 100644 --- a/pages/prefix.php +++ b/pages/prefix.php @@ -1,4 +1,4 @@ - +
diff --git a/pages/relations.php b/pages/relations.php index 54fc4ec..d0f5583 100644 --- a/pages/relations.php +++ b/pages/relations.php @@ -5,9 +5,9 @@

Relations

0 || count($member["_metadata"]["sisters"]) > 0): ?> -
- /"> - .png" style="width:24px;"> +
;"> + "> + .png" style="width:24px;">
@@ -16,7 +16,7 @@ None - /">.png" style="width:24px;"> ,
'); $index++; ?> + ">.png" style="width:24px;"> ,
'); $index++; ?>
@@ -27,10 +27,23 @@ None - /">.png" style="width:24px;"> ,
'); $index++; ?> + ">.png" style="width:24px;"> ,
'); $index++; ?>
+ + +
+ Caretakers:
+ + None + + + ">.png" style="width:24px;"> ,
'); $index++; ?> + + +
+
@@ -57,9 +70,12 @@ margin-top: 10px; margin-left: 0 !important; padding: 10px 0 !important; - text-align: center; } } + + .relation-item { + text-align: center; + }
diff --git a/pages/score.php b/pages/score.php index 0074016..96a9d17 100644 --- a/pages/score.php +++ b/pages/score.php @@ -3,7 +3,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /login") and die(); -$title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +$title = "Score system testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?> @@ -16,7 +16,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores = []; foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { - if ($member["name"] !== "unknown") { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && !str_ends_with($member["name"], "-travelling")) { require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); @@ -37,7 +37,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores = []; foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { - if ($member["name"] !== "unknown") { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && !str_ends_with($member["name"], "-travelling")) { $name = $member["display_name"] ?? $member["name"]; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); @@ -45,7 +45,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores[] = [ "name" => $name, - "page" => "/raindrops/" . $member["name"], + "page" => "/" . $member["name"], "score" => $score["total"], "details" => $score ]; @@ -73,7 +73,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores = []; foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { - if ($member["name"] !== "unknown") { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && !str_ends_with($member["name"], "-travelling")) { require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); @@ -94,7 +94,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores = []; foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { - if ($member["name"] !== "unknown") { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && !str_ends_with($member["name"], "-travelling")) { $name = $member["display_name"] ?? $member["name"]; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); @@ -102,7 +102,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores[] = [ "name" => $name, - "page" => "/cloudburst/" . $member["name"], + "page" => "/" . $member["name"], "score" => $score["total"], "details" => $score ]; @@ -129,7 +129,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores = []; foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { - if ($member["name"] !== "unknown") { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && !str_ends_with($member["name"], "-travelling")) { require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); @@ -138,7 +138,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl } } foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { - if ($member["name"] !== "unknown") { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && !str_ends_with($member["name"], "-travelling")) { require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); @@ -159,7 +159,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores = []; foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { - if ($member["name"] !== "unknown") { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && !str_ends_with($member["name"], "-travelling")) { $name = $member["display_name"] ?? $member["name"]; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); @@ -167,14 +167,14 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores[] = [ "name" => $name, - "page" => "/raindrops/" . $member["name"], + "page" => "/" . $member["name"], "score" => $score["total"], "details" => $score ]; } } foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { - if ($member["name"] !== "unknown") { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && !str_ends_with($member["name"], "-travelling")) { $name = $member["display_name"] ?? $member["name"]; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); @@ -182,7 +182,7 @@ $title = "Score System Testing"; require_once $_SERVER['DOCUMENT_ROOT'] . '/incl $scores[] = [ "name" => $name, - "page" => "/cloudburst/" . $member["name"], + "page" => "/" . $member["name"], "score" => $score["total"], "details" => $score ]; diff --git a/pages/splitting.php b/pages/splitting.php new file mode 100644 index 0000000..fab97f1 --- /dev/null +++ b/pages/splitting.php @@ -0,0 +1,57 @@ + + +
+
+
+

Members by splitting date

+ +
+ "> + .png" style="width:24px;">  + + +
+ Formed at least () +
+
+ +
+ + +
+ + diff --git a/pages/travelling.php b/pages/travelling.php index 260ea15..affe92e 100644 --- a/pages/travelling.php +++ b/pages/travelling.php @@ -3,18 +3,93 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /login") and die(); $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; if (isset($_GET['toggleTravel'])) { if (isset($travelling[$_GET['member']])) { + $id = $_GET['member']; + $member = getSystemMember(getMemberSystem($id), $id); + $system = getMemberSystem($id); + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-$id-metadata.json"), true)); + $travellingSystem = $system === "gdapd" ? "ynmuc" : "gdapd"; + if ($travelling[$_GET['member']]["travelling"]) { + $travelling[$_GET['member']]["travelling"] = false; $travelling[$_GET['member']]["history"][count($travelling[$_GET['member']]["history"]) - 1]["end"] = date("c"); + + // Insert code here to run after a travelling member is DELETED. + // $id is the member ID (e.g. rirgf) + // $member is the member object + // $system is the ID of the system the member comes from + // $travellingSystem is the ID of the system the member visits + // $metadata is the ponies.equestria.horse metadata object + // $travellingMember is the member ID from the other system + if (isset($travelling[$_GET['member']]["pluralkit"])) { + $travellingMember = $travelling[$_GET['member']]["pluralkit"]; + $reqOptions = [ + 'http' => [ + 'method' => "DELETE", + 'header' => "Authorization: " . $app["pluralkit"][$travellingSystem === "gdapd" ? "raindrops" : "cloudburst"] + ] + ]; + + $reqContext = stream_context_create($reqOptions); + + // No actual data is received on DELETE, so we don't even bother trying to collect req response; if it fails it will put a warning in the logs anyway. + sleep(1); + file_get_contents("https://api.pluralkit.me/v2/members/$travellingMember", false, $reqContext); + } } else { $travelling[$_GET['member']]["travelling"] = true; + $travelling[$_GET['member']]["pluralkit"] = null; $travelling[$_GET['member']]["history"][] = [ "start" => date("c"), "end" => null ]; + + // Insert code here to run after a travelling member is ADDED. + // $id is the member ID (e.g. rirgf) + // $member is the member + // $system is the system the member comes from + // $metadata is the ponies.equestria.horse metadata + // $travellingMember is unset here + // Store the travelling member ID in $travelling[$id]['pluralkit'] + $reqOptions = [ + 'http' => [ + 'method' => "POST", + 'header' => "Authorization: " . $app["pluralkit"][$travellingSystem === "gdapd" ? "raindrops" : "cloudburst"] . "\r\n" . + "Content-Type: application/json", + 'content' => json_encode([ + 'name' => "$member[name]-travelling", + 'display_name' => $member["display_name"], + 'color' => $member["color"], + 'birthday' => $member["birthday"], + 'created' => $member["created"], + 'pronouns' => $member["pronouns"], + 'avatar_url' => $member["avatar_url"], + 'banner' => $member["banner"], + 'description' => "**This pony is visiting this system from the " . ($system === "gdapd" ? "Raindrops System" : "Cloudburst System") . ". They are not a permanent member of this system**\n\n$member[description]", + 'proxy_tags' => array_map(function ($i) { + $i["prefix"] = "+" . $i['prefix']; + return $i; + }, $member["proxy_tags"]), + 'privacy' => $member["privacy"] + ]) + ] + ]; + + $reqContext = stream_context_create($reqOptions); + + sleep(1); + $member = json_decode(file_get_contents("https://api.pluralkit.me/v2/members", false, $reqContext), true); + + // Member exists? + if (isset($member)) { + $travelling[$id]['pluralkit'] = $member["id"]; + } } } @@ -23,7 +98,7 @@ if (isset($_GET['toggleTravel'])) { die(); } -$title = "System Travelling"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +$title = "System travels manager"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; global $travelling; ?> @@ -44,8 +119,8 @@ global $travelling;

System Travelling