summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-04-03 22:22:48 +0200
committerRaindropsSys <contact@minteck.org>2023-04-03 22:22:48 +0200
commit704e1c22efe6056b0fc2f59b2766f47e1c8d71cc (patch)
tree25c3c3980c115e7bcbc60e62f4b3d3f7fc184c71 /includes
parentbbf20f987bb6a7561be3d98518ddaa41b71eaf67 (diff)
downloadpluralconnect-704e1c22efe6056b0fc2f59b2766f47e1c8d71cc.tar.gz
pluralconnect-704e1c22efe6056b0fc2f59b2766f47e1c8d71cc.tar.bz2
pluralconnect-704e1c22efe6056b0fc2f59b2766f47e1c8d71cc.zip
Updated 19 files and added 12 files (automated)
Diffstat (limited to 'includes')
-rw-r--r--includes/components/navigation.inc32
-rw-r--r--includes/components/sysbanner.inc8
-rw-r--r--includes/external/chvfs/index.js3
-rw-r--r--includes/external/discord/cache.json2
-rw-r--r--includes/external/discord/node_modules/.package-lock.json13
-rw-r--r--includes/external/discord/start.sh3
-rw-r--r--includes/jobs/FrontersNotification.php13
-rw-r--r--includes/jobs/PKFronters.php8
-rw-r--r--includes/jobs/PKMembers.php9
-rw-r--r--includes/jobs/PKSwitches.php20
-rw-r--r--includes/jobs/PKSystem.php8
-rw-r--r--includes/jobs/UpdateAssets.php9
-rw-r--r--includes/jobs/UpdateLogo.php116
-rw-r--r--includes/lowertokens/2d418045034cbc5a5965201c4ae811520681762e2a5c109396e057f82b2f52731
-rw-r--r--includes/lowertokens/42cd9b69c7ae246d8f1387371671db63a0e989a7e16819b770cb16e137d08aa51
-rw-r--r--includes/lowertokens/4603277f84413087b2e908d8e89bf664ef046e481eb4ae0fef29d91e192c75ee1
-rw-r--r--includes/lowertokens/78e12095fc9f96617fb264fe879e7ca8161b0276691da279d184f29a6d8d86a41
-rw-r--r--includes/lowertokens/ee685f047ea684468cc641bf792d9ab5983260b645be9e91ec74b0d1dd430e8a1
-rw-r--r--includes/lowertokens/fd6817b78ef51afad3e01744ea1193debb6d0f8ac6c60271f51fa9d67ba677c91
-rw-r--r--includes/pages.json24
-rw-r--r--includes/refresh/assets.inc86
-rw-r--r--includes/refresh/cleanup.inc24
-rw-r--r--includes/refresh/logo.inc322
-rw-r--r--includes/system/compare.inc20
24 files changed, 545 insertions, 181 deletions
diff --git a/includes/components/navigation.inc b/includes/components/navigation.inc
index 29168ec..4f7a51f 100644
--- a/includes/components/navigation.inc
+++ b/includes/components/navigation.inc
@@ -142,6 +142,14 @@ $navigation_admin = [
"private" => true
],
[
+ "name" => $pages["contacts"]["name"][$lang["_name"]],
+ "icon" => "/assets/icons/contacts.svg",
+ "invert" => true,
+ "link" => "/-/contacts",
+ "stepped" => null,
+ "private" => true
+ ],
+ [
"name" => $pages["schedules"]["name"][$lang["_name"]],
"icon" => "/assets/icons/schedules.svg",
"invert" => true,
@@ -310,14 +318,6 @@ $navigation_cloudburst = [
"link" => "/cloudburst/-/history",
"stepped" => null,
"private" => false
- ],
- [
- "name" => $pages["s:compare"]["name"][$lang["_name"]],
- "icon" => "/assets/icons/compare.svg",
- "invert" => true,
- "link" => "/cloudburst/-/compare",
- "stepped" => null,
- "private" => false
]
]
],
@@ -353,14 +353,6 @@ $navigation_other = [
"link" => "/" . $app["other"]["slug"] . "/-/history",
"stepped" => null,
"private" => false
- ],
- [
- "name" => $pages["s:compare"]["name"][$lang["_name"]],
- "icon" => "/assets/icons/compare.svg",
- "invert" => true,
- "link" => "/" . $app["other"]["slug"] . "/-/compare",
- "stepped" => null,
- "private" => false
]
]
],
@@ -396,14 +388,6 @@ $navigation_raindrops = [
"link" => "/raindrops/-/history",
"stepped" => null,
"private" => false
- ],
- [
- "name" => $pages["s:compare"]["name"][$lang["_name"]],
- "icon" => "/assets/icons/compare.svg",
- "invert" => true,
- "link" => "/raindrops/-/compare",
- "stepped" => null,
- "private" => false
]
]
],
diff --git a/includes/components/sysbanner.inc b/includes/components/sysbanner.inc
index 8819617..a650cd0 100644
--- a/includes/components/sysbanner.inc
+++ b/includes/components/sysbanner.inc
@@ -84,13 +84,11 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
</div>
</div>
-<div id="system-actions" style="padding:5px 30px;display:grid;grid-template-columns: 1fr 1fr;background-color:rgba(255, 255, 255, .025);margin-left: -20px; margin-right: -20px;">
+<div id="system-actions" style="padding:5px 30px;display:grid;grid-template-columns: 0.5fr 1fr 0.5fr;background-color:rgba(255, 255, 255, .025);margin-left: -20px; margin-right: -20px;">
+ <div></div>
<a title="<?= $pages["s:history"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/history">
<img src="/assets/icons/history.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
<span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:history"]["name"][$lang["_name"]] ?></span>
</a>
- <a title="<?= $pages["s:compare"]["name"][$lang["_name"]] ?>" data-bs-toggle="tooltip" style="display:inline-block;padding:5px 10px;text-align: center" class="system-action tooltip-nohelp" href="/<?= $system ?>/-/compare">
- <img src="/assets/icons/compare.svg" style="vertical-align: middle;height: 24px;width: 24px;filter: invert(1)" alt="">
- <span style="vertical-align: middle;" class="list-separator-desktop"><?= $pages["s:compare"]["name"][$lang["_name"]] ?></span>
- </a>
+ <div></div>
</div> \ No newline at end of file
diff --git a/includes/external/chvfs/index.js b/includes/external/chvfs/index.js
index 0dfd958..fda57bf 100644
--- a/includes/external/chvfs/index.js
+++ b/includes/external/chvfs/index.js
@@ -5,6 +5,7 @@ const watch = require('node-watch');
const child_process = require('child_process');
const fs = require('fs').promises;
const fss = require('fs');
+const path = require('path');
process.on('uncaughtException', (e) => {
console.error(e);
@@ -63,6 +64,7 @@ setInterval(async () => {
await fs.unlink("/opt/peh_save/" + item.file.substring(5));
} else {
console.log("Copying " + item.file);
+ try { await fs.mkdir(path.dirname(item.file), { recursive: true }); } catch (e) {}
await fs.copyFile(item.file, "/opt/peh_save/" + item.file.substring(5));
}
} catch (e) {
@@ -83,6 +85,7 @@ process.on('exit', () => {
fss.unlinkSync("/opt/peh_save/" + item.file.substring(5));
} else {
console.log("Copying " + item.file);
+ try { fss.mkdirSync(path.dirname(item.file), { recursive: true }); } catch (e) {}
fss.copyFileSync(item.file, "/opt/peh_save/" + item.file.substring(5));
}
} catch (e) {
diff --git a/includes/external/discord/cache.json b/includes/external/discord/cache.json
index fa1f1d5..22c9216 100644
--- a/includes/external/discord/cache.json
+++ b/includes/external/discord/cache.json
@@ -1 +1 @@
-{"channels":[null,null,null,null,null],"activity":{"1087010851602571425":1679234722655,"1087015883085463573":1679235182306,"1087017727539023973":1679235904280,"1087043159206412338":1679241685440}} \ No newline at end of file
+{"channels":[null,null,null,null,null,null,null,null,null,null],"activity":{"1087010851602571425":1679234722655,"1087015883085463573":1679235182306,"1087017727539023973":1679235904280,"1087043159206412338":1679241685440,"1087085298762121299":1679251823254,"1087174430561677382":1679277206837,"1088999061585150014":1679713147799,"1089707298554916954":1679882765101,"1091519240491782194":1680313791225}} \ No newline at end of file
diff --git a/includes/external/discord/node_modules/.package-lock.json b/includes/external/discord/node_modules/.package-lock.json
index 59e744b..a8e405c 100644
--- a/includes/external/discord/node_modules/.package-lock.json
+++ b/includes/external/discord/node_modules/.package-lock.json
@@ -274,19 +274,6 @@
"node": ">=8"
}
},
- "node_modules/fsevents": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
- "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
- "hasInstallScript": true,
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
- }
- },
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
diff --git a/includes/external/discord/start.sh b/includes/external/discord/start.sh
new file mode 100644
index 0000000..b9c9404
--- /dev/null
+++ b/includes/external/discord/start.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+node register.js
+node bot.js \ No newline at end of file
diff --git a/includes/jobs/FrontersNotification.php b/includes/jobs/FrontersNotification.php
index f29a1e5..d342303 100644
--- a/includes/jobs/FrontersNotification.php
+++ b/includes/jobs/FrontersNotification.php
@@ -5,6 +5,8 @@ $_SERVER['DOCUMENT_ROOT'] = "../..";
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php';
use ColorThief\ColorThief;
+echo("Loading...\n");
+
if (!function_exists("formatPonypush")) {
function formatPonypush($message) {
return "Update to Ponypush 3.1.0 or later — (\$PA1$\$" . base64_encode($message) . "\$\$)";
@@ -14,6 +16,8 @@ if (!function_exists("formatPonypush")) {
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$system = $options["system"];
+echo("Processing for system $system\n");
+
if ($system === "gdapd") {
$name = "Raindrops System";
} elseif ($system === "ynmuc") {
@@ -36,12 +40,16 @@ if (count($fronters["members"]) > 0 && ($system !== $app["other"]["id"] || !isse
$metadata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member["id"] . ".json"), true);
if (!isset($metadata["birth"])) {
+ echo("Showing age warning\n");
showWarning($member["display_name"] ?? $member["name"], $member["name"], $system);
} else if (isset($metadata['birth']["age"]) && $metadata["birth"]["age"] === 0 && (!isset($metadata['birth']["year"]) || $metadata["birth"]["year"] < 1900)) {
+ echo("Showing age warning\n");
showWarning($member["display_name"] ?? $member["name"], $member["name"], $system);
} else if (isset($metadata['birth']["year"]) && $metadata["birth"]["year"] < 1900) {
+ echo("Showing age warning\n");
showWarning($member["display_name"] ?? $member["name"], $member["name"], $system);
} else if (!isset($metadata['birth']["year"]) && !isset($metadata['birth']["age"])) {
+ echo("Showing age warning\n");
showWarning($member["display_name"] ?? $member["name"], $member["name"], $system);
}
}
@@ -49,6 +57,7 @@ if (count($fronters["members"]) > 0 && ($system !== $app["other"]["id"] || !isse
}
if (count($fronters["members"]) > 1) {
+ echo("Creating context for 2 members\n");
$context = stream_context_create([
'http' => [
'method' => 'POST',
@@ -63,6 +72,7 @@ if (count($fronters["members"]) > 1) {
]
]);
} else if (count($fronters["members"]) > 0) {
+ echo("Creating context for 1 member\n");
$context = stream_context_create([
'http' => [
'method' => 'POST',
@@ -77,6 +87,7 @@ if (count($fronters["members"]) > 1) {
]
]);
} else {
+ echo("Creating context for no member (fallback pony)\n");
$context = stream_context_create([
'http' => [
'method' => 'POST',
@@ -93,6 +104,7 @@ if (count($fronters["members"]) > 1) {
}
if ($system !== $app["other"]["id"] || !isset($app["other"])) {
+ echo("Sending to general public channel\n");
file_get_contents('https://' . $ntfy["server"] . '/public-switches', false, $context);
}
@@ -104,4 +116,5 @@ if ($system === "gdapd") {
$topic = "main";
}
+echo("Sending to specific channel ($topic)\n");
file_get_contents('https://' . $ntfy["server"] . '/' . $topic, false, $context); \ No newline at end of file
diff --git a/includes/jobs/PKFronters.php b/includes/jobs/PKFronters.php
index 2649b7d..feb7fd3 100644
--- a/includes/jobs/PKFronters.php
+++ b/includes/jobs/PKFronters.php
@@ -5,10 +5,13 @@ $_SERVER['DOCUMENT_ROOT'] = "../..";
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php';
use ColorThief\ColorThief;
+echo("Loading...\n");
+
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$system = $options["system"];
if ($app["other"]["id"] === $system) {
+ echo("Using authentication\n");
$ctx = stream_context_create([
'http' => [
'method' => 'GET',
@@ -17,6 +20,7 @@ if ($app["other"]["id"] === $system) {
]
]);
} else {
+ echo("Not using authentication\n");
$ctx = stream_context_create([
'http' => [
'method' => 'GET'
@@ -24,8 +28,12 @@ if ($app["other"]["id"] === $system) {
]);
}
+echo("Fetching...\n");
$data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system/fronters", false, $ctx);
if (trim($data) !== "" && $data !== false) {
+ echo("Data is valid, saved it\n");
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json", $data);
+} else {
+ echo("Data is invalid\n");
} \ No newline at end of file
diff --git a/includes/jobs/PKMembers.php b/includes/jobs/PKMembers.php
index 536853d..7bcb242 100644
--- a/includes/jobs/PKMembers.php
+++ b/includes/jobs/PKMembers.php
@@ -5,10 +5,13 @@ $_SERVER['DOCUMENT_ROOT'] = "../..";
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php';
use ColorThief\ColorThief;
+echo("Loading...\n");
+
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$system = $options["system"];
if ($app["other"]["id"] === $system) {
+ echo("Using authentication\n");
$ctx = stream_context_create([
'http' => [
'method' => 'GET',
@@ -17,6 +20,7 @@ if ($app["other"]["id"] === $system) {
]
]);
} else {
+ echo("Not using authentication\n");
$ctx = stream_context_create([
'http' => [
'method' => 'GET'
@@ -24,9 +28,11 @@ if ($app["other"]["id"] === $system) {
]);
}
+echo("Fetching...\n");
$data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system/members", false, $ctx);
if (trim($data) !== "" && $data !== false) {
+ echo("Data is valid, saved it\n");
$parsed = json_decode($data, true);
foreach ($parsed as $index => $member) {
@@ -47,7 +53,10 @@ if (trim($data) !== "" && $data !== false) {
$data = json_encode($parsed, JSON_PRETTY_PRINT);
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/members.json", $data);
+} else {
+ echo("Data is invalid\n");
}
+echo("Cleared cache\n");
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/navigation.json", "{}");
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/home.json", "{}"); \ No newline at end of file
diff --git a/includes/jobs/PKSwitches.php b/includes/jobs/PKSwitches.php
index eb7d897..b7a755d 100644
--- a/includes/jobs/PKSwitches.php
+++ b/includes/jobs/PKSwitches.php
@@ -5,10 +5,13 @@ $_SERVER['DOCUMENT_ROOT'] = "../..";
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php';
use ColorThief\ColorThief;
+echo("Loading...\n");
+
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$system = $options["system"];
if ($app["other"]["id"] === $system) {
+ echo("Using authentication\n");
$ctx = stream_context_create([
'http' => [
'method' => 'GET',
@@ -17,6 +20,7 @@ if ($app["other"]["id"] === $system) {
]
]);
} else {
+ echo("Not using authentication\n");
$ctx = stream_context_create([
'http' => [
'method' => 'GET'
@@ -24,37 +28,38 @@ if ($app["other"]["id"] === $system) {
]);
}
-echo(" Part 1/6\n");
+echo("Fetching...\n");
+echo(" Part 1/6\n");
$switches1 = json_decode(file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system/switches", false, $ctx), true);
if (count($switches1) > 0) {
$oldest = $switches1[count($switches1) - 1]["timestamp"];
- echo(" Part 2/6\n");
+ echo(" Part 2/6\n");
$switches2 = json_decode(file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system/switches?before=$oldest", false, $ctx), true);
if (count($switches2) > 0) {
$oldest = $switches2[count($switches2) - 1]["timestamp"];
- echo(" Part 3/6\n");
+ echo(" Part 3/6\n");
$switches3 = json_decode(file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system/switches?before=$oldest", false, $ctx), true);
if (count($switches3) > 0) {
$oldest = $switches3[count($switches3) - 1]["timestamp"];
- echo(" Part 4/6\n");
+ echo(" Part 4/6\n");
$switches4 = json_decode(file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system/switches?before=$oldest", false, $ctx), true);
if (count($switches4) > 0) {
$oldest = $switches4[count($switches4) - 1]["timestamp"];
- echo(" Part 5/6\n");
+ echo(" Part 5/6\n");
$switches5 = json_decode(file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system/switches?before=$oldest", false, $ctx), true);
if (count($switches5) > 0) {
$oldest = $switches5[count($switches5) - 1]["timestamp"];
- echo(" Part 6/6\n");
+ echo(" Part 6/6\n");
$switches6 = json_decode(file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system/switches?before=$oldest", false, $ctx), true);
} else {
$switches6 = [];
@@ -73,5 +78,8 @@ if (count($switches1) > 0) {
}
if ($switches1 !== null && $switches2 !== null && $switches3 !== null && $switches4 !== null && $switches5 !== null && $switches6 !== null) {
+ echo("Data is valid, saved it\n");
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json", json_encode([...$switches1, ...$switches2, ...$switches3, ...$switches4, ...$switches5, ...$switches6], JSON_PRETTY_PRINT));
+} else {
+ echo("Data is invalid\n");
} \ No newline at end of file
diff --git a/includes/jobs/PKSystem.php b/includes/jobs/PKSystem.php
index 045eb67..6583e4f 100644
--- a/includes/jobs/PKSystem.php
+++ b/includes/jobs/PKSystem.php
@@ -5,10 +5,13 @@ $_SERVER['DOCUMENT_ROOT'] = "../..";
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php';
use ColorThief\ColorThief;
+echo("Loading...\n");
+
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$system = $options["system"];
if ($app["other"]["id"] === $system) {
+ echo("Using authentication\n");
$ctx = stream_context_create([
'http' => [
'method' => 'GET',
@@ -17,6 +20,7 @@ if ($app["other"]["id"] === $system) {
]
]);
} else {
+ echo("Not using authentication\n");
$ctx = stream_context_create([
'http' => [
'method' => 'GET'
@@ -24,8 +28,12 @@ if ($app["other"]["id"] === $system) {
]);
}
+echo("Fetching...\n");
$data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system", false, $ctx);
if (trim($data) !== "" && $data !== false) {
+ echo("Data is valid, saved it\n");
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/general.json", $data);
+} else {
+ echo("Data is invalid\n");
} \ No newline at end of file
diff --git a/includes/jobs/UpdateAssets.php b/includes/jobs/UpdateAssets.php
index e52a6fa..0c05686 100644
--- a/includes/jobs/UpdateAssets.php
+++ b/includes/jobs/UpdateAssets.php
@@ -5,6 +5,8 @@ $_SERVER['DOCUMENT_ROOT'] = "../..";
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php';
use ColorThief\ColorThief;
+echo("Loading...\n");
+
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
if (!file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars")) mkdir("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars");
@@ -22,6 +24,7 @@ function downloadAssets($system, $path = null) {
$general = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$path/general.json"), true);
if ($options["type"] === "system") {
+ echo("Download system assets\n");
if (isset($general["avatar_url"])) {
$id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]);
echo(" /avatars/$id.webp\n");
@@ -45,6 +48,7 @@ function downloadAssets($system, $path = null) {
$id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]) . preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $member["uuid"]);
if ($options["type"] === "members") {
+ echo("Downloading member assets\n");
if (isset($member["avatar_url"])) {
echo(" /avatars/$id.webp\n");
file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url']));
@@ -75,6 +79,7 @@ function downloadAssets($system, $path = null) {
}
if ($options["type"] === "ponytown") {
+ echo("Downloading Pony Town assets\n");
if (file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png")) {
$url = "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png";
} else {
@@ -91,9 +96,13 @@ function downloadAssets($system, $path = null) {
}
}
+echo("Downloading for gdapd\n");
downloadAssets("gdapd");
+
+echo("Downloading for ynmuc\n");
downloadAssets("ynmuc");
if (isset($app["other"]) && isset($app["other"]["id"]) && isset($app["other"]["token"])) {
+ echo("Downloading for other\n");
downloadAssets($app["other"]["id"], "other");
} \ No newline at end of file
diff --git a/includes/jobs/UpdateLogo.php b/includes/jobs/UpdateLogo.php
index add1fa9..9d669fc 100644
--- a/includes/jobs/UpdateLogo.php
+++ b/includes/jobs/UpdateLogo.php
@@ -5,10 +5,14 @@ $_SERVER['DOCUMENT_ROOT'] = "../..";
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php';
use ColorThief\ColorThief;
+echo("Loading...\n");
+
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc";
+echo("Generating public logo\n");
+
$columns = ceil(sqrt(count(scoreOrderGlobal())));
echo(" Using " . $columns . " columns\n");
@@ -111,119 +115,11 @@ unlink("/tmp/image.png");
imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo-template.png");
imagepng($img3, "/tmp/ponieslogo2.png");
-// --------------------------
-
-/*$columns = ceil(sqrt(count(array_filter(scoreOrderGlobal(), function ($i) {
- return $i["_system"] === "gdapd";
-}))));
-echo(" Using " . $columns . " columns\n");
-
-$members = array_values(array_filter(scoreOrderGlobal(), function ($i) {
- return $i["_system"] === "gdapd";
-}));
-
-usort($members, function ($a, $b) {
- $vr = hexdec(substr($a["color"], 0, 2));
- $vg = hexdec(substr($a["color"], 2, 2));
- $vb = hexdec(substr($a["color"], 4, 2));
-
- $hsl = rgbToHsl($vr, $vg, $vb);
- if ($hsl[0] == 0) $hsl[0] = 360;
- $ra = $hsl[0];
-
- $vr = hexdec(substr($b["color"], 0, 2));
- $vg = hexdec(substr($b["color"], 2, 2));
- $vb = hexdec(substr($b["color"], 4, 2));
-
- $hsl = rgbToHsl($vr, $vg, $vb);
- if ($hsl[0] == 0) $hsl[0] = 360;
- $rb = $hsl[0];
-
- return $ra - $rb;
-});
-
-echo(" " . count($members) . " members\n");
-
-$packs = [];
-$currentPack = [];
-
-foreach ($members as $member) {
- if (count($currentPack) >= $columns) {
- $packs[] = $currentPack;
- $currentPack = [];
- }
-
- $currentPack[] = $member["color"];
-}
-
-if (count($currentPack) > 0) $packs[] = $currentPack;
-
-$newPacks = [];
-foreach ($packs as $pack) {
- usort($pack, function ($a, $b) {
- $vra = hexdec(substr($a, 0, 2));
- $vga = hexdec(substr($a, 2, 2));
- $vba = hexdec(substr($a, 4, 2));
-
- $hsla = rgbToHsl($vra, $vga, $vba);
- $ra = $hsla[2] * $hsla[1];
-
- $vrb = hexdec(substr($b, 0, 2));
- $vgb = hexdec(substr($b, 2, 2));
- $vbb = hexdec(substr($b, 4, 2));
-
- $hslb = rgbToHsl($vrb, $vgb, $vbb);
- $rb = $hslb[2] * $hslb[1];
-
- return $rb < $ra;
- });
-
- while (count($pack) < $columns) $pack[] = "ffffff";
-
- $newPacks[] = $pack;
-}
-
-$img = imagecreatetruecolor($columns, $columns);
-$factor = 64;
-
-for ($y = 0; $y < $columns; ++$y) {
- for ($x = 0; $x < $columns; ++$x) {
- if (isset($newPacks[$y][$x])) {
- imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2))));
- } else {
- imagesetpixel($img, $x, $y, imagecolorallocate($img, 255, 255, 255));
- }
- }
-}
-
-$img2 = imagecreatetruecolor($columns * $factor, $columns * $factor);
-imagecopyresampled($img2, $img, 0, 0, 0, 0, $columns * $factor, $columns * $factor, $columns, $columns);
-
-imagepng($img2, "/tmp/image.png");
-$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
-unlink("/tmp/image.png");
-
-imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo2.png");
-imagepng($img3, "/tmp/ponieslogo1a.png");
-
-for ($x = 1; $x <= 120; $x++) {
- imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR);
-}
-
-imagefilter($img2, IMG_FILTER_BRIGHTNESS, -100);
-
-imagepng($img2, "/tmp/image.png");
-$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
-unlink("/tmp/image.png");
-
-imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo2-template.png");
-imagepng($img3, "/tmp/ponieslogo2a.png");*/
-
-// --------------------------
-
$isLoggedIn = true;
$isLowerLoggedIn = false;
+echo("Generating private logo\n");
+
$columns = ceil(sqrt(count(array_filter(scoreOrderGlobal()))));
echo(" Using " . $columns . " columns\n");
diff --git a/includes/lowertokens/2d418045034cbc5a5965201c4ae811520681762e2a5c109396e057f82b2f5273 b/includes/lowertokens/2d418045034cbc5a5965201c4ae811520681762e2a5c109396e057f82b2f5273
new file mode 100644
index 0000000..39ca943
--- /dev/null
+++ b/includes/lowertokens/2d418045034cbc5a5965201c4ae811520681762e2a5c109396e057f82b2f5273
@@ -0,0 +1 @@
+{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","name":"Lunar Aurora","login":"lunaraurora","banned":false,"guest":false,"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"profile":{"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"email":{"type":"EmailJSON","verified":true,"email":"lunar@lunaraurora.com"},"locale":{"name":"en","language":"en"},"attributes":[{"id":"d251756e-1200-4ee7-b06d-c07738489517-41-7","prototype":{"id":"d251756e-1200-4ee7-b06d-c07738489517","type":"Text"}}]},"details":[{"type":"LoginuserdetailsJSON","id":"36d9a741-cee8-4754-88b9-ba4968367b84"}],"VCSUserNames":[{"name":"lunaraurora"},{"name":"lunar@lunaraurora.com"}],"creationTime":1677088313965,"lastAccessTime":1678306788685,"refreshTokens":[{"id":"64-13"}],"approvedScopes":[{"id":"54-15"}],"twoFactorAuthentication":{"type":"TwoFactorAuthenticationJSON"},"requiredTwoFactorAuthentication":false} \ No newline at end of file
diff --git a/includes/lowertokens/42cd9b69c7ae246d8f1387371671db63a0e989a7e16819b770cb16e137d08aa5 b/includes/lowertokens/42cd9b69c7ae246d8f1387371671db63a0e989a7e16819b770cb16e137d08aa5
new file mode 100644
index 0000000..39ca943
--- /dev/null
+++ b/includes/lowertokens/42cd9b69c7ae246d8f1387371671db63a0e989a7e16819b770cb16e137d08aa5
@@ -0,0 +1 @@
+{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","name":"Lunar Aurora","login":"lunaraurora","banned":false,"guest":false,"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"profile":{"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"email":{"type":"EmailJSON","verified":true,"email":"lunar@lunaraurora.com"},"locale":{"name":"en","language":"en"},"attributes":[{"id":"d251756e-1200-4ee7-b06d-c07738489517-41-7","prototype":{"id":"d251756e-1200-4ee7-b06d-c07738489517","type":"Text"}}]},"details":[{"type":"LoginuserdetailsJSON","id":"36d9a741-cee8-4754-88b9-ba4968367b84"}],"VCSUserNames":[{"name":"lunaraurora"},{"name":"lunar@lunaraurora.com"}],"creationTime":1677088313965,"lastAccessTime":1678306788685,"refreshTokens":[{"id":"64-13"}],"approvedScopes":[{"id":"54-15"}],"twoFactorAuthentication":{"type":"TwoFactorAuthenticationJSON"},"requiredTwoFactorAuthentication":false} \ No newline at end of file
diff --git a/includes/lowertokens/4603277f84413087b2e908d8e89bf664ef046e481eb4ae0fef29d91e192c75ee b/includes/lowertokens/4603277f84413087b2e908d8e89bf664ef046e481eb4ae0fef29d91e192c75ee
new file mode 100644
index 0000000..39ca943
--- /dev/null
+++ b/includes/lowertokens/4603277f84413087b2e908d8e89bf664ef046e481eb4ae0fef29d91e192c75ee
@@ -0,0 +1 @@
+{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","name":"Lunar Aurora","login":"lunaraurora","banned":false,"guest":false,"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"profile":{"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"email":{"type":"EmailJSON","verified":true,"email":"lunar@lunaraurora.com"},"locale":{"name":"en","language":"en"},"attributes":[{"id":"d251756e-1200-4ee7-b06d-c07738489517-41-7","prototype":{"id":"d251756e-1200-4ee7-b06d-c07738489517","type":"Text"}}]},"details":[{"type":"LoginuserdetailsJSON","id":"36d9a741-cee8-4754-88b9-ba4968367b84"}],"VCSUserNames":[{"name":"lunaraurora"},{"name":"lunar@lunaraurora.com"}],"creationTime":1677088313965,"lastAccessTime":1678306788685,"refreshTokens":[{"id":"64-13"}],"approvedScopes":[{"id":"54-15"}],"twoFactorAuthentication":{"type":"TwoFactorAuthenticationJSON"},"requiredTwoFactorAuthentication":false} \ No newline at end of file
diff --git a/includes/lowertokens/78e12095fc9f96617fb264fe879e7ca8161b0276691da279d184f29a6d8d86a4 b/includes/lowertokens/78e12095fc9f96617fb264fe879e7ca8161b0276691da279d184f29a6d8d86a4
new file mode 100644
index 0000000..8ac1cd8
--- /dev/null
+++ b/includes/lowertokens/78e12095fc9f96617fb264fe879e7ca8161b0276691da279d184f29a6d8d86a4
@@ -0,0 +1 @@
+{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","name":"Lunar Aurora","login":"lunaraurora","banned":false,"guest":false,"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"profile":{"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"email":{"type":"EmailJSON","verified":true,"email":"lunar@lunaraurora.com"},"locale":{"name":"en","language":"en"},"attributes":[{"id":"d251756e-1200-4ee7-b06d-c07738489517-41-7","prototype":{"id":"d251756e-1200-4ee7-b06d-c07738489517","type":"Text"}}]},"details":[{"type":"LoginuserdetailsJSON","id":"36d9a741-cee8-4754-88b9-ba4968367b84"}],"VCSUserNames":[{"name":"lunaraurora"},{"name":"lunar@lunaraurora.com"}],"creationTime":1677088313965,"lastAccessTime":1679286716546,"refreshTokens":[{"id":"64-13"}],"approvedScopes":[{"id":"54-15"}],"twoFactorAuthentication":{"type":"TwoFactorAuthenticationJSON"},"requiredTwoFactorAuthentication":false} \ No newline at end of file
diff --git a/includes/lowertokens/ee685f047ea684468cc641bf792d9ab5983260b645be9e91ec74b0d1dd430e8a b/includes/lowertokens/ee685f047ea684468cc641bf792d9ab5983260b645be9e91ec74b0d1dd430e8a
new file mode 100644
index 0000000..39ca943
--- /dev/null
+++ b/includes/lowertokens/ee685f047ea684468cc641bf792d9ab5983260b645be9e91ec74b0d1dd430e8a
@@ -0,0 +1 @@
+{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","name":"Lunar Aurora","login":"lunaraurora","banned":false,"guest":false,"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"profile":{"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"email":{"type":"EmailJSON","verified":true,"email":"lunar@lunaraurora.com"},"locale":{"name":"en","language":"en"},"attributes":[{"id":"d251756e-1200-4ee7-b06d-c07738489517-41-7","prototype":{"id":"d251756e-1200-4ee7-b06d-c07738489517","type":"Text"}}]},"details":[{"type":"LoginuserdetailsJSON","id":"36d9a741-cee8-4754-88b9-ba4968367b84"}],"VCSUserNames":[{"name":"lunaraurora"},{"name":"lunar@lunaraurora.com"}],"creationTime":1677088313965,"lastAccessTime":1678306788685,"refreshTokens":[{"id":"64-13"}],"approvedScopes":[{"id":"54-15"}],"twoFactorAuthentication":{"type":"TwoFactorAuthenticationJSON"},"requiredTwoFactorAuthentication":false} \ No newline at end of file
diff --git a/includes/lowertokens/fd6817b78ef51afad3e01744ea1193debb6d0f8ac6c60271f51fa9d67ba677c9 b/includes/lowertokens/fd6817b78ef51afad3e01744ea1193debb6d0f8ac6c60271f51fa9d67ba677c9
new file mode 100644
index 0000000..b24fd76
--- /dev/null
+++ b/includes/lowertokens/fd6817b78ef51afad3e01744ea1193debb6d0f8ac6c60271f51fa9d67ba677c9
@@ -0,0 +1 @@
+{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","name":"Lunar Aurora","projectRoles":[{"type":"projectRole","id":"4f93b6d4-2de9-4f69-9a68-7a55af2ca56d","role":{"id":"35d43711-705d-4b7b-b4f2-3bc3f18dba54","key":"project-admin","name":"Project Admin","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"4bc77bee-1327-4a8b-8097-06b01cfb4ae9","role":{"id":"8da3cccc-5311-4aa3-8beb-4e217cc63e40","key":"youtrack-reporter","name":"Reporter","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"9d8605d5-91d3-4abd-be40-3637974c66e2","role":{"id":"c6248e99-77b9-4807-bf97-1ee65faa0b0e","key":"developer","name":"Developer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"55e67bb9-98b0-4df8-a884-7cc1bf28f7eb","role":{"id":"0b631a62-0169-4f7d-9007-f4c2f11f4c61","key":"code-viewer","name":"Code Viewer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"dfe14070-4660-4b7b-825b-fa068ecebab9","role":{"id":"fa88b885-7f80-468b-8205-f959f0a3708e","key":"documentation-reader","name":"Documentation Reader","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"33e2221a-c209-44e2-aba6-2ec268047ace","role":{"id":"632a45f3-5b60-4a58-995d-e5fab24643e0","key":"youtrack-helpdesk-reporter","name":"Helpdesk Reporter","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"fd692371-d16a-4af8-b7bb-f5a1a13d422f","role":{"id":"e0afffb6-2419-4d53-915d-0c76239f48ed","key":"youtrack-issue-reader","name":"Issue Reader","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"0010f607-bb0a-4f95-b6a2-1ab42609c3a1","role":{"id":"63c0029c-22ac-4e3e-ac2f-f3dc464f24a4","key":"observer","name":"Observer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}}],"transitiveProjectRoles":[{"type":"projectRole","id":"4f93b6d4-2de9-4f69-9a68-7a55af2ca56d","role":{"id":"35d43711-705d-4b7b-b4f2-3bc3f18dba54","key":"project-admin","name":"Project Admin","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"4bc77bee-1327-4a8b-8097-06b01cfb4ae9","role":{"id":"8da3cccc-5311-4aa3-8beb-4e217cc63e40","key":"youtrack-reporter","name":"Reporter","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"9d8605d5-91d3-4abd-be40-3637974c66e2","role":{"id":"c6248e99-77b9-4807-bf97-1ee65faa0b0e","key":"developer","name":"Developer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"55e67bb9-98b0-4df8-a884-7cc1bf28f7eb","role":{"id":"0b631a62-0169-4f7d-9007-f4c2f11f4c61","key":"code-viewer","name":"Code Viewer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"dfe14070-4660-4b7b-825b-fa068ecebab9","role":{"id":"fa88b885-7f80-468b-8205-f959f0a3708e","key":"documentation-reader","name":"Documentation Reader","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"33e2221a-c209-44e2-aba6-2ec268047ace","role":{"id":"632a45f3-5b60-4a58-995d-e5fab24643e0","key":"youtrack-helpdesk-reporter","name":"Helpdesk Reporter","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"fd692371-d16a-4af8-b7bb-f5a1a13d422f","role":{"id":"e0afffb6-2419-4d53-915d-0c76239f48ed","key":"youtrack-issue-reader","name":"Issue Reader","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}},{"type":"projectRole","id":"0010f607-bb0a-4f95-b6a2-1ab42609c3a1","role":{"id":"63c0029c-22ac-4e3e-ac2f-f3dc464f24a4","key":"observer","name":"Observer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"}}],"sourcedProjectRoles":[{"type":"sourcedProjectRole","id":"4f93b6d4-2de9-4f69-9a68-7a55af2ca56d","role":{"id":"35d43711-705d-4b7b-b4f2-3bc3f18dba54","key":"project-admin","name":"Project Admin","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"},"sources":[{"type":"ownRoleSource"}]},{"type":"sourcedProjectRole","id":"4bc77bee-1327-4a8b-8097-06b01cfb4ae9","role":{"id":"8da3cccc-5311-4aa3-8beb-4e217cc63e40","key":"youtrack-reporter","name":"Reporter","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"},"sources":[{"type":"ownRoleSource"}]},{"type":"sourcedProjectRole","id":"9d8605d5-91d3-4abd-be40-3637974c66e2","role":{"id":"c6248e99-77b9-4807-bf97-1ee65faa0b0e","key":"developer","name":"Developer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"},"sources":[{"type":"ownRoleSource"}]},{"type":"sourcedProjectRole","id":"55e67bb9-98b0-4df8-a884-7cc1bf28f7eb","role":{"id":"0b631a62-0169-4f7d-9007-f4c2f11f4c61","key":"code-viewer","name":"Code Viewer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"},"sources":[{"type":"ownRoleSource"}]},{"type":"sourcedProjectRole","id":"dfe14070-4660-4b7b-825b-fa068ecebab9","role":{"id":"fa88b885-7f80-468b-8205-f959f0a3708e","key":"documentation-reader","name":"Documentation Reader","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"},"sources":[{"type":"ownRoleSource"}]},{"type":"sourcedProjectRole","id":"33e2221a-c209-44e2-aba6-2ec268047ace","role":{"id":"632a45f3-5b60-4a58-995d-e5fab24643e0","key":"youtrack-helpdesk-reporter","name":"Helpdesk Reporter","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"},"sources":[{"type":"ownRoleSource"}]},{"type":"sourcedProjectRole","id":"fd692371-d16a-4af8-b7bb-f5a1a13d422f","role":{"id":"e0afffb6-2419-4d53-915d-0c76239f48ed","key":"youtrack-issue-reader","name":"Issue Reader","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"},"sources":[{"type":"ownRoleSource"}]},{"type":"sourcedProjectRole","id":"0010f607-bb0a-4f95-b6a2-1ab42609c3a1","role":{"id":"63c0029c-22ac-4e3e-ac2f-f3dc464f24a4","key":"observer","name":"Observer","immutable":false},"project":{"id":"74860131-311e-427a-9b04-de71b9019fce"},"owner":{"type":"user","id":"ce1606a9-344f-4547-bffe-bc2ab0eebfa8","login":"lunaraurora"},"sources":[{"type":"ownRoleSource"}]}],"transitiveOrganizationRoles":[{"type":"organizationRole","id":"cf6b4afc-fbde-42a1-ace7-568f92ec1877","role":{"id":"e0afffb6-2419-4d53-915d-0c76239f48ed","key":"youtrack-issue-reader","name":"Issue Reader","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}},{"type":"organizationRole","id":"763ed6a0-7fd5-46b7-9dcc-c6a0aabff98d","role":{"id":"8da3cccc-5311-4aa3-8beb-4e217cc63e40","key":"youtrack-reporter","name":"Reporter","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}},{"type":"organizationRole","id":"db3aab4d-bc13-4b8d-9d53-a31d8d8edcd6","role":{"id":"fa88b885-7f80-468b-8205-f959f0a3708e","key":"documentation-reader","name":"Documentation Reader","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}},{"type":"organizationRole","id":"e139475c-c661-4c5d-aa81-5ca2b61dfdd8","role":{"id":"63c0029c-22ac-4e3e-ac2f-f3dc464f24a4","key":"observer","name":"Observer","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}},{"type":"organizationRole","id":"fc439119-866a-4b8b-9215-a605b13b22ca","role":{"id":"632a45f3-5b60-4a58-995d-e5fab24643e0","key":"youtrack-helpdesk-reporter","name":"Helpdesk Reporter","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}}],"sourcedOrganizationRoles":[{"type":"sourcedOrganizationRole","id":"cf6b4afc-fbde-42a1-ace7-568f92ec1877","role":{"id":"e0afffb6-2419-4d53-915d-0c76239f48ed","key":"youtrack-issue-reader","name":"Issue Reader","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}},{"type":"sourcedOrganizationRole","id":"763ed6a0-7fd5-46b7-9dcc-c6a0aabff98d","role":{"id":"8da3cccc-5311-4aa3-8beb-4e217cc63e40","key":"youtrack-reporter","name":"Reporter","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}},{"type":"sourcedOrganizationRole","id":"db3aab4d-bc13-4b8d-9d53-a31d8d8edcd6","role":{"id":"fa88b885-7f80-468b-8205-f959f0a3708e","key":"documentation-reader","name":"Documentation Reader","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}},{"type":"sourcedOrganizationRole","id":"e139475c-c661-4c5d-aa81-5ca2b61dfdd8","role":{"id":"63c0029c-22ac-4e3e-ac2f-f3dc464f24a4","key":"observer","name":"Observer","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}},{"type":"sourcedOrganizationRole","id":"fc439119-866a-4b8b-9215-a605b13b22ca","role":{"id":"632a45f3-5b60-4a58-995d-e5fab24643e0","key":"youtrack-helpdesk-reporter","name":"Helpdesk Reporter","immutable":false},"organization":{"id":"957f7b0e-3aa3-4c08-9fb2-d708e8b23ff4"}}],"login":"lunaraurora","banned":false,"guest":false,"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"profile":{"avatar":{"type":"defaultavatar","url":"https:\/\/auth.equestria.horse\/hub\/api\/rest\/avatar\/ce1606a9-344f-4547-bffe-bc2ab0eebfa8"},"email":{"type":"EmailJSON","verified":true,"email":"lunar@lunaraurora.com"},"locale":{"name":"en","language":"en"},"attributes":[{"id":"d251756e-1200-4ee7-b06d-c07738489517-41-7","prototype":{"id":"d251756e-1200-4ee7-b06d-c07738489517","type":"Text"}}]},"groups":[{"type":"userGroup","id":"0083bb84-f62e-4b8e-b699-eb6a2599280c"}],"transitiveGroups":[{"type":"userGroup","id":"c512043f-cbb4-45e1-8d39-583c34d13b2a"},{"type":"userGroup","id":"0083bb84-f62e-4b8e-b699-eb6a2599280c"}],"details":[{"type":"LoginuserdetailsJSON","id":"36d9a741-cee8-4754-88b9-ba4968367b84"}],"VCSUserNames":[{"name":"lunaraurora"},{"name":"lunar@lunaraurora.com"}],"creationTime":1677088313965,"lastAccessTime":1680266516898,"refreshTokens":[{"id":"64-13"},{"id":"64-18"}],"approvedScopes":[{"id":"54-15"}],"twoFactorAuthentication":{"type":"TwoFactorAuthenticationJSON"},"requiredTwoFactorAuthentication":false} \ No newline at end of file
diff --git a/includes/pages.json b/includes/pages.json
index 748234f..d64b2c2 100644
--- a/includes/pages.json
+++ b/includes/pages.json
@@ -1,14 +1,14 @@
{
"alphabet": {
"name": {
- "en": "Members by prefix letters"
+ "en": "By prefix letters"
},
"admin": false,
"limited": false
},
"byfront": {
"name": {
- "en": "Members by last fronted"
+ "en": "By last fronted"
},
"admin": true,
"limited": true
@@ -20,6 +20,13 @@
"admin": true,
"limited": false
},
+ "contacts": {
+ "name": {
+ "en": "Address book"
+ },
+ "admin": true,
+ "limited": false
+ },
"docs": {
"name": {
"en": "Documents"
@@ -139,13 +146,6 @@
"admin": true,
"limited": false
},
- "s:compare": {
- "name": {
- "en": "Compare members"
- },
- "admin": false,
- "limited": false
- },
"s:history": {
"name": {
"en": "Front history"
@@ -155,7 +155,7 @@
},
"s:species": {
"name": {
- "en": "Members by species"
+ "en": "By species"
},
"admin": false,
"limited": false
@@ -169,7 +169,7 @@
},
"splitting": {
"name": {
- "en": "Members by splitting date"
+ "en": "By splitting date"
},
"admin": true,
"limited": true
@@ -197,7 +197,7 @@
},
"travelling": {
"name": {
- "en": "System travels manager"
+ "en": "System travelling"
},
"admin": true,
"limited": true
diff --git a/includes/refresh/assets.inc b/includes/refresh/assets.inc
new file mode 100644
index 0000000..b27840a
--- /dev/null
+++ b/includes/refresh/assets.inc
@@ -0,0 +1,86 @@
+<?php
+
+global $app;
+
+if (!file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars")) mkdir("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars");
+if (!file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners")) mkdir("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners");
+if (!file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/heads")) mkdir("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/heads");
+if (!file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/bodies")) mkdir("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/bodies");
+
+function downloadAssets($system, $path = null) {
+ if (!isset($path)) {
+ $path = $system;
+ }
+
+ $general = json_decode(file_get_contents("./data/$path/general.json"), true);
+
+ if (isset($general["avatar_url"])) {
+ $id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]);
+ echo(" /avatars/$id.webp\n");
+ file_put_contents("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION), file_get_contents($general['avatar_url']));
+ exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars/" . $id . ".webp");
+ unlink("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION));
+ }
+
+ if (isset($general["banner"])) {
+ $id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]);
+ echo(" /banners/$id.webp\n");
+ file_put_contents("/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION), file_get_contents($general['banner']));
+ exec("convert -resize 2048x2048 \"" . "/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION) ."\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp");
+ unlink("/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION));
+ }
+
+ $members = json_decode(file_get_contents("./data/$path/members.json"), true);
+
+ foreach ($members as $member) {
+ $id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]) . preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $member["uuid"]);
+
+ if (isset($member["avatar_url"])) {
+ echo(" /avatars/$id.webp\n");
+ file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url']));
+ exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars/" . $id . ".webp");
+ unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION));
+ }
+
+ echo(" /banners/$id.webp\n");
+
+ if (isset($member["banner"])) {
+ file_put_contents("/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION), file_get_contents($member['banner']));
+ exec("convert -resize 2048x2048 \"" . "/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp");
+ unlink("/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION));
+ } else {
+ $img = imagecreate(2048, 1024);
+
+ if (isset($member["color"])) {
+ imagecolorallocate($img, hexdec(substr($member["color"], 0, 2)) / 2, hexdec(substr($member["color"], 2, 2)) / 2, hexdec(substr($member["color"], 4, 2)) / 2);
+ } else {
+ imagecolorallocate($img, 0, 0, 0);
+ }
+
+ imagejpeg($img, "/tmp/img.jpeg", 100);
+ imagedestroy($img);
+ exec("convert -resize 2048x2048 \"/tmp/img.jpeg\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp");
+ unlink("/tmp/img.jpeg");
+ }
+
+ if (file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png")) {
+ $url = "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png";
+ } else {
+ $url = "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt.png";
+ }
+ echo(" /heads/$id.png\n");
+ exec("convert \"" . $url . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/heads/" . $id . ".png");
+
+ if (file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png")) {
+ echo(" /bodies/$id.png\n");
+ exec("convert \"" . "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png" . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/bodies/" . $id . ".png");
+ }
+ }
+}
+
+downloadAssets("gdapd");
+downloadAssets("ynmuc");
+
+if (isset($app["other"]) && isset($app["other"]["id"]) && isset($app["other"]["token"])) {
+ downloadAssets($app["other"]["id"], "other");
+} \ No newline at end of file
diff --git a/includes/refresh/cleanup.inc b/includes/refresh/cleanup.inc
new file mode 100644
index 0000000..39ec41a
--- /dev/null
+++ b/includes/refresh/cleanup.inc
@@ -0,0 +1,24 @@
+<?php
+
+$screens = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens"), function ($i) {
+ return !str_starts_with($i, ".");
+}));
+
+$computers = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata"), function ($i) {
+ return !str_starts_with($i, ".");
+}));
+
+foreach ($screens as $screen) {
+ $delete = true;
+ $id = explode(".", explode("-", $screen)[2])[0];
+
+ foreach ($computers as $file) {
+ $computer = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $file), true);
+
+ foreach ($computer["screens"] as $sel) {
+ if ($sel["id"] === $id) $delete = false;
+ }
+ }
+
+ if ($delete) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens/" . $screen);
+} \ No newline at end of file
diff --git a/includes/refresh/logo.inc b/includes/refresh/logo.inc
new file mode 100644
index 0000000..3e88140
--- /dev/null
+++ b/includes/refresh/logo.inc
@@ -0,0 +1,322 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc";
+
+$columns = ceil(sqrt(count(scoreOrderGlobal())));
+echo(" Using " . $columns . " columns\n");
+
+$members = scoreOrderGlobal();
+
+usort($members, function ($a, $b) {
+ $vr = hexdec(substr($a["color"], 0, 2));
+ $vg = hexdec(substr($a["color"], 2, 2));
+ $vb = hexdec(substr($a["color"], 4, 2));
+
+ $hsl = rgbToHsl($vr, $vg, $vb);
+ if ($hsl[0] == 0) $hsl[0] = 360;
+ $ra = $hsl[0];
+
+ $vr = hexdec(substr($b["color"], 0, 2));
+ $vg = hexdec(substr($b["color"], 2, 2));
+ $vb = hexdec(substr($b["color"], 4, 2));
+
+ $hsl = rgbToHsl($vr, $vg, $vb);
+ if ($hsl[0] == 0) $hsl[0] = 360;
+ $rb = $hsl[0];
+
+ return $ra - $rb;
+});
+
+echo(" " . count($members) . " members\n");
+
+$packs = [];
+$currentPack = [];
+
+foreach ($members as $member) {
+ if (count($currentPack) >= $columns) {
+ $packs[] = $currentPack;
+ $currentPack = [];
+ }
+
+ $currentPack[] = $member["color"];
+}
+
+if (count($currentPack) > 0) $packs[] = $currentPack;
+
+$newPacks = [];
+foreach ($packs as $pack) {
+ usort($pack, function ($a, $b) {
+ $vra = hexdec(substr($a, 0, 2));
+ $vga = hexdec(substr($a, 2, 2));
+ $vba = hexdec(substr($a, 4, 2));
+
+ $hsla = rgbToHsl($vra, $vga, $vba);
+ $ra = $hsla[2] * $hsla[1];
+
+ $vrb = hexdec(substr($b, 0, 2));
+ $vgb = hexdec(substr($b, 2, 2));
+ $vbb = hexdec(substr($b, 4, 2));
+
+ $hslb = rgbToHsl($vrb, $vgb, $vbb);
+ $rb = $hslb[2] * $hslb[1];
+
+ return $rb < $ra;
+ });
+
+ while (count($pack) < $columns) $pack[] = "ffffff";
+
+ $newPacks[] = $pack;
+}
+
+$img = imagecreatetruecolor($columns, $columns);
+$factor = 64;
+
+for ($y = 0; $y < $columns; ++$y) {
+ for ($x = 0; $x < $columns; ++$x) {
+ if (isset($newPacks[$y][$x])) {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2))));
+ } else {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, 255, 255, 255));
+ }
+ }
+}
+
+$img2 = imagecreatetruecolor($columns * $factor, $columns * $factor);
+imagecopyresampled($img2, $img, 0, 0, 0, 0, $columns * $factor, $columns * $factor, $columns, $columns);
+
+imagepng($img2, "/tmp/image.png");
+$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
+unlink("/tmp/image.png");
+
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo.png");
+imagepng($img3, "/tmp/ponieslogo1.png");
+
+for ($x = 1; $x <= 120; $x++) {
+ imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR);
+}
+
+imagefilter($img2, IMG_FILTER_BRIGHTNESS, -100);
+
+imagepng($img2, "/tmp/image.png");
+$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
+unlink("/tmp/image.png");
+
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo-template.png");
+imagepng($img3, "/tmp/ponieslogo2.png");
+
+// --------------------------
+
+/*$columns = ceil(sqrt(count(array_filter(scoreOrderGlobal(), function ($i) {
+ return $i["_system"] === "gdapd";
+}))));
+echo(" Using " . $columns . " columns\n");
+
+$members = array_values(array_filter(scoreOrderGlobal(), function ($i) {
+ return $i["_system"] === "gdapd";
+}));
+
+usort($members, function ($a, $b) {
+ $vr = hexdec(substr($a["color"], 0, 2));
+ $vg = hexdec(substr($a["color"], 2, 2));
+ $vb = hexdec(substr($a["color"], 4, 2));
+
+ $hsl = rgbToHsl($vr, $vg, $vb);
+ if ($hsl[0] == 0) $hsl[0] = 360;
+ $ra = $hsl[0];
+
+ $vr = hexdec(substr($b["color"], 0, 2));
+ $vg = hexdec(substr($b["color"], 2, 2));
+ $vb = hexdec(substr($b["color"], 4, 2));
+
+ $hsl = rgbToHsl($vr, $vg, $vb);
+ if ($hsl[0] == 0) $hsl[0] = 360;
+ $rb = $hsl[0];
+
+ return $ra - $rb;
+});
+
+echo(" " . count($members) . " members\n");
+
+$packs = [];
+$currentPack = [];
+
+foreach ($members as $member) {
+ if (count($currentPack) >= $columns) {
+ $packs[] = $currentPack;
+ $currentPack = [];
+ }
+
+ $currentPack[] = $member["color"];
+}
+
+if (count($currentPack) > 0) $packs[] = $currentPack;
+
+$newPacks = [];
+foreach ($packs as $pack) {
+ usort($pack, function ($a, $b) {
+ $vra = hexdec(substr($a, 0, 2));
+ $vga = hexdec(substr($a, 2, 2));
+ $vba = hexdec(substr($a, 4, 2));
+
+ $hsla = rgbToHsl($vra, $vga, $vba);
+ $ra = $hsla[2] * $hsla[1];
+
+ $vrb = hexdec(substr($b, 0, 2));
+ $vgb = hexdec(substr($b, 2, 2));
+ $vbb = hexdec(substr($b, 4, 2));
+
+ $hslb = rgbToHsl($vrb, $vgb, $vbb);
+ $rb = $hslb[2] * $hslb[1];
+
+ return $rb < $ra;
+ });
+
+ while (count($pack) < $columns) $pack[] = "ffffff";
+
+ $newPacks[] = $pack;
+}
+
+$img = imagecreatetruecolor($columns, $columns);
+$factor = 64;
+
+for ($y = 0; $y < $columns; ++$y) {
+ for ($x = 0; $x < $columns; ++$x) {
+ if (isset($newPacks[$y][$x])) {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2))));
+ } else {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, 255, 255, 255));
+ }
+ }
+}
+
+$img2 = imagecreatetruecolor($columns * $factor, $columns * $factor);
+imagecopyresampled($img2, $img, 0, 0, 0, 0, $columns * $factor, $columns * $factor, $columns, $columns);
+
+imagepng($img2, "/tmp/image.png");
+$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
+unlink("/tmp/image.png");
+
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo2.png");
+imagepng($img3, "/tmp/ponieslogo1a.png");
+
+for ($x = 1; $x <= 120; $x++) {
+ imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR);
+}
+
+imagefilter($img2, IMG_FILTER_BRIGHTNESS, -100);
+
+imagepng($img2, "/tmp/image.png");
+$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
+unlink("/tmp/image.png");
+
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo2-template.png");
+imagepng($img3, "/tmp/ponieslogo2a.png");*/
+
+// --------------------------
+
+$isLoggedIn = true;
+$isLowerLoggedIn = false;
+
+$columns = ceil(sqrt(count(array_filter(scoreOrderGlobal()))));
+echo(" Using " . $columns . " columns\n");
+
+$members = array_values(array_filter(scoreOrderGlobal()));
+
+usort($members, function ($a, $b) {
+ $vr = hexdec(substr($a["color"], 0, 2));
+ $vg = hexdec(substr($a["color"], 2, 2));
+ $vb = hexdec(substr($a["color"], 4, 2));
+
+ $hsl = rgbToHsl($vr, $vg, $vb);
+ if ($hsl[0] == 0) $hsl[0] = 360;
+ $ra = $hsl[0];
+
+ $vr = hexdec(substr($b["color"], 0, 2));
+ $vg = hexdec(substr($b["color"], 2, 2));
+ $vb = hexdec(substr($b["color"], 4, 2));
+
+ $hsl = rgbToHsl($vr, $vg, $vb);
+ if ($hsl[0] == 0) $hsl[0] = 360;
+ $rb = $hsl[0];
+
+ return $ra - $rb;
+});
+
+echo(" " . count($members) . " members\n");
+
+$packs = [];
+$currentPack = [];
+
+foreach ($members as $member) {
+ if (count($currentPack) >= $columns) {
+ $packs[] = $currentPack;
+ $currentPack = [];
+ }
+
+ $currentPack[] = $member["color"];
+}
+
+if (count($currentPack) > 0) $packs[] = $currentPack;
+
+$newPacks = [];
+foreach ($packs as $pack) {
+ usort($pack, function ($a, $b) {
+ $vra = hexdec(substr($a, 0, 2));
+ $vga = hexdec(substr($a, 2, 2));
+ $vba = hexdec(substr($a, 4, 2));
+
+ $hsla = rgbToHsl($vra, $vga, $vba);
+ $ra = $hsla[2] * $hsla[1];
+
+ $vrb = hexdec(substr($b, 0, 2));
+ $vgb = hexdec(substr($b, 2, 2));
+ $vbb = hexdec(substr($b, 4, 2));
+
+ $hslb = rgbToHsl($vrb, $vgb, $vbb);
+ $rb = $hslb[2] * $hslb[1];
+
+ return $rb < $ra;
+ });
+
+ while (count($pack) < $columns) $pack[] = "ffffff";
+
+ $newPacks[] = $pack;
+}
+
+$img = imagecreatetruecolor($columns, $columns);
+$factor = 64;
+
+for ($y = 0; $y < $columns; ++$y) {
+ for ($x = 0; $x < $columns; ++$x) {
+ if (isset($newPacks[$y][$x])) {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2))));
+ } else {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, 255, 255, 255));
+ }
+ }
+}
+
+$img2 = imagecreatetruecolor($columns * $factor, $columns * $factor);
+imagecopyresampled($img2, $img, 0, 0, 0, 0, $columns * $factor, $columns * $factor, $columns, $columns);
+
+imagepng($img2, "/tmp/image.png");
+$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
+unlink("/tmp/image.png");
+
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo3.png");
+imagepng($img3, "/tmp/ponieslogo1b.png");
+
+for ($x = 1; $x <= 120; $x++) {
+ imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR);
+}
+
+imagefilter($img2, IMG_FILTER_BRIGHTNESS, -100);
+
+imagepng($img2, "/tmp/image.png");
+$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
+unlink("/tmp/image.png");
+
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo3-template.png");
+imagepng($img3, "/tmp/ponieslogo2b.png"); \ No newline at end of file
diff --git a/includes/system/compare.inc b/includes/system/compare.inc
index 7e683fa..86bc32a 100644
--- a/includes/system/compare.inc
+++ b/includes/system/compare.inc
@@ -130,16 +130,16 @@ $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/
<?= count($metadata["marefriends"]) + count($metadata["sisters"]) > 0 ? count($metadata["marefriends"]) + count($metadata["sisters"]) : "" ?>
</span>
<span class="comparison-relations-full">
- <?php $index = 0; foreach ($metadata["marefriends"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) {
- global $mfMemberID;
- return $item["id"] === $mfMemberID;
- }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][0] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["sisters"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) {
- global $mfMemberID;
- return $item["id"] === $mfMemberID;
- }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][1] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["caretakers"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) {
- global $mfMemberID;
- return $item["id"] === $mfMemberID;
- }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][2] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?>
+ <?php global $isLowerLoggedIn; global $isLoggedIn; $index = 0; foreach ($metadata["marefriends"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; if (!($mfSystem === $app["other"]["id"] && !$isLoggedIn && !$isLowerLoggedIn)): $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfSystem) {
+ global $mfMemberID; global $app; global $isLoggedIn; global $isLowerLoggedIn;
+ return $item["id"] === $mfMemberID && !($mfSystem === $app["other"]["id"] && !$isLoggedIn && !$isLowerLoggedIn);
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][0] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php endif; $index++; endforeach; ?><?php $index = 0; foreach ($metadata["sisters"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; if (!($mfSystem === $app["other"]["id"] && !$isLoggedIn && !$isLowerLoggedIn)): $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfSystem) {
+ global $mfMemberID; global $app; global $isLoggedIn; global $isLowerLoggedIn;
+ return $item["id"] === $mfMemberID && !($mfSystem === $app["other"]["id"] && !$isLoggedIn && !$isLowerLoggedIn);
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][1] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php endif; $index++; endforeach; ?><?php $index = 0; foreach ($metadata["caretakers"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; if (!($mfSystem === $app["other"]["id"] && !$isLoggedIn && !$isLowerLoggedIn)): $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfSystem) {
+ global $mfMemberID; global $app; global $isLoggedIn; global $isLowerLoggedIn;
+ return $item["id"] === $mfMemberID && !($mfSystem === $app["other"]["id"] && !$isLoggedIn && !$isLowerLoggedIn);
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][2] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php endif; $index++; endforeach; ?>
</span>
</span>
<span class="comparison-item">