From 29928887e733f3bc2c2baaf06dafd495a006753b Mon Sep 17 00:00:00 2001 From: Minteck Date: Fri, 3 Mar 2023 07:04:02 +0100 Subject: Updated 18 files and added 10 files (automated) --- pages/api/ponytown.php | 117 ++++++++++++++++++++++ pages/docs.inc | 2 +- pages/home.old.inc | 12 --- pages/money.inc | 55 ++++++++++- pages/ponytown.inc | 258 +++++++++++++++++++++++++++++++++++++++++++++++++ pages/rules.inc | 2 +- pages/stats.inc | 3 - 7 files changed, 430 insertions(+), 19 deletions(-) create mode 100644 pages/api/ponytown.php create mode 100644 pages/ponytown.inc (limited to 'pages') diff --git a/pages/api/ponytown.php b/pages/api/ponytown.php new file mode 100644 index 0000000..f41ac01 --- /dev/null +++ b/pages/api/ponytown.php @@ -0,0 +1,117 @@ + 70) { + $errors[] = "0x{$_}000002A: Image #" . $_ . " is wider than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; + } + + if ($_ === 1 && $size[1] > 70) { + $errors[] = "0x{$_}000002B: Image #" . $_ . " is higher than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; + } + + if ($_ === 2 && $size[0] > 35) { + $errors[] = "0x{$_}000002A: Image #" . $_ . " is wider than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; + } + + if ($_ === 2 && $size[1] > 35) { + $errors[] = "0x{$_}000002B: Image #" . $_ . " is higher than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; + } +} + +if (count($errors) === 0 && isset($_GET["real"])) { + foreach ([1, 2] as $_) { + $input = $json_object[$_ - 1]; + + $mime = explode(";", substr($input, 5))[0]; + $file = base64_decode(explode(",", explode(";", substr($input, 5))[1])[1]); + + $image = @imagecreatefromstring($file); + + imagealphablending($image, false); + imagesavealpha($image, true); + + if ($_ === 1) { + imagepng($image, $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png"); + } else { + imagepng($image, $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png"); + } + } +} + +die(json_encode([ + "success" => count($errors) === 0, + "errors" => $errors +])); \ No newline at end of file diff --git a/pages/docs.inc b/pages/docs.inc index 3b212df..2e43727 100644 --- a/pages/docs.inc +++ b/pages/docs.inc @@ -345,7 +345,7 @@ function showDocument($item) { ?> time = new Date(time).getTime(); } - let periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"]; + let periods = ["sec", "min", "hr", "d", "wk", "mo", "y", "ages"]; let lengths = ["60", "60", "24", "7", "4.35", "12", "100"]; diff --git a/pages/home.old.inc b/pages/home.old.inc index 4249947..f918549 100644 --- a/pages/home.old.inc +++ b/pages/home.old.inc @@ -47,18 +47,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
- - - -
diff --git a/pages/money.inc b/pages/money.inc index b297231..257b87f 100644 --- a/pages/money.inc +++ b/pages/money.inc @@ -1,5 +1,8 @@ $account["currency"] === "gbp" ? "£" : "€" . abs((float)$_GET["amount"]) . " were " . ((float)$_GET["amount"] >= 0 ? "added" : "removed") . " just now" . (trim($_GET["description"]) !== "" ? ": " . $_GET["description"] : "") + 'content' => ($account["currency"] === "gbp" ? "£" : "€") . abs((float)$_GET["amount"]) . " were " . ((float)$_GET["amount"] >= 0 ? "added" : "removed") . " just now" . (trim($_GET["description"]) !== "" ? ": " . $_GET["description"] : "") ] ])); @@ -96,7 +99,7 @@ if ((isset($_GET["create"]) || isset($_GET["delete"])) && isset($parts[2])) { "Title: " . (getMember($myId)["display_name"] ?? getMember($myId)["name"]) . " deleted a transaction from " . $account["name"] . " (" . ucfirst($account["owner"]) . ")\r\n" . "Tags: bits\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => $account["currency"] === "gbp" ? "£" : "€" . abs((float)$account["transactions"][(int)$_GET["id"]]["amount"]) . " " . ((float)$account["transactions"][(int)$_GET["id"]]["amount"] >= 0 ? "advance" : "withdrawal") . " created by " . (getMemberWithoutSystem($account["transactions"][(int)$_GET["id"]]["author"])["display_name"] ?? getMemberWithoutSystem($account["transactions"][(int)$_GET["id"]]["author"])["name"]) . " " . timeAgo($account["transactions"][(int)$_GET["id"]]["date"]) + 'content' => ($account["currency"] === "gbp" ? "£" : "€") . abs((float)$account["transactions"][(int)$_GET["id"]]["amount"]) . " " . ((float)$account["transactions"][(int)$_GET["id"]]["amount"] >= 0 ? "advance" : "withdrawal") . " created by " . (getMemberWithoutSystem($account["transactions"][(int)$_GET["id"]]["author"])["display_name"] ?? getMemberWithoutSystem($account["transactions"][(int)$_GET["id"]]["author"])["name"]) . " " . timeAgo($account["transactions"][(int)$_GET["id"]]["date"]) ] ])); @@ -297,6 +300,30 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+ +
+ $minimumCloudburst) { + $part2 = ($allAccounts - $minimumCloudburst) / $allAccounts; + $part1 = 1 - $part2; + $difference = $allAccounts - $minimumCloudburst; + } else { + $part1 = 1; + $part2 = 0; + $difference = $minimumCloudburst - $allAccounts; + } + + ?> +
+
+
+

">£ $minimumCloudburst): ?> (%) $minimumCloudburst ? "over" : "under" ?> the minimum

+ + +
+ $minimumRaindrops) { + $part2 = ($allAccounts - $minimumRaindrops) / $allAccounts; + $part1 = 1 - $part2; + $difference = $allAccounts - $minimumRaindrops; + } else { + $part1 = 1; + $part2 = 0; + $difference = $minimumRaindrops - $allAccounts; + } + + ?> +
+
+
+

">€ $minimumCloudburst): ?> (%) $minimumRaindrops ? "over" : "under" ?> the minimum

+ + +
+
+
+

Pony Town uploader for

+ + +
Successfully uploaded a new Pony Town character for this member, it may take a few minutes to update across the website.
+ + +
+
+
+

Current version

+ +
+
+ " style="width: 100%; border: 1px dashed rgba(255, 255, 255, .5); border-radius: 10px;"> +
+
+ " style="width: 100%; border: 1px dashed rgba(255, 255, 255, .5); border-radius: 10px;"> +
+
+ + 60): ?> +

This Pony Town character needs to be updated.
Cold Haze now relies on pixel-perfect versions of one's Pony Town character to work properly, and the current character for this member is not compliant or non-existant.

+ +
+
+ +
+
+

Upload a new version

+ +
+
    +
  1. Open Pony Town [main, event, eventblue, eventgreen, breezy], login if needed, and select the right pony
  2. +
  3. Click on edit
  4. +
  5. Focus on Export and click on Image export zoom
  6. +
  7. In the menu, select 1x
  8. +
  9. Click on Image export settings and uncheck everything, like this:
    [all settings unchecked]
  10. +
  11. Click on PNG and download the file to your device
  12. +
  13. Upload this file here (yes this is a button):
  14. +
  15. Go back to Pony Town, click on Image export settings again
  16. +
  17. Check "Head only", and nothing else, like this:
    [Head only checked]
  18. +
  19. Click on PNG once again and download the file to your device
  20. +
  21. Upload this file (the second one) here (yes this is also a button):
  22. +
  23. We will check if you used the correct settings and save it if everything is good.
  24. +
+
+ + + + + + +
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/pages/rules.inc b/pages/rules.inc index 7257cf1..ec007df 100644 --- a/pages/rules.inc +++ b/pages/rules.inc @@ -117,7 +117,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';