summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.php10
-rw-r--r--assets/logo/custom.css4
-rw-r--r--assets/logo/newlogo-template.pngbin31787 -> 38404 bytes
-rw-r--r--assets/logo/newlogo.pngbin4707 -> 5613 bytes
-rw-r--r--assets/logo/newlogo3-template.pngbin38736 -> 39166 bytes
-rw-r--r--assets/logo/newlogo3.pngbin5653 -> 5693 bytes
-rw-r--r--assets/uploads/pt-applebloom.pngbin6219 -> 900 bytes
-rw-r--r--assets/uploads/pt-babsseed.pngbin4820 -> 884 bytes
-rw-r--r--assets/uploads/pt-blueberrycloud.pngbin4903 -> 682 bytes
-rw-r--r--assets/uploads/pt-cinnamonfire.pngbin4749 -> 715 bytes
-rw-r--r--assets/uploads/pt-cloudydreams.pngbin5523 -> 842 bytes
-rw-r--r--assets/uploads/pt-colorspray.pngbin4375 -> 708 bytes
-rw-r--r--assets/uploads/pt-coral.pngbin4722 -> 738 bytes
-rw-r--r--assets/uploads/pt-cozyglow.pngbin6561 -> 1123 bytes
-rw-r--r--assets/uploads/pt-creamychocolate.pngbin5227 -> 723 bytes
-rw-r--r--assets/uploads/pt-duskrainbow.pngbin4821 -> 743 bytes
-rw-r--r--assets/uploads/pt-floralorchid.pngbin4525 -> 705 bytes
-rw-r--r--assets/uploads/pt-fluttershy.pngbin5282 -> 728 bytes
-rw-r--r--assets/uploads/pt-forestpaint.pngbin3633 -> 619 bytes
-rw-r--r--assets/uploads/pt-frostcrystals.pngbin4891 -> 894 bytes
-rw-r--r--assets/uploads/pt-glory.pngbin4724 -> 782 bytes
-rw-r--r--assets/uploads/pt-izzymoonbow.pngbin6379 -> 1089 bytes
-rw-r--r--assets/uploads/pt-lavender.pngbin5332 -> 848 bytes
-rw-r--r--assets/uploads/pt-lilacbloom.pngbin5212 -> 828 bytes
-rw-r--r--assets/uploads/pt-mintygrape.pngbin7218 -> 1066 bytes
-rw-r--r--assets/uploads/pt-mistybrightdawn.pngbin6142 -> 1092 bytes
-rw-r--r--assets/uploads/pt-mistycloud.pngbin5234 -> 816 bytes
-rw-r--r--assets/uploads/pt-mossystorm.pngbin4592 -> 682 bytes
-rw-r--r--assets/uploads/pt-opalinearcana.pngbin4472 -> 945 bytes
-rw-r--r--assets/uploads/pt-peachfizz.pngbin4508 -> 818 bytes
-rw-r--r--assets/uploads/pt-pinkiepie.pngbin4595 -> 672 bytes
-rw-r--r--assets/uploads/pt-pipppetals.pngbin5636 -> 794 bytes
-rw-r--r--assets/uploads/pt-plushie.pngbin5443 -> 943 bytes
-rw-r--r--assets/uploads/pt-poseybloom.pngbin5718 -> 771 bytes
-rw-r--r--assets/uploads/pt-princesscelestia.pngbin5637 -> 1104 bytes
-rw-r--r--assets/uploads/pt-princessluna.pngbin5609 -> 974 bytes
-rw-r--r--assets/uploads/pt-rainbowdash.pngbin5005 -> 824 bytes
-rw-r--r--assets/uploads/pt-rarity.pngbin4405 -> 754 bytes
-rw-r--r--assets/uploads/pt-seashell.pngbin4588 -> 778 bytes
-rw-r--r--assets/uploads/pt-skydream.pngbin6533 -> 1042 bytes
-rw-r--r--assets/uploads/pt-starrynight.pngbin4982 -> 821 bytes
-rw-r--r--assets/uploads/pt-stuffie.pngbin4984 -> 757 bytes
-rw-r--r--assets/uploads/pt-sunnystarscout.pngbin4797 -> 809 bytes
-rw-r--r--assets/uploads/pt-sweetiebelle.pngbin5136 -> 794 bytes
-rw-r--r--assets/uploads/pt-sweetiebot.pngbin5175 -> 809 bytes
-rw-r--r--assets/uploads/pt-thunder.pngbin5214 -> 755 bytes
-rw-r--r--assets/uploads/pt-twi.pngbin4700 -> 728 bytes
-rw-r--r--assets/uploads/pt-twilightsparkle.pngbin3997 -> 829 bytes
-rw-r--r--assets/uploads/pt-velvet.pngbin5998 -> 840 bytes
-rw-r--r--assets/uploads/pt-violetdawn.pngbin4652 -> 955 bytes
-rw-r--r--assets/uploads/pt-windy.pngbin5054 -> 655 bytes
-rw-r--r--assets/uploads/pt-windyleaves.pngbin4985 -> 675 bytes
-rw-r--r--assets/uploads/pt-zippstorm.pngbin4180 -> 690 bytes
-rw-r--r--assets/uploads/pt-zoomzephyrwing.pngbin4696 -> 735 bytes
-rw-r--r--auth/callback/index.php8
-rw-r--r--includes/components/details.inc (renamed from includes/details.inc)4
-rw-r--r--includes/components/emergency.inc (renamed from includes/emergency.inc)0
-rw-r--r--includes/components/footer.inc (renamed from includes/footer.inc)4
-rw-r--r--includes/components/fullbanner.inc (renamed from includes/fullbanner.inc)2
-rw-r--r--includes/components/header.inc (renamed from includes/header.inc)33
-rw-r--r--includes/components/mobilenav.inc (renamed from includes/mobilenav.inc)2
-rw-r--r--includes/components/navigation.inc (renamed from includes/navigation.inc)10
-rw-r--r--includes/components/pane.inc (renamed from includes/pane.inc)2
-rw-r--r--includes/components/planner.inc (renamed from includes/planner.inc)16
-rw-r--r--includes/components/search.inc (renamed from includes/search.inc)0
-rw-r--r--includes/components/sysbanner.inc (renamed from includes/sysbanner.inc)2
-rw-r--r--includes/components/wakeup.inc (renamed from includes/wakeup.inc)0
-rw-r--r--includes/exchange.txt2
-rw-r--r--includes/fragments/edit-private.inc (renamed from includes/edit-private.inc)6
-rw-r--r--includes/fragments/edit.inc (renamed from includes/edit.inc)6
-rw-r--r--includes/fragments/member.inc (renamed from includes/member.inc)10
-rw-r--r--includes/fragments/metadata.inc (renamed from includes/metadata.inc)6
-rw-r--r--includes/fragments/sysedit.inc (renamed from includes/sysedit.inc)8
-rw-r--r--includes/fragments/system.inc (renamed from includes/system.inc)6
-rw-r--r--includes/init.inc6
-rw-r--r--includes/language.inc10
-rw-r--r--includes/pages.json2
-rw-r--r--includes/rail.inc167
-rw-r--r--includes/refresh.php8
-rw-r--r--includes/refresh/assets.inc (renamed from includes/assets.inc)30
-rw-r--r--includes/refresh/backup.inc (renamed from includes/backup.inc)25
-rw-r--r--includes/refresh/cleanup.inc (renamed from includes/cleanup.inc)21
-rw-r--r--includes/refresh/logo.inc (renamed from includes/logo.inc)6
-rw-r--r--includes/system/compare.inc4
-rw-r--r--includes/system/history.inc4
-rw-r--r--includes/titlebar.inc606
-rw-r--r--includes/util/Parsedown.php (renamed from includes/Parsedown.php)0
-rw-r--r--includes/util/agewarning.inc (renamed from includes/agewarning.inc)0
-rw-r--r--includes/util/banner.inc (renamed from includes/banner.inc)6
-rw-r--r--includes/util/bitset.inc (renamed from includes/bitset.inc)0
-rw-r--r--includes/util/functions.inc (renamed from includes/functions.inc)10
-rw-r--r--includes/util/homepage.inc (renamed from includes/homepage.inc)2
-rw-r--r--includes/util/language.inc3
-rw-r--r--includes/util/profiles.inc (renamed from includes/profiles.inc)0
-rw-r--r--includes/util/pronouns.inc (renamed from includes/pronouns.inc)0
-rw-r--r--includes/util/rainbow.inc (renamed from includes/rainbow.inc)6
-rw-r--r--includes/util/random.inc (renamed from includes/random.inc)0
-rw-r--r--includes/util/score.inc (renamed from includes/score.inc)0
-rw-r--r--includes/util/session.inc (renamed from includes/session.inc)2
-rw-r--r--includes/util/short.inc (renamed from includes/short.inc)6
-rw-r--r--includes/util/travelling.inc (renamed from includes/travelling.inc)0
-rw-r--r--pages/about.inc80
-rw-r--r--pages/alphabet.inc4
-rw-r--r--pages/api/chrome.php87
-rw-r--r--pages/api/close.php1
-rw-r--r--pages/api/cloudburst-img.php2
-rw-r--r--pages/api/computer.php8
-rw-r--r--pages/api/data.php4
-rw-r--r--pages/api/docs.php2
-rw-r--r--pages/api/emergency-real.php2
-rw-r--r--pages/api/emergency.php2
-rw-r--r--pages/api/fronter.php2
-rw-r--r--pages/api/me.php2
-rw-r--r--pages/api/plex.php4
-rw-r--r--pages/api/pluralkit-integration.php120
-rw-r--r--pages/api/ponytown.php2
-rw-r--r--pages/api/raindrops-img.php2
-rw-r--r--pages/api/save-private.php2
-rw-r--r--pages/api/save.php2
-rw-r--r--pages/api/token.php2
-rw-r--r--pages/api/wakeup-real.php2
-rw-r--r--pages/api/wakeup.php2
-rw-r--r--pages/byfront.inc4
-rw-r--r--pages/byspecies.inc6
-rw-r--r--pages/computers.inc48
-rw-r--r--pages/debug.inc4
-rw-r--r--pages/docs.inc6
-rw-r--r--pages/edit-private.inc2
-rw-r--r--pages/edit.inc4
-rw-r--r--pages/emergency.inc6
-rw-r--r--pages/fronting.inc6
-rw-r--r--pages/games.inc4
-rw-r--r--pages/home.inc10
-rw-r--r--pages/home.old.inc10
-rw-r--r--pages/login.inc20
-rw-r--r--pages/metadata.inc6
-rw-r--r--pages/money.inc6
-rw-r--r--pages/page.inc8
-rw-r--r--pages/ponytown.inc4
-rw-r--r--pages/profiles.inc6
-rw-r--r--pages/relations.inc4
-rw-r--r--pages/rules.inc8
-rw-r--r--pages/splitting.inc4
-rw-r--r--pages/stats.inc4
-rw-r--r--pages/terminology.inc4
-rw-r--r--pages/travelling.inc6
-rw-r--r--pages/wakeup.inc6
147 files changed, 388 insertions, 1207 deletions
diff --git a/app.php b/app.php
index 8d3cb02..b6651c9 100644
--- a/app.php
+++ b/app.php
@@ -2,9 +2,9 @@
ob_start();
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/language.inc"; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/language.inc"; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
@@ -84,8 +84,8 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc";
} else {
global $toplevel;
- $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/includes/short.inc";
- require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/short.inc";
+ $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/includes/util/short.inc";
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/short.inc";
}
}
}
diff --git a/assets/logo/custom.css b/assets/logo/custom.css
index 44f7331..59200f9 100644
--- a/assets/logo/custom.css
+++ b/assets/logo/custom.css
@@ -696,7 +696,7 @@ peh-muted {
}
@media (max-width: 991px) {
- div#member-details.member-details-loggedIn {
+ div#member-details.member-details-loggedIn, div#member-details.member-details-loggedIn2 {
grid-template-columns: repeat(3, 1fr) !important;
text-align: center;
}
@@ -708,7 +708,7 @@ peh-muted {
}
@media (max-width: 767px) {
- div#member-details.member-details-loggedIn {
+ div#member-details.member-details-loggedIn, div#member-details.member-details-loggedIn2 {
grid-template-columns: repeat(2, 1fr) !important;
text-align: left;
}
diff --git a/assets/logo/newlogo-template.png b/assets/logo/newlogo-template.png
index e796e5a..859ecbf 100644
--- a/assets/logo/newlogo-template.png
+++ b/assets/logo/newlogo-template.png
Binary files differ
diff --git a/assets/logo/newlogo.png b/assets/logo/newlogo.png
index f32cbae..c3a7b4f 100644
--- a/assets/logo/newlogo.png
+++ b/assets/logo/newlogo.png
Binary files differ
diff --git a/assets/logo/newlogo3-template.png b/assets/logo/newlogo3-template.png
index bec8d1b..b998a82 100644
--- a/assets/logo/newlogo3-template.png
+++ b/assets/logo/newlogo3-template.png
Binary files differ
diff --git a/assets/logo/newlogo3.png b/assets/logo/newlogo3.png
index 28ff3e1..54c681f 100644
--- a/assets/logo/newlogo3.png
+++ b/assets/logo/newlogo3.png
Binary files differ
diff --git a/assets/uploads/pt-applebloom.png b/assets/uploads/pt-applebloom.png
index 35f844f..56bb5c9 100644
--- a/assets/uploads/pt-applebloom.png
+++ b/assets/uploads/pt-applebloom.png
Binary files differ
diff --git a/assets/uploads/pt-babsseed.png b/assets/uploads/pt-babsseed.png
index 92e76f2..6e940bc 100644
--- a/assets/uploads/pt-babsseed.png
+++ b/assets/uploads/pt-babsseed.png
Binary files differ
diff --git a/assets/uploads/pt-blueberrycloud.png b/assets/uploads/pt-blueberrycloud.png
index 7ac1aae..f34bc60 100644
--- a/assets/uploads/pt-blueberrycloud.png
+++ b/assets/uploads/pt-blueberrycloud.png
Binary files differ
diff --git a/assets/uploads/pt-cinnamonfire.png b/assets/uploads/pt-cinnamonfire.png
index c23c1ad..3b001ba 100644
--- a/assets/uploads/pt-cinnamonfire.png
+++ b/assets/uploads/pt-cinnamonfire.png
Binary files differ
diff --git a/assets/uploads/pt-cloudydreams.png b/assets/uploads/pt-cloudydreams.png
index e8387d8..17567c3 100644
--- a/assets/uploads/pt-cloudydreams.png
+++ b/assets/uploads/pt-cloudydreams.png
Binary files differ
diff --git a/assets/uploads/pt-colorspray.png b/assets/uploads/pt-colorspray.png
index ad0b37b..ed76565 100644
--- a/assets/uploads/pt-colorspray.png
+++ b/assets/uploads/pt-colorspray.png
Binary files differ
diff --git a/assets/uploads/pt-coral.png b/assets/uploads/pt-coral.png
index 0eaee1e..a558c4d 100644
--- a/assets/uploads/pt-coral.png
+++ b/assets/uploads/pt-coral.png
Binary files differ
diff --git a/assets/uploads/pt-cozyglow.png b/assets/uploads/pt-cozyglow.png
index 4f65ee9..2a75399 100644
--- a/assets/uploads/pt-cozyglow.png
+++ b/assets/uploads/pt-cozyglow.png
Binary files differ
diff --git a/assets/uploads/pt-creamychocolate.png b/assets/uploads/pt-creamychocolate.png
index 1cb2699..04cd5d3 100644
--- a/assets/uploads/pt-creamychocolate.png
+++ b/assets/uploads/pt-creamychocolate.png
Binary files differ
diff --git a/assets/uploads/pt-duskrainbow.png b/assets/uploads/pt-duskrainbow.png
index 012c4eb..ee2da4a 100644
--- a/assets/uploads/pt-duskrainbow.png
+++ b/assets/uploads/pt-duskrainbow.png
Binary files differ
diff --git a/assets/uploads/pt-floralorchid.png b/assets/uploads/pt-floralorchid.png
index 0b396aa..fbb6899 100644
--- a/assets/uploads/pt-floralorchid.png
+++ b/assets/uploads/pt-floralorchid.png
Binary files differ
diff --git a/assets/uploads/pt-fluttershy.png b/assets/uploads/pt-fluttershy.png
index 3997890..2ae1eba 100644
--- a/assets/uploads/pt-fluttershy.png
+++ b/assets/uploads/pt-fluttershy.png
Binary files differ
diff --git a/assets/uploads/pt-forestpaint.png b/assets/uploads/pt-forestpaint.png
index 639da8b..aafc93a 100644
--- a/assets/uploads/pt-forestpaint.png
+++ b/assets/uploads/pt-forestpaint.png
Binary files differ
diff --git a/assets/uploads/pt-frostcrystals.png b/assets/uploads/pt-frostcrystals.png
index 09845f3..71f0422 100644
--- a/assets/uploads/pt-frostcrystals.png
+++ b/assets/uploads/pt-frostcrystals.png
Binary files differ
diff --git a/assets/uploads/pt-glory.png b/assets/uploads/pt-glory.png
index fd84f7a..5b159a9 100644
--- a/assets/uploads/pt-glory.png
+++ b/assets/uploads/pt-glory.png
Binary files differ
diff --git a/assets/uploads/pt-izzymoonbow.png b/assets/uploads/pt-izzymoonbow.png
index e01ab3b..3799a68 100644
--- a/assets/uploads/pt-izzymoonbow.png
+++ b/assets/uploads/pt-izzymoonbow.png
Binary files differ
diff --git a/assets/uploads/pt-lavender.png b/assets/uploads/pt-lavender.png
index 3289720..202fbe2 100644
--- a/assets/uploads/pt-lavender.png
+++ b/assets/uploads/pt-lavender.png
Binary files differ
diff --git a/assets/uploads/pt-lilacbloom.png b/assets/uploads/pt-lilacbloom.png
index b131821..9801ee0 100644
--- a/assets/uploads/pt-lilacbloom.png
+++ b/assets/uploads/pt-lilacbloom.png
Binary files differ
diff --git a/assets/uploads/pt-mintygrape.png b/assets/uploads/pt-mintygrape.png
index 820b657..e6e0497 100644
--- a/assets/uploads/pt-mintygrape.png
+++ b/assets/uploads/pt-mintygrape.png
Binary files differ
diff --git a/assets/uploads/pt-mistybrightdawn.png b/assets/uploads/pt-mistybrightdawn.png
index 3afb56c..bc07a9b 100644
--- a/assets/uploads/pt-mistybrightdawn.png
+++ b/assets/uploads/pt-mistybrightdawn.png
Binary files differ
diff --git a/assets/uploads/pt-mistycloud.png b/assets/uploads/pt-mistycloud.png
index 16db8fb..34d6ae0 100644
--- a/assets/uploads/pt-mistycloud.png
+++ b/assets/uploads/pt-mistycloud.png
Binary files differ
diff --git a/assets/uploads/pt-mossystorm.png b/assets/uploads/pt-mossystorm.png
index 6a26877..e15c241 100644
--- a/assets/uploads/pt-mossystorm.png
+++ b/assets/uploads/pt-mossystorm.png
Binary files differ
diff --git a/assets/uploads/pt-opalinearcana.png b/assets/uploads/pt-opalinearcana.png
index 261f40d..bd7883d 100644
--- a/assets/uploads/pt-opalinearcana.png
+++ b/assets/uploads/pt-opalinearcana.png
Binary files differ
diff --git a/assets/uploads/pt-peachfizz.png b/assets/uploads/pt-peachfizz.png
index ab8e9c9..73d3ac6 100644
--- a/assets/uploads/pt-peachfizz.png
+++ b/assets/uploads/pt-peachfizz.png
Binary files differ
diff --git a/assets/uploads/pt-pinkiepie.png b/assets/uploads/pt-pinkiepie.png
index 75e9071..5ca4d10 100644
--- a/assets/uploads/pt-pinkiepie.png
+++ b/assets/uploads/pt-pinkiepie.png
Binary files differ
diff --git a/assets/uploads/pt-pipppetals.png b/assets/uploads/pt-pipppetals.png
index 57ab4a1..21666e6 100644
--- a/assets/uploads/pt-pipppetals.png
+++ b/assets/uploads/pt-pipppetals.png
Binary files differ
diff --git a/assets/uploads/pt-plushie.png b/assets/uploads/pt-plushie.png
index 0cf6b62..b4dffc4 100644
--- a/assets/uploads/pt-plushie.png
+++ b/assets/uploads/pt-plushie.png
Binary files differ
diff --git a/assets/uploads/pt-poseybloom.png b/assets/uploads/pt-poseybloom.png
index 508ffe4..1edaad7 100644
--- a/assets/uploads/pt-poseybloom.png
+++ b/assets/uploads/pt-poseybloom.png
Binary files differ
diff --git a/assets/uploads/pt-princesscelestia.png b/assets/uploads/pt-princesscelestia.png
index baa8055..b9251ec 100644
--- a/assets/uploads/pt-princesscelestia.png
+++ b/assets/uploads/pt-princesscelestia.png
Binary files differ
diff --git a/assets/uploads/pt-princessluna.png b/assets/uploads/pt-princessluna.png
index 804690a..cfb7c47 100644
--- a/assets/uploads/pt-princessluna.png
+++ b/assets/uploads/pt-princessluna.png
Binary files differ
diff --git a/assets/uploads/pt-rainbowdash.png b/assets/uploads/pt-rainbowdash.png
index e7bed73..271d216 100644
--- a/assets/uploads/pt-rainbowdash.png
+++ b/assets/uploads/pt-rainbowdash.png
Binary files differ
diff --git a/assets/uploads/pt-rarity.png b/assets/uploads/pt-rarity.png
index 5a2cd2b..2c1f663 100644
--- a/assets/uploads/pt-rarity.png
+++ b/assets/uploads/pt-rarity.png
Binary files differ
diff --git a/assets/uploads/pt-seashell.png b/assets/uploads/pt-seashell.png
index b28d664..f5c8568 100644
--- a/assets/uploads/pt-seashell.png
+++ b/assets/uploads/pt-seashell.png
Binary files differ
diff --git a/assets/uploads/pt-skydream.png b/assets/uploads/pt-skydream.png
index a6cb979..793755b 100644
--- a/assets/uploads/pt-skydream.png
+++ b/assets/uploads/pt-skydream.png
Binary files differ
diff --git a/assets/uploads/pt-starrynight.png b/assets/uploads/pt-starrynight.png
index bcbfe7b..18b5b89 100644
--- a/assets/uploads/pt-starrynight.png
+++ b/assets/uploads/pt-starrynight.png
Binary files differ
diff --git a/assets/uploads/pt-stuffie.png b/assets/uploads/pt-stuffie.png
index 7ba4226..1285bcd 100644
--- a/assets/uploads/pt-stuffie.png
+++ b/assets/uploads/pt-stuffie.png
Binary files differ
diff --git a/assets/uploads/pt-sunnystarscout.png b/assets/uploads/pt-sunnystarscout.png
index c44b2fd..ad3121d 100644
--- a/assets/uploads/pt-sunnystarscout.png
+++ b/assets/uploads/pt-sunnystarscout.png
Binary files differ
diff --git a/assets/uploads/pt-sweetiebelle.png b/assets/uploads/pt-sweetiebelle.png
index 4a9cf15..50098f1 100644
--- a/assets/uploads/pt-sweetiebelle.png
+++ b/assets/uploads/pt-sweetiebelle.png
Binary files differ
diff --git a/assets/uploads/pt-sweetiebot.png b/assets/uploads/pt-sweetiebot.png
index 04daac6..e5ee414 100644
--- a/assets/uploads/pt-sweetiebot.png
+++ b/assets/uploads/pt-sweetiebot.png
Binary files differ
diff --git a/assets/uploads/pt-thunder.png b/assets/uploads/pt-thunder.png
index 48ed462..6bd7a0d 100644
--- a/assets/uploads/pt-thunder.png
+++ b/assets/uploads/pt-thunder.png
Binary files differ
diff --git a/assets/uploads/pt-twi.png b/assets/uploads/pt-twi.png
index 766f3fc..c56fdc9 100644
--- a/assets/uploads/pt-twi.png
+++ b/assets/uploads/pt-twi.png
Binary files differ
diff --git a/assets/uploads/pt-twilightsparkle.png b/assets/uploads/pt-twilightsparkle.png
index e996c8d..8c10184 100644
--- a/assets/uploads/pt-twilightsparkle.png
+++ b/assets/uploads/pt-twilightsparkle.png
Binary files differ
diff --git a/assets/uploads/pt-velvet.png b/assets/uploads/pt-velvet.png
index 253f94c..666ed93 100644
--- a/assets/uploads/pt-velvet.png
+++ b/assets/uploads/pt-velvet.png
Binary files differ
diff --git a/assets/uploads/pt-violetdawn.png b/assets/uploads/pt-violetdawn.png
index adb048b..d12312d 100644
--- a/assets/uploads/pt-violetdawn.png
+++ b/assets/uploads/pt-violetdawn.png
Binary files differ
diff --git a/assets/uploads/pt-windy.png b/assets/uploads/pt-windy.png
index 83c3dbe..8d01678 100644
--- a/assets/uploads/pt-windy.png
+++ b/assets/uploads/pt-windy.png
Binary files differ
diff --git a/assets/uploads/pt-windyleaves.png b/assets/uploads/pt-windyleaves.png
index 8eadb40..ef49235 100644
--- a/assets/uploads/pt-windyleaves.png
+++ b/assets/uploads/pt-windyleaves.png
Binary files differ
diff --git a/assets/uploads/pt-zippstorm.png b/assets/uploads/pt-zippstorm.png
index 94622fc..0cb4b4a 100644
--- a/assets/uploads/pt-zippstorm.png
+++ b/assets/uploads/pt-zippstorm.png
Binary files differ
diff --git a/assets/uploads/pt-zoomzephyrwing.png b/assets/uploads/pt-zoomzephyrwing.png
index e75a6c3..8ffc3f4 100644
--- a/assets/uploads/pt-zoomzephyrwing.png
+++ b/assets/uploads/pt-zoomzephyrwing.png
Binary files differ
diff --git a/auth/callback/index.php b/auth/callback/index.php
index 8419364..8d040e9 100644
--- a/auth/callback/index.php
+++ b/auth/callback/index.php
@@ -56,6 +56,12 @@ if (isset($result["access_token"])) {
header("Set-Cookie: PEH2_SESSION_TOKEN=" . $token . "; SameSite=None; Path=/; Secure; HttpOnly; Expires=" . date("r", time() + (86400 * 730)));
- header("Location: /");
+ if (isset($_COOKIE["PEH2_RETURN_PAGE"])) {
+ header("Location: " . str_replace("\n", "", str_replace("\r", "", $_COOKIE["PEH2_RETURN_PAGE"])));
+ } else {
+ header("Location: /");
+ }
+
+ setcookie("PEH2_RETURN_PAGE", "");
die();
} \ No newline at end of file
diff --git a/includes/details.inc b/includes/components/details.inc
index 7f96884..b7d0ebe 100644
--- a/includes/details.inc
+++ b/includes/components/details.inc
@@ -1,5 +1,5 @@
<?php global $isLoggedIn; global $metadata; global $memberData; global $isLowerLoggedIn; global $systemID; global $app; global $lang; global $pages; $pronouns = getMemberPronouns($memberData['pronouns']); ?>
-<div id="member-details" class="<?= (($isLoggedIn || $isLowerLoggedIn) && $systemID !== $app["other"]["id"]) ? 'member-details-loggedIn' : '' ?>" style="<?php if ((!$isLoggedIn && !$isLowerLoggedIn) || $systemID === $app["other"]["id"]): ?>grid-template-columns: repeat(4, 1fr);<?php endif; ?> background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
+<div id="member-details" class="<?= (($isLoggedIn || $isLowerLoggedIn) && $systemID !== $app["other"]["id"]) ? 'member-details-loggedIn' : 'member-details-loggedIn2' ?>" style="<?php if (!$isLoggedIn && !$isLowerLoggedIn): ?>grid-template-columns: repeat(4, 1fr);<?php endif; ?> background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
<div>
<b><?= $lang["details"]["food"] ?></b><span class="member-small-separator"><br></span>
<?= match ($metadata["food"]) {
@@ -17,7 +17,6 @@
2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst($pronouns["subjective"])) . ($pronouns["third"] ? " shares" : " share") . " all memories with " . str_replace("'", "&apos;", $pronouns["possessive_det"]) . " headmates.'>" . $lang["details"]["memory_states"][2] . "</span>",
} ?>
</div>
- <?php if ($systemID !== $app["other"]["id"]): ?>
<?php if ($isLoggedIn || $isLowerLoggedIn): ?>
<div>
<b>Age:</b><span class="member-small-separator"><br></span>
@@ -56,6 +55,7 @@
<?php endif; ?>
</div>
<?php endif; ?>
+ <?php if ($systemID !== $app["other"]["id"]): ?>
<div>
<b><?= $lang["details"]["code"] ?></b><span class="member-small-separator"><br></span>
<?php if (isset($metadata["code"]) && trim($metadata["code"]) !== ""): ?>
diff --git a/includes/emergency.inc b/includes/components/emergency.inc
index 5490985..5490985 100644
--- a/includes/emergency.inc
+++ b/includes/components/emergency.inc
diff --git a/includes/footer.inc b/includes/components/footer.inc
index b2fb277..2cef58f 100644
--- a/includes/footer.inc
+++ b/includes/components/footer.inc
@@ -1,7 +1,7 @@
<?php
global $pageFile;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
?>
@@ -36,7 +36,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
})
</script>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/search.inc"; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/search.inc"; ?>
</body>
</html> \ No newline at end of file
diff --git a/includes/fullbanner.inc b/includes/components/fullbanner.inc
index 4f78101..ddd59df 100644
--- a/includes/fullbanner.inc
+++ b/includes/components/fullbanner.inc
@@ -5,7 +5,7 @@
<?php if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion"): ?>
<div id="member-banner-container">
<div id="member-banner"></div>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/details.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/details.inc"; ?>
</div>
<?php else: ?>
<div id="member-banner"></div>
diff --git a/includes/header.inc b/includes/components/header.inc
index 02cb190..7c4cfc8 100644
--- a/includes/header.inc
+++ b/includes/components/header.inc
@@ -12,7 +12,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test")) {
$isNormallyLoggedIn = false;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isUserLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isUserLoggedIn; global $isLowerLoggedIn;
if ($readOnly && $isLoggedIn || $readOnly && $isUserLoggedIn) {
$isLoggedIn = false;
$isUserLoggedIn = false;
@@ -49,13 +49,13 @@ $page = $pages[$toplevel] ?? [
"rail" => false
];
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.inc"; global $travelling;
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.inc";
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.inc";
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/travelling.inc"; global $travelling;
+require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/score.inc";
+require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/pronouns.inc";
+require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/banner.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/rainbow.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
?>
<!doctype html>
@@ -70,7 +70,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
<link rel="shortcut icon" href="/assets/logo/newlogo<?= $isLoggedIn || $isLowerLoggedIn ? "3" : "" ?>.png" type="image/png">
</head>
<body<?php if ($page["rail"] && $isLoggedIn && !$useNewUI): ?> id="admin-page"<?php endif; ?>>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.inc"; global $navigation; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/navigation.inc"; global $navigation; ?>
<?php if (!$useNewUI): ?>
<div style="margin-top: 60px;" id="top-of-page"></div>
@@ -78,16 +78,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
<?php if ($useNewUI): ?>
<aside id="navigation-pane">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/pane.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/pane.inc"; ?>
</aside>
- <div id="title-bar">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/titlebar.inc"; ?>
- </div>
-
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/mobilenav.inc"; ?>
-
- <div id="titlebar-separator" style="margin-top: 34px;"></div>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/mobilenav.inc"; ?>
<style>
body {
@@ -95,7 +89,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
}
.modal.show {
- top: 34px;
left: 300px;
width: calc(100% - 300px);
}
@@ -225,7 +218,3 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
}
</style>
<?php endif; ?>
-
-<?php if ($page["rail"] && $isLoggedIn && !$useNewUI): ?>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rail.inc"; ?>
-<?php endif; ?>
diff --git a/includes/mobilenav.inc b/includes/components/mobilenav.inc
index ed778ec..646738c 100644
--- a/includes/mobilenav.inc
+++ b/includes/components/mobilenav.inc
@@ -8,7 +8,7 @@
</a>
<?php foreach ($navigation as $id => $item): if (!$item["admin"] || $isLoggedIn): ?>
<a onclick="toggleMobileNavigation('<?= $id ?>');" title="<?= $item["name"] ?>" data-bs-toggle="tooltip" id="mobile-navigation-item-<?= $id ?>" class="tooltip-nohelp mobile-navigation-item">
- <img src="<?= $item["icon"] ?>" <?php if ($item["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px;vertical-align: middle;">
+ <img src="<?= $item["icon"] ?>" <?php if ($item["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px;vertical-align: middle;border-radius:3px;">
</a>
<?php endif; endforeach; ?>
</div>
diff --git a/includes/navigation.inc b/includes/components/navigation.inc
index 976cfff..beb92bb 100644
--- a/includes/navigation.inc
+++ b/includes/components/navigation.inc
@@ -39,14 +39,6 @@ $navigation_admin = [
"minimal" => false,
"items" => [
[
- "name" => $pages["about"]["name"][$lang["_name"]],
- "icon" => "/assets/icons/about.svg",
- "invert" => true,
- "link" => "/-/about",
- "stepped" => null,
- "private" => false
- ],
- [
"name" => $pages["fronting"]["name"][$lang["_name"]],
"icon" => "/assets/icons/fronting.svg",
"invert" => true,
@@ -233,7 +225,7 @@ $navigation_global = [
]
];
$navigation_cloudburst = [
- "admin" => $_SERVER['HTTP_HOST'] === "fr.equestria.horse",
+ "admin" => false,
"name" => "Cloudburst System",
"icon" => getAsset("ynmuc"),
"invert" => false,
diff --git a/includes/pane.inc b/includes/components/pane.inc
index d135eac..28ccd71 100644
--- a/includes/pane.inc
+++ b/includes/components/pane.inc
@@ -37,7 +37,7 @@ foreach ($list as $color) {
<div class="pane-group" id="pane-group-<?= $id ?>">
<div class="pane-group-title">
- <img src="<?= $item["icon"] ?>" <?php if ($item["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px;vertical-align: middle;">
+ <img src="<?= $item["icon"] ?>" <?php if ($item["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style=" border-radius: 2px;width:24px;vertical-align: middle;">
<span style="vertical-align: middle;"><?= $item["name"] ?></span>
</div>
diff --git a/includes/planner.inc b/includes/components/planner.inc
index e553627..a7ec44f 100644
--- a/includes/planner.inc
+++ b/includes/components/planner.inc
@@ -1,13 +1,13 @@
<?php
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.inc"; global $travelling;
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.inc";
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.inc";
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isUserLoggedIn; global $isLowerLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/travelling.inc"; global $travelling;
+require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/score.inc";
+require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/pronouns.inc";
+require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isUserLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/banner.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/rainbow.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
global $_PROFILE;
$cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/ynmuc.json"), true);
diff --git a/includes/search.inc b/includes/components/search.inc
index 278ec41..278ec41 100644
--- a/includes/search.inc
+++ b/includes/components/search.inc
diff --git a/includes/sysbanner.inc b/includes/components/sysbanner.inc
index 763c961..8819617 100644
--- a/includes/sysbanner.inc
+++ b/includes/components/sysbanner.inc
@@ -15,7 +15,7 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
<div id="system-info" style="display:grid;grid-template-columns: 128px 1fr;background-color:rgba(255, 255, 255, .05);margin-left: -20px; margin-right: -20px;margin-top:-20px;padding: 20px 20px 10px;">
<div style="display: flex; align-items: center; justify-content: center;">
- <img src="<?= getAsset($systemID) ?>" alt="" style="width:128px;max-height:128px;border-top-left-radius:10px;border-bottom-left-radius:10px;">
+ <img src="<?= getAsset($systemID) ?>" alt="" style="width:128px;max-height:128px;border-radius:10px;">
</div>
<div style="padding:10px 10px 10px 20px;text-align:center;">
<div style="display: grid; grid-template-columns: 1fr;height:100%;grid-template-rows: max-content max-content 1fr;">
diff --git a/includes/wakeup.inc b/includes/components/wakeup.inc
index 587e705..587e705 100644
--- a/includes/wakeup.inc
+++ b/includes/components/wakeup.inc
diff --git a/includes/exchange.txt b/includes/exchange.txt
index 79156ae..07cccdc 100644
--- a/includes/exchange.txt
+++ b/includes/exchange.txt
@@ -1 +1 @@
-0.88 \ No newline at end of file
+0.89 \ No newline at end of file
diff --git a/includes/edit-private.inc b/includes/fragments/edit-private.inc
index 69f50d8..998dfdd 100644
--- a/includes/edit-private.inc
+++ b/includes/fragments/edit-private.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing " . $memberCommonName . " (private page) · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing " . $memberCommonName . " (private page) · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")) {
$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true));
@@ -8,7 +8,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<br>
<div class="container">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fullbanner.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/fullbanner.inc"; ?>
<p class="text-muted" id="page-content">
<span id="editor-save-status" class="text-muted">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html")) : "0" ?></span> bytes · <a href="/<?= $memberData["name"] ?>">View page</a>
@@ -139,4 +139,4 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
</script>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/edit.inc b/includes/fragments/edit.inc
index 61e9f29..b5617f2 100644
--- a/includes/edit.inc
+++ b/includes/fragments/edit.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing " . $memberCommonName . " (public page) · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing " . $memberCommonName . " (public page) · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")) {
$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true));
@@ -8,7 +8,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<br>
<div class="container">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fullbanner.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/fullbanner.inc"; ?>
<p class="text-muted" id="page-content">
<span id="editor-save-status" class="text-muted">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html")) : "0" ?></span> bytes · <a href="/<?= $memberData["name"] ?>">View page</a>
@@ -139,4 +139,4 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
</script>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/member.inc b/includes/fragments/member.inc
index b98d0f5..4eed308 100644
--- a/includes/member.inc
+++ b/includes/fragments/member.inc
@@ -6,7 +6,7 @@ if ($memberData["name"] === "fusion") {
$title = $memberCommonName . " · " . $systemCommonName;
}
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
@@ -53,7 +53,7 @@ if ($memberData["name"] === "fusion") {
<br>
<div class="container">
<div id="member-page" style="background-color: rgba(26,26,26,0.8);border-radius: 10px;padding:20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);margin-top:<?= !isset($memberData["banner"]) ? "15vh" : "30vh" ?>;<?php if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") && !($isLoggedIn && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html"))): ?> padding-bottom: 0 !important;<?php endif; ?>">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fullbanner.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/fullbanner.inc"; ?>
<div id="page-content">
<?php if ($memberData["name"] === "unknown"): ?>
@@ -98,7 +98,7 @@ if ($memberData["name"] === "fusion") {
</div>
<div class="container">
- <?php global $isLoggedIn; if ($isLoggedIn): ?>
+ <?php global $isLoggedIn; global $isLowerLoggedIn; if ($isLoggedIn || ($isLowerLoggedIn && $systemID === $app["other"]["id"])): ?>
<hr>
<details>
@@ -137,7 +137,7 @@ if ($memberData["name"] === "fusion") {
<li><b>Protector:</b> <code><?= $metadata["protector"] ? "1" : "0" ?></code> (<?= $metadata["protector"] ? "Yes" : "No" ?>)</li>
<li><b>Little:</b> <code><?= $metadata["little"] ?></code> (<?= $metadata["little"] === 2 ? "Is a little" : ($metadata["little"] === 1 ? "Is an age regressor" : ($metadata["little"] === 3 ? "Not a little, but younger" : "No")) ?>)</li>
<li><b>Relations count:</b> <code><?= count($metadata["marefriends"]) + count($metadata["sisters"]) ?></code></li>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc"; ?>
<li>
<b>Score breakdown:</b> <code>-</code>
<ul><li>-</ul></li>
@@ -147,4 +147,4 @@ if ($memberData["name"] === "fusion") {
<?php endif; ?>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/metadata.inc b/includes/fragments/metadata.inc
index 485666a..e143153 100644
--- a/includes/metadata.inc
+++ b/includes/fragments/metadata.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $app; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing metadata for " . $memberCommonName . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $app; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing metadata for " . $memberCommonName . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")) {
$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true));
@@ -120,6 +120,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<b>Member code</b><br>
<input name="membc" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= $metadata["code"] ?? "" ?>">
</p>
+ <?php endif; ?>
<hr>
@@ -133,7 +134,6 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<b>Age (for ponies with fixed age)</b><br>
<input name="age" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" pattern="^\d{1,2}(-\d{1,2}|)$" value="<?= $metadata["birth"]["age"] ?? "" ?>">
</p>
- <?php endif; ?>
<hr>
@@ -166,4 +166,4 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<?php endif; ?>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/sysedit.inc b/includes/fragments/sysedit.inc
index 22ec670..1b341b0 100644
--- a/includes/sysedit.inc
+++ b/includes/fragments/sysedit.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; $title = "Editing " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $systemCommonName; global $systemID; $title = "Editing " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -11,7 +11,7 @@
<div class="container">
<div id="system-page" style="background-color: rgba(26,26,26,0.8);border-radius: 10px;padding:20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);margin-top:30vh;">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/sysbanner.inc"; ?>
<br>
<p class="text-muted">
@@ -147,7 +147,7 @@
</script>
</div>
</div>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/sysbanner.inc"; ?>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/system.inc b/includes/fragments/system.inc
index ae624f9..030c743 100644
--- a/includes/system.inc
+++ b/includes/fragments/system.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $isLowerLoggedIn; global $systemCommonName; global $systemID; $title = $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $app; global $isLoggedIn;
+<?php global $system; global $isLowerLoggedIn; global $systemCommonName; global $systemID; $title = $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $app; global $isLoggedIn;
?>
@@ -16,7 +16,7 @@
<div class="container">
<div id="system-page" style="background-color: rgba(26,26,26,0.8);border-radius: 10px;padding:20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);margin-top:30vh;">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/sysbanner.inc"; ?>
<br>
<div id="page-content">
@@ -49,4 +49,4 @@
}
</style>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/init.inc b/includes/init.inc
index 5fb9ea2..ba523aa 100644
--- a/includes/init.inc
+++ b/includes/init.inc
@@ -7,7 +7,7 @@ global $pages;
global $lang; global $pages;
$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true);
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
if (in_array($toplevel, array_keys($pages))) {
$title = $pages[$toplevel]["name"][$lang["_name"]];
@@ -23,9 +23,9 @@ if (in_array($toplevel, array_keys($pages))) {
}
if ($pages[$toplevel]["limited"]) {
- if ((!$isLoggedIn && !$isLowerLoggedIn) || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die();
+ if ((!$isLoggedIn && !$isLowerLoggedIn) || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=/-/$toplevel") and die();
} else {
- if (!$isLoggedIn || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die();
+ if (!$isLoggedIn || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=/-/$toplevel") and die();
}
}
} else {
diff --git a/includes/language.inc b/includes/language.inc
deleted file mode 100644
index 424af3b..0000000
--- a/includes/language.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-$default = "en";
-
-$lf = $_COOKIE['PEH2_LANGUAGE'] ?? $default;
-
-if (str_contains("/", $lf)) $lf = "en";
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/i18n/" . $lf . ".json")) $lf = "en";
-
-$lang = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/i18n/" . $lf . ".json"), true); \ No newline at end of file
diff --git a/includes/pages.json b/includes/pages.json
index 8e21cc9..f5e665f 100644
--- a/includes/pages.json
+++ b/includes/pages.json
@@ -206,7 +206,7 @@
},
"short": "Metadata",
"admin": true,
- "limited": false,
+ "limited": true,
"rail": false
},
"money": {
diff --git a/includes/rail.inc b/includes/rail.inc
deleted file mode 100644
index e78815e..0000000
--- a/includes/rail.inc
+++ /dev/null
@@ -1,167 +0,0 @@
-<?php global $pages; ?>
-<div id="rail" style="position: fixed;top: 60px;left: 0;bottom: 0;background: rgba(255, 255, 255, .1);width: 32px; display: grid; grid-template-rows: max-content 1fr;">
- <div>
- <a id="rl-1" class="rail-link" href="/-/dashboard" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/home.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-2" class="rail-link" href="/-/fronting" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/fronting.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-3" class="rail-link" href="/-/actions" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/actions.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-4" class="rail-link" href="/-/rules" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/rules.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-5" class="rail-link" href="/-/docs" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/docs.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-6" class="rail-link" href="/-/nicknames" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/nicknames.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-7" class="rail-link" href="/-/together" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/together.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-8" class="rail-link" href="/-/splitting" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/splitting.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-9" class="rail-link" href="/-/byfront" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/byfront.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-10" class="rail-link" href="/-/bitset" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/bitset.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-11" class="rail-link" href="/-/travelling" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/travelling.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-12" class="rail-link" href="/-/toys" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/toys.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-16" class="rail-link" href="/-/stats" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/stats.svg" style="filter: invert(1) brightness(2000%); height: 24px; display:block;">
- </a>
- <a id="rl-87" class="rail-link" href="/-/emergency" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/emergency.svg" style="height: 24px; display:block;">
- </a>
- <a id="rl-88" class="rail-link" href="/-/wakeup" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/wakeup.svg" style="height: 24px; display:block;">
- </a>
- <a id="rl-89" class="rail-link" href="/-/pleasure" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/pleasure.svg" style="height: 24px; display:block;">
- </a>
- </div>
- <div style="margin-top: auto; height: max-content;">
- <a id="rl-98" class="rail-link" href="/-/debug" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/debug.svg" style="filter: invert(1); height: 24px; display:block;">
- </a>
- <a id="rl-99" class="rail-link" href="/-/about" style="padding: 4px; display: block;">
- <img alt="" src="/assets/icons/about.svg" style="filter: invert(1) brightness(2000%); height: 24px; display:block;">
- </a>
- </div>
-</div>
-<div id="rail-text" style="position: fixed;top: 60px;left: 32px;bottom: 0; z-index: 9999999; opacity: 0; pointer-events: none; display: grid; grid-template-rows: max-content 1fr;">
- <div>
- <div id="rlt-1" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["dashboard"]["name"] ?>
- </div>
- <div id="rlt-2" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["fronting"]["name"] ?>
- </div>
- <div id="rlt-3" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["actions"]["name"] ?>
- </div>
- <div id="rlt-4" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["rules"]["name"] ?>
- </div>
- <div id="rlt-5" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["docs"]["name"] ?>
- </div>
- <div id="rlt-6" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["nicknames"]["name"] ?>
- </div>
- <div id="rlt-7" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["together"]["name"] ?>
- </div>
- <div id="rlt-8" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["splitting"]["name"] ?>
- </div>
- <div id="rlt-9" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["byfront"]["name"] ?>
- </div>
- <div id="rlt-10" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["bitset"]["name"] ?>
- </div>
- <div id="rlt-11" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["travelling"]["name"] ?>
- </div>
- <div id="rlt-12" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["toys"]["name"] ?>
- </div>
- <div id="rlt-16" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["stats"]["name"] ?>
- </div>
- <div id="rlt-87" class="rail-text-item text-danger fw-bold" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["emergency"]["name"] ?>
- </div>
- <div id="rlt-88" class="rail-text-item text-info fw-bold" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["wakeup"]["name"] ?>
- </div>
- <div id="rlt-89" class="rail-text-item text-success fw-bold" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["pleasure"]["name"] ?>
- </div>
- </div>
- <div style="margin-top: auto; height: max-content;">
- <div id="rlt-98" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["debug"]["name"] ?>
- </div>
- <div id="rlt-99" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;">
- <?= $pages["about"]["name"] ?>
- </div>
- </div>
-</div>
-
-<style>
- .rail-link:hover {
- background: rgba(255, 255, 255, .1);
- border-top: 1px solid #555;
- border-bottom: 1px solid #555;
- padding: 3px 4px !important;
- }
-
- .rail-text-item {
- border: 1px solid #555;
- border-left: none;
- padding-right: 10px;
- border-top-right-radius: 999px;
- border-bottom-right-radius: 999px;
- width: 0;
- }
-
- .rail-text-item.hovered {
- background: #313131;
- opacity: 1 !important;
- width: max-content !important;
- }
-</style>
-
-<script>
- Array.from(document.getElementsByClassName("rail-link")).forEach((i) => {
- let rt = document.getElementById("rlt-" + i.id.split("-")[1]);
-
- i.onmouseenter = () => {
- rt.classList.add("hovered");
- }
-
- i.onmouseleave = () => {
- rt.classList.remove("hovered");
- }
- })
-
- document.getElementById("rail").onmouseenter = () => {
- document.getElementById("rail-text").style.opacity = "1";
- }
-
- document.getElementById("rail").onmouseleave = () => {
- document.getElementById("rail-text").style.opacity = "0";
- }
-</script> \ No newline at end of file
diff --git a/includes/refresh.php b/includes/refresh.php
index 65c570c..e561559 100644
--- a/includes/refresh.php
+++ b/includes/refresh.php
@@ -43,7 +43,7 @@ foreach ($deletable as $item) {
}
$times["docs_cleanup"] = microtime(true) - $currentOpStart;
-require_once "./cleanup.inc";
+require_once "./refresh/cleanup.inc";
$currentOpStart = microtime(true);
$version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true);
@@ -250,7 +250,7 @@ echo("Backing up...\n");
$lastBackup = (int)trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.txt"));
if (time() - $lastBackup >= 3600) {
- require_once "./backup.inc";
+ require_once "./refresh/backup.inc";
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.txt", time());
echo("Backup completed\n");
} else {
@@ -260,7 +260,7 @@ if (time() - $lastBackup >= 3600) {
echo("Generating logo...\n");
$currentOpStart = microtime(true);
-require_once "./logo.inc";
+require_once "./refresh/logo.inc";
$times["logo"] = microtime(true) - $currentOpStart;
echo("Generated logo\n");
@@ -279,7 +279,7 @@ echo("Fetched school information\n");
echo("Downloading assets...\n");
$currentOpStart = microtime(true);
-require_once "./assets.inc";
+require_once "./refresh/assets.inc";
$times["assets"] = microtime(true) - $currentOpStart;
echo("Downloading assets\n");
diff --git a/includes/assets.inc b/includes/refresh/assets.inc
index 3f2d652..b27840a 100644
--- a/includes/assets.inc
+++ b/includes/refresh/assets.inc
@@ -2,10 +2,10 @@
global $app;
-if (!file_exists("../assets/avatars")) mkdir("../assets/avatars");
-if (!file_exists("../assets/banners")) mkdir("../assets/banners");
-if (!file_exists("../assets/heads")) mkdir("../assets/heads");
-if (!file_exists("../assets/bodies")) mkdir("../assets/bodies");
+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)) {
@@ -18,7 +18,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"]);
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) . "\" ../assets/avatars/" . $id . ".webp");
+ 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));
}
@@ -26,7 +26,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"]);
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) ."\" ../assets/banners/" . $id . ".webp");
+ 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));
}
@@ -38,7 +38,7 @@ function downloadAssets($system, $path = null) {
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) . "\" ../assets/avatars/" . $id . ".webp");
+ 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));
}
@@ -46,7 +46,7 @@ function downloadAssets($system, $path = null) {
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) . "\" ../assets/banners/" . $id . ".webp");
+ 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);
@@ -59,21 +59,21 @@ function downloadAssets($system, $path = null) {
imagejpeg($img, "/tmp/img.jpeg", 100);
imagedestroy($img);
- exec("convert -resize 2048x2048 \"/tmp/img.jpeg\" ../assets/banners/" . $id . ".webp");
+ exec("convert -resize 2048x2048 \"/tmp/img.jpeg\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp");
unlink("/tmp/img.jpeg");
}
- if (file_exists("../assets/uploads/pt-" . $member["name"] . ".png")) {
- $url = "../assets/uploads/pt-" . $member["name"] . ".png";
+ if (file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png")) {
+ $url = "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png";
} else {
- $url = "../assets/uploads/pt.png";
+ $url = "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt.png";
}
echo(" /heads/$id.png\n");
- exec("convert \"" . $url . "\" ../assets/heads/" . $id . ".png");
+ exec("convert \"" . $url . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/heads/" . $id . ".png");
- if (file_exists("../assets/ponies/" . $member["id"] . ".png")) {
+ if (file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png")) {
echo(" /bodies/$id.png\n");
- exec("convert \"" . "../assets/ponies/" . $member["id"] . ".png" . "\" ../assets/bodies/" . $id . ".png");
+ exec("convert \"" . "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png" . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/bodies/" . $id . ".png");
}
}
}
diff --git a/includes/backup.inc b/includes/refresh/backup.inc
index 6196389..879704d 100644
--- a/includes/backup.inc
+++ b/includes/refresh/backup.inc
@@ -53,17 +53,17 @@ function pkcs7_pad($data, $size) {
return $data . str_repeat(chr($length), $length);
}
-if (!file_exists("./data/backup.ponieskey")) {
+if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.ponieskey")) {
echo(" Creating encryption key...\n");
$key = openssl_random_pseudo_bytes(512);
$iv = openssl_random_pseudo_bytes(16);
- file_put_contents("./data/backup.ponieskey", base64_encode(json_encode([
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.ponieskey", base64_encode(json_encode([
"iv" => bin2hex($iv),
"key" => bin2hex($key)
])));
} else {
echo(" Reading encryption key...\n");
- $key_raw = json_decode(base64_decode(file_get_contents("./data/backup.ponieskey")), true);
+ $key_raw = json_decode(base64_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.ponieskey")), true);
$key = hex2bin($key_raw["key"]);
$iv = hex2bin($key_raw["iv"]);
}
@@ -73,30 +73,25 @@ $payload = json_encode($data);
$encrypted = openssl_encrypt(pkcs7_pad($payload, 16), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);
echo(" Writing backup...\n");
-file_put_contents("./data/backup.poniesbackup", $encrypted);
-@mkdir("./data/encrypted");
+file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.poniesbackup", $encrypted);
+@mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/encrypted");
$id = str_replace(":", "-", date('c'));
-copy("./data/backup.poniesbackup", "./data/encrypted/" . $id . ".poniesbackup");
+copy($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.poniesbackup", $_SERVER['DOCUMENT_ROOT'] . "/includes/data/encrypted/" . $id . ".poniesbackup");
echo(" Uploading to servers...\n");
echo(" zephyrheights... upload\n");
-exec("scp ./data/encrypted/" . $id . ".poniesbackup root@zephyrheights.equestria.dev:/opt/ponies");
+exec("scp -P 2222 " . $_SERVER['DOCUMENT_ROOT'] . "/includes/data/encrypted/" . $id . ".poniesbackup root@zephyrheights.equestria.dev:/opt/ponies");
echo(" zephyrheights... cleaning up\n");
-exec('ssh root@zephyrheights.equestria.dev bash /opt/clean.sh');
-
-echo(" canterlot... upload\n");
-exec("scp ./data/encrypted/" . $id . ".poniesbackup root@canterlot.equestria.dev:/opt/ponies");
-echo(" canterlot... cleaning up\n");
-exec('ssh root@canterlot.equestria.dev bash /opt/clean.sh');
+exec('ssh -p 2222 root@zephyrheights.equestria.dev bash -c "cd /opt/ponies; ls -tp | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"');
if (file_exists("/opt/ponies")) {
echo(" bridlewood... copy\n");
- copy("./data/encrypted/" . $id . ".poniesbackup", "/opt/ponies/" . $id . ".poniesbackup");
+ copy($_SERVER['DOCUMENT_ROOT'] . "/includes/data/encrypted/" . $id . ".poniesbackup", "/opt/ponies/" . $id . ".poniesbackup");
echo(" bridlewood... cleaning up\n");
exec('bash -c "cd /opt/ponies; ls -tp | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"');
}
echo(" Cleaning up...\n");
-unlink("./data/encrypted/" . $id . ".poniesbackup"); \ No newline at end of file
+unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/encrypted/" . $id . ".poniesbackup"); \ No newline at end of file
diff --git a/includes/cleanup.inc b/includes/refresh/cleanup.inc
index 1d02081..39ec41a 100644
--- a/includes/cleanup.inc
+++ b/includes/refresh/cleanup.inc
@@ -4,10 +4,6 @@ $screens = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/inclu
return !str_starts_with($i, ".");
}));
-$windows = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows"), 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, ".");
}));
@@ -25,21 +21,4 @@ foreach ($screens as $screen) {
}
if ($delete) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens/" . $screen);
-}
-
-foreach ($windows as $window) {
- $delete = true;
- $id = explode(".", explode("-", $window)[2])[0];
-
- foreach ($computers as $file) {
- $computer = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $file), true);
-
- foreach ($computer["windows"] as $sel) {
- $id2 = sha1($sel["gid"]);
-
- if ($id2 === $id) $delete = false;
- }
- }
-
- if ($delete) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows/" . $window);
} \ No newline at end of file
diff --git a/includes/logo.inc b/includes/refresh/logo.inc
index 466dbb2..3e88140 100644
--- a/includes/logo.inc
+++ b/includes/refresh/logo.inc
@@ -1,8 +1,8 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
+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");
diff --git a/includes/system/compare.inc b/includes/system/compare.inc
index 768522f..7e683fa 100644
--- a/includes/system/compare.inc
+++ b/includes/system/compare.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $lang; global $pages; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:compare"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling; global $app;
+<?php global $system; global $lang; global $pages; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:compare"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $travelling; global $app;
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true);
@@ -184,4 +184,4 @@ $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/system/history.inc b/includes/system/history.inc
index 199f0ba..281e62d 100644
--- a/includes/system/history.inc
+++ b/includes/system/history.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $lang; global $pages; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"][$lang["_name"]] . " · " . $systemCommonName; global $systemID; global $app; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $lang; global $pages; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"][$lang["_name"]] . " · " . $systemCommonName; global $systemID; global $app; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -159,4 +159,4 @@
document.getElementById("timezone").style.display = "";
</script>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/titlebar.inc b/includes/titlebar.inc
deleted file mode 100644
index e941179..0000000
--- a/includes/titlebar.inc
+++ /dev/null
@@ -1,606 +0,0 @@
-<?php global $toplevel; global $system; global $isLoggedIn; global $lang; global $isLowerLoggedIn; global $pages; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); global $lang; global $pages; global $app; ?>
-<span>
- <?php
-
-$membersNames = array_map(function ($i) {
- return $i["name"];
-}, scoreOrderGlobal());
-$parts = explode("/", $_GET['_']);
-$name = $toplevel === "" ? "home" : $toplevel;
-
-$actionsProfile = "default";
-$part1 = "<page>";
-$part2 = null;
-$part3 = null;
-
-if (isset($pages[$name])) {
- if (($name === "docs" || $name === "toys" || $name === "actions" || $name === "computers") && isset($parts[2])) {
- $part3 = "<a class='title-bar-backlink' href='/-/dashboard'>Dashboard</a>";
- $part2 = "<a class='title-bar-backlink' href='/-/$name'>" . $pages[$name]['name'][$lang["_name"]] . "</a>";
-
- if ($name === "docs") {
- $actionsProfile = "docs-item";
- $part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $parts[2] . ".json"), true)["name"];
- } elseif ($name === "computers") {
- $part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $parts[2] . ".json"), true)["host"];
- } else {
- $actionsProfile = "$name-item";
- $list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($name === "toys" ? "toys/toys" : "actions/actions") . ".json"), true);
- $part1 = array_values(array_filter($list, function ($i) use ($parts) {
- return $i["id"] === $parts[2];
- }))[0]["name"];
- }
- } else {
- if ($pages[$name]["admin"]) {
- $part1 = $pages[$name]['name'][$lang["_name"]];
- $part2 = "<a class='title-bar-backlink' href='/-/dashboard'>Dashboard</a>";
- } else {
- $part1 = $pages[$name]['name'][$lang["_name"]];
- }
- }
-} elseif ($name === "cloudburst") {
- if (isset($parts[2])) {
- $part2 = "<a class='title-bar-backlink' href='/cloudburst'>Cloudburst System</a>";
-
- $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2];
- } else {
- $actionsProfile = "system";
- $part1 = "Cloudburst System";
- }
-} elseif ($name === "raindrops") {
- if (isset($parts[2])) {
- $part2 = "<a class='title-bar-backlink' href='/raindrops'>Raindrops System</a>";
-
- $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2];
- } else {
- $actionsProfile = "system";
- $part1 = "Raindrops System";
- }
-} elseif ($name === $app["other"]["slug"]) {
- if (isset($parts[2])) {
- $part2 = "<a class='title-bar-backlink' href='/" . $app["other"]["slug"] . "'>" . $app["other"]["name"] . "</a>";
-
- $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2];
- } else {
- $actionsProfile = "system";
- $part1 = $app["other"]["name"];
- }
-} else {
- $member = getMemberFromName($name);
- $actionsProfile = "member";
-
- if ($member["_system"] === $app["other"]["id"]) {
- $actionsProfile = "member-other";
- }
-
- if (isset($member)) {
- $memberName = $member["display_name"] ?? $member["name"];
- $part1 = "$memberName";
-
- if ($member["_system"] === "gdapd") {
- $part2 = "<a class='title-bar-backlink' href='/raindrops'>Raindrops System</a>";
- } elseif ($member["_system"] === "ynmuc") {
- $part2 = "<a class='title-bar-backlink' href='/cloudburst'>Cloudburst System</a>";
- } else {
- $part2 = "<a class='title-bar-backlink' href='/" . $app["other"]["slug"] . "'>" . $app["other"]["name"] . "</a>";
- }
- } else {
- $part1 = "$name";
- }
-}
-
-if ($actionsProfile === "default") {
- switch ($name) {
- case "home":
- $actionsProfile = "home";
- break;
-
- case "emergency":
- case "wakeup":
- case "pleasure":
- $actionsProfile = "alert";
- break;
-
- case "fronting":
- $actionsProfile = "planner";
- break;
-
- case "actions":
- case "toys":
- $actionsProfile = "actions-or-toys";
- break;
-
- case "docs":
- $actionsProfile = "docs";
- break;
-
- case "edit":
- case "edit-private":
- if (count($parts) === 3) $actionsProfile = "editor-system";
- if (count($parts) > 3 && in_array($parts[3], $membersNames)) $actionsProfile = "editor-member";
- break;
-
- case "debug":
- $actionsProfile = "debug";
- break;
-
- case "bitset":
- $actionsProfile = "bitset";
- break;
-
- case "computers":
- if (count($parts) === 3) $actionsProfile = "computers";
- if (count($parts) === 4) $actionsProfile = "computers-remote";
- break;
- }
-}
-
-echo("<span id='title-bar-parts-desktop''>");
-if (isset($part3)) {
- echo "$part3 > $part2 > <b>$part1</b>";
-} elseif (isset($part2)) {
- echo "$part2 > <b>$part1</b>";
-} else {
- echo "<b>$part1</b>";
-}
-echo("</span>");
-echo("<span id='title-bar-parts-mobile' style='display:none;'>");
-echo "<b>$part1</b>";
-echo("</span>");
-
-$links = [
- "default" => [
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "computers" => [
- [
- "name" => "Remote control",
- "link" => [
- "type" => "url",
- "text" => "/-/computers/" . ($parts[2] ?? null) . "/control"
- ],
- "icon" => "/assets/icons/computers-remote.svg",
- "invert" => true
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "computers-remote" => [
- [
- "name" => "Enable controlling",
- "link" => [
- "type" => "js",
- "text" => "enableControl();"
- ],
- "icon" => "/assets/icons/computers-on.svg",
- "invert" => true
- ],
- [
- "name" => "Disable controlling",
- "link" => [
- "type" => "js",
- "text" => "disableControl();"
- ],
- "icon" => "/assets/icons/computers-off.svg",
- "invert" => true
- ],
- [
- "name" => "Back to computer info",
- "link" => [
- "type" => "url",
- "text" => "/-/computers/" . ($parts[2] ?? null)
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "editor-member" => [
- [
- "name" => "View page",
- "link" => [
- "type" => "url",
- "text" => "/" . ($parts[3] ?? null)
- ],
- "icon" => "/assets/icons/view.svg",
- "invert" => true
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "editor-system" => [
- [
- "name" => "View page",
- "link" => [
- "type" => "url",
- "text" => "/" . ($parts[2] ?? null)
- ],
- "icon" => "/assets/icons/view.svg",
- "invert" => true
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "member" => [
- [
- "name" => $lang["titlebar"]["member"],
- "link" => [
- "type" => "url",
- "text" => "/$system"
- ],
- "icon" => "/assets/icons/parent.svg",
- "invert" => true
- ],
- [
- "name" => $pages["edit-private"]["name"][$lang["_name"]],
- "link" => [
- "type" => "url",
- "text" => "/-/edit-private/$system/$name"
- ],
- "icon" => "/assets/icons/edit-private.svg",
- "invert" => true,
- "show" => $isLoggedIn
- ],
- [
- "name" => $pages["edit"]["name"][$lang["_name"]],
- "link" => [
- "type" => "url",
- "text" => "/-/edit/$system/$name"
- ],
- "icon" => "/assets/icons/edit.svg",
- "invert" => true,
- "show" => $isLoggedIn
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "member-other" => [
- [
- "name" => $lang["titlebar"]["member"],
- "link" => [
- "type" => "url",
- "text" => "/$system"
- ],
- "icon" => "/assets/icons/parent.svg",
- "invert" => true
- ],
- [
- "name" => $pages["edit"]["name"][$lang["_name"]],
- "link" => [
- "type" => "url",
- "text" => "/-/edit/$system/$name"
- ],
- "icon" => "/assets/icons/edit.svg",
- "invert" => true,
- "show" => $isLoggedIn
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "home" => [
- [
- "name" => "Raindrops System",
- "link" => [
- "type" => "url",
- "text" => "/raindrops"
- ],
- "icon" => "/assets/avatars/7d9f543ef74240f69d0786c3f2983124.webp",
- "invert" => false
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "planner" => [
- [
- "name" => "Add in the Cloudburst System",
- "link" => [
- "type" => "js",
- "text" => "document.getElementById('planner-add-link-cloudburst-0').click()"
- ],
- "icon" => "/assets/icons/add-cloudburst.svg",
- "invert" => false
- ],
- [
- "name" => "Add in the Raindrops System",
- "link" => [
- "type" => "js",
- "text" => "document.getElementById('planner-add-link-raindrops-0').click()"
- ],
- "icon" => "/assets/icons/add-raindrops.svg",
- "invert" => false
- ]
- ],
- "actions-or-toys" => [
- [
- "name" => "Search",
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0; document.getElementById('search').focus();"
- ],
- "icon" => "/assets/icons/search.svg",
- "invert" => true
- ],
- [
- "name" => "Add",
- "link" => [
- "type" => "js",
- "text" => "(new bootstrap.Modal(document.getElementById('creator'))).show(); setInterval(() => { document.getElementById('creator-title').focus(); }, 500);"
- ],
- "icon" => "/assets/icons/add.svg",
- "invert" => true
- ]
- ],
- "docs" => [
- [
- "name" => "Marked for deletion",
- "link" => [
- "type" => "url",
- "text" => "#deletable"
- ],
- "icon" => "/assets/icons/delete.svg",
- "invert" => true
- ],
- [
- "name" => "Create new",
- "link" => [
- "type" => "url",
- "text" => "/-/docs/add"
- ],
- "icon" => "/assets/icons/add.svg",
- "invert" => true
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "docs-item" => [
- [
- "name" => "Save",
- "link" => [
- "type" => "js",
- "text" => "save();"
- ],
- "icon" => "/assets/icons/save.svg",
- "invert" => true
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "debug" => [
- [
- "name" => $lang["titlebar"]["debug"][0],
- "link" => [
- "type" => "url",
- "text" => "#failures"
- ],
- "icon" => "/assets/icons/failures.svg",
- "invert" => true
- ],
- [
- "name" => $lang["titlebar"]["debug"][1],
- "link" => [
- "type" => "url",
- "text" => "#times"
- ],
- "icon" => "/assets/icons/time.svg",
- "invert" => true
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ],
- "bitset" => [
- [
- "name" => "Copy bitset",
- "link" => [
- "type" => "js",
- "text" => "navigator.clipboard.writeText(document.getElementById('input').value);"
- ],
- "icon" => "/assets/icons/copy.svg",
- "invert" => true
- ],
- [
- "name" => "Reset",
- "link" => [
- "type" => "js",
- "text" => "document.getElementById('input').value = '2048'; calculateInput();"
- ],
- "icon" => "/assets/icons/reset.svg",
- "invert" => true
- ]
- ],
- "alert" => [
- [
- "name" => "Turn alert on",
- "link" => [
- "type" => "js",
- "text" => "if (document.getElementById('btn-on').style.display === 'block') (new bootstrap.Modal(document.getElementById('turn-on'))).show();"
- ],
- "icon" => "/assets/icons/alert-on.svg",
- "invert" => true
- ],
- [
- "name" => "Turn alert off",
- "link" => [
- "type" => "js",
- "text" => "if (document.getElementById('btn-off').style.display === 'block') (new bootstrap.Modal(document.getElementById('turn-off'))).show();"
- ],
- "icon" => "/assets/icons/alert-off.svg",
- "invert" => true
- ]
- ],
- "system" => [
- [
- "name" => $pages["s:history"]["name"][$lang["_name"]],
- "link" => [
- "type" => "url",
- "text" => "/$name/-/history"
- ],
- "icon" => "/assets/icons/history.svg",
- "invert" => true
- ],
- [
- "name" => $pages["s:compare"]["name"][$lang["_name"]],
- "link" => [
- "type" => "url",
- "text" => "/$name/-/compare"
- ],
- "icon" => "/assets/icons/compare.svg",
- "invert" => true
- ],
- [
- "name" => $pages["edit"]["name"][$lang["_name"]],
- "link" => [
- "type" => "url",
- "text" => "/-/edit/$name"
- ],
- "icon" => "/assets/icons/edit.svg",
- "invert" => true,
- "show" => $isLoggedIn
- ],
- [
- "name" => $lang["titlebar"]["top"],
- "link" => [
- "type" => "js",
- "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
- ],
- "icon" => "/assets/icons/up.svg",
- "invert" => true
- ]
- ]
-];
-
-if ($_SERVER['HTTP_HOST'] !== "fr.equestria.horse") {
- array_unshift($links["home"], [
- "name" => "Cloudburst System",
- "link" => [
- "type" => "url",
- "text" => "/cloudburst"
- ],
- "icon" => "/assets/avatars/ade46823206b4b0cad3ccaae934a5f3b.webp",
- "invert" => false
- ]);
-}
-
-if ($isLowerLoggedIn || $isLoggedIn) {
- $links["home"][] = [
- "name" => $app["other"]["name"],
- "link" => [
- "type" => "url",
- "text" => "/" . $app["other"]["slug"]
- ],
- "icon" => "/assets/avatars/" . str_replace("-", "", $app["other"]["uuid"]) . ".webp",
- "invert" => false
- ];
-
- $links["home"] = [
- array_values(array_filter($links["home"], function ($i) { return $i["name"] === "Cloudburst System"; }))[0],
- array_values(array_filter($links["home"], function ($i) { return $i["name"] === "Raindrops System"; }))[0],
- array_values(array_filter($links["home"], function ($i) use ($app) { return $i["name"] === $app["other"]["name"]; }))[0],
- array_values(array_filter($links["home"], function ($i) { return $i["link"]["type"] === "js"; }))[0]
- ];
-}
-
-$linksList = $links[isset($links[$actionsProfile]) ? $actionsProfile : "default"];
-
-?>
- <span id="title-bar-actions">
- <?php foreach ($linksList as $index => $link): if (!(isset($link["show"]) && !$link["show"])): ?><a style="height: 33px; display: inline-block; padding: 4px;" id="title-bar-action-<?= $index ?>" <?php if ($link["link"]["type"] === "url"): ?>href<?php else: ?>onclick<?php endif; ?>="<?= $link["link"]["text"] ?>" title="<?= $link["name"] ?>" data-bs-toggle="tooltip" class="title-bar-action tooltip-nohelp"><img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px;vertical-align: middle;"></a><?php endif; endforeach; ?>
- </span>
-</span>
-
-<style>
- .title-bar-backlink {
- color: white !important;
- text-decoration: none;
- }
-
- .title-bar-backlink:hover {
- opacity: .75;
- }
-
- #title-bar-actions {
- position: fixed;
- right: 0;
- height: 34px;
- top: 0;
- display: block;
- border-left: 1px solid rgba(255, 255, 255, .25);
- }
-
- .title-bar-action {
- cursor: pointer;
- }
-
- .title-bar-action:hover {
- background-color: rgba(255, 255, 255, .1);
- }
-</style> \ No newline at end of file
diff --git a/includes/Parsedown.php b/includes/util/Parsedown.php
index 3e29589..3e29589 100644
--- a/includes/Parsedown.php
+++ b/includes/util/Parsedown.php
diff --git a/includes/agewarning.inc b/includes/util/agewarning.inc
index 1f51647..1f51647 100644
--- a/includes/agewarning.inc
+++ b/includes/util/agewarning.inc
diff --git a/includes/banner.inc b/includes/util/banner.inc
index a95c51d..46d9ce5 100644
--- a/includes/banner.inc
+++ b/includes/util/banner.inc
@@ -1,8 +1,8 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/pronouns.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $lang; global $pages;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/pronouns.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
diff --git a/includes/bitset.inc b/includes/util/bitset.inc
index 131cb39..131cb39 100644
--- a/includes/bitset.inc
+++ b/includes/util/bitset.inc
diff --git a/includes/functions.inc b/includes/util/functions.inc
index e9024d1..24b059a 100644
--- a/includes/functions.inc
+++ b/includes/util/functions.inc
@@ -1,8 +1,8 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/homepage.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/homepage.inc";
if (!function_exists("peh_error")) {
function peh_error($message, $code = 500): void {
@@ -26,14 +26,14 @@ if (!function_exists("getAsset")) {
}, $members);
if (in_array($memberID, $list)) {
- $id2 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", getMemberWithoutSystem($memberID)["uuid"]);
+ $id2 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", (getMemberWithoutSystem($memberID) ?? ['uuid' => ''])["uuid"]);
} else {
return "/error/nomember/?s=$systemID&m=$memberID&t=$type";
}
$id = $id1 . $id2;
- if (str_ends_with(getMemberWithoutSystem($memberID)["name"], "-travelling")) {
+ if (str_ends_with((getMemberWithoutSystem($memberID) ?? ['name' => ''])["name"], "-travelling")) {
$id1 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/general.json"), true)["uuid"]);
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true);
diff --git a/includes/homepage.inc b/includes/util/homepage.inc
index 900d8f1..ebb99da 100644
--- a/includes/homepage.inc
+++ b/includes/util/homepage.inc
@@ -12,7 +12,7 @@ function newHomepage($id, $page, $title) {
<?php if ($title): ?>
<a href="/<?= $page ?>" style="height: 48px; display: flex; align-items: center; justify-content: center; border-top-left-radius: 10px; border-top-right-radius: 10px; text-align: center; text-decoration: none; color: white; background-color: #<?= $system["color"] ?? "000000" ?>55" class="new-homepage-system-title" id="new-homepage-system-<?= $id ?>-title">
<div>
- <img src="<?= getAsset($id) ?>" style="width: 48px; vertical-align: middle;"><b style="vertical-align: middle; margin-left: 5px;"><?= $system["name"] ?></b>
+ <img src="<?= getAsset($id) ?>" style="border-radius: 5px;width: 48px; vertical-align: middle;"><b style="vertical-align: middle; margin-left: 5px;"><?= $system["name"] ?></b>
</div>
</a>
<?php endif; ?>
diff --git a/includes/util/language.inc b/includes/util/language.inc
new file mode 100644
index 0000000..e24255f
--- /dev/null
+++ b/includes/util/language.inc
@@ -0,0 +1,3 @@
+<?php
+
+$lang = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/i18n/en.json"), true); \ No newline at end of file
diff --git a/includes/profiles.inc b/includes/util/profiles.inc
index 66274c7..66274c7 100644
--- a/includes/profiles.inc
+++ b/includes/util/profiles.inc
diff --git a/includes/pronouns.inc b/includes/util/pronouns.inc
index 6ab2487..6ab2487 100644
--- a/includes/pronouns.inc
+++ b/includes/util/pronouns.inc
diff --git a/includes/rainbow.inc b/includes/util/rainbow.inc
index 01b234c..66ac2fc 100644
--- a/includes/rainbow.inc
+++ b/includes/util/rainbow.inc
@@ -1,8 +1,8 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
+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";
function rainbow($hideCloudburst = false): array {
$members = scoreOrderGlobal();
diff --git a/includes/random.inc b/includes/util/random.inc
index b6e7905..b6e7905 100644
--- a/includes/random.inc
+++ b/includes/util/random.inc
diff --git a/includes/score.inc b/includes/util/score.inc
index 57c7a75..57c7a75 100644
--- a/includes/score.inc
+++ b/includes/util/score.inc
diff --git a/includes/session.inc b/includes/util/session.inc
index b99cc81..7a6b931 100644
--- a/includes/session.inc
+++ b/includes/util/session.inc
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
global $isLoggedIn;
global $isLowerLoggedIn;
diff --git a/includes/short.inc b/includes/util/short.inc
index 1c4760c..39e42b0 100644
--- a/includes/short.inc
+++ b/includes/util/short.inc
@@ -1,8 +1,8 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
+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";
global $toplevel; global $lang; global $pages;
diff --git a/includes/travelling.inc b/includes/util/travelling.inc
index 0d1696a..0d1696a 100644
--- a/includes/travelling.inc
+++ b/includes/util/travelling.inc
diff --git a/pages/about.inc b/pages/about.inc
deleted file mode 100644
index 8a62d66..0000000
--- a/pages/about.inc
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
-$version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true);
-
-$ignore = [
- $_SERVER['DOCUMENT_ROOT'] . "/Data",
- $_SERVER['DOCUMENT_ROOT'] . "/bits/Data",
- $_SERVER['DOCUMENT_ROOT'] . "/Private/Data",
- $_SERVER['DOCUMENT_ROOT'] . "/bits/Private/Data",
- $_SERVER['DOCUMENT_ROOT'] . "/includes/data",
- $_SERVER['DOCUMENT_ROOT'] . "/includes/tokens",
-];
-
-function rscandir($dir, $inverseIgnore = false) {
- global $ignore;
- $files = [];
-
- foreach (array_filter(scandir($dir), function ($i) {
- return !str_starts_with($i, ".");
- }) as $file) {
- if (!(($inverseIgnore && !in_array($dir . "/" . $file, $ignore)) || (!$inverseIgnore && in_array($dir . "/" . $file, $ignore)))) {
- if (is_dir($dir . "/" . $file)) {
- array_push($files, ...rscandir($dir . "/" . $file));
- } else {
- $files[] = $dir . "/" . $file;
- }
- }
- }
-
- return array_unique($files);
-}
-
-$sizeSystem = array_reduce(array_map(function ($i) {
- return filesize($i);
-}, rscandir($_SERVER['DOCUMENT_ROOT'])), function ($a, $b) {
- return $a + $b;
-});
-
-$sizeData = array_reduce(array_map(function ($i) {
- return filesize($i);
-}, rscandir($_SERVER['DOCUMENT_ROOT'], true)), function ($a, $b) {
- return $a + $b;
-});
-
-?>
-
-<br>
-<div class="container">
- <div id="page-content">
- <h2>About Cold Haze</h2>
- <p>
- <b>Cold Haze Engine version 2.<?= $version["build"] ?>.<?= $version["revision"] ?></b><br>
- Version date: <?= date('D j M Y, G:i:s T', $version["timestamp"]) ?><br>
- Version ID: <code style="color: white;"><?= $version["hash"] ?></code><br>
- Install path: <?= $_SERVER['DOCUMENT_ROOT'] ?><br>
- Server software: <?= $_SERVER['SERVER_SOFTWARE'] ?>, via <?= $_SERVER['GATEWAY_INTERFACE'] ?><br>
- Transport protocol: <?= $_SERVER['SERVER_PROTOCOL'] ?>
- </p>
-
- <p>
- <b>PHP <?= PHP_VERSION ?></b><br>
- Zend Engine: <?= zend_version() ?><br>
- Server API: <?= php_sapi_name() ?><br>
- Memory usage: <?= prettySize(memory_get_peak_usage()) ?><br>
- Server OS: <?= php_uname("s") ?> <?= php_uname("r") ?><br>
- Server domain name: <?= php_uname("n") ?><br>
- Server architecture: <?= php_uname("m") ?>
- </p>
-
- <p>
- <b>Disk space usage</b><br>
- Engine: <?= prettySize($sizeSystem) ?><br>
- Database: <?= prettySize($sizeData) ?>
- </p>
- </div>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
diff --git a/pages/alphabet.inc b/pages/alphabet.inc
index 55cb130..37bd74d 100644
--- a/pages/alphabet.inc
+++ b/pages/alphabet.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -35,4 +35,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/api/chrome.php b/pages/api/chrome.php
new file mode 100644
index 0000000..0be8a94
--- /dev/null
+++ b/pages/api/chrome.php
@@ -0,0 +1,87 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
+
+
+if (isset($_GET["e"])) {
+ header("Access-Control-Allow-Origin: chrome-extension://klenhenmabddpffgdaijdkjmfkkafbno");
+} else {
+ header("Access-Control-Allow-Origin: *");
+}
+
+header("Access-Control-Allow-Credentials: true");
+header("Access-Control-Allow-Methods: *");
+header("Access-Control-Allow-Headers: *");
+
+if (!isset($_GET["t"])) {
+ header("Content-Type: application/json");
+
+ if ($isLoggedIn) {
+ die("true");
+ } else {
+ die("false");
+ }
+} else {
+ switch ($_GET["t"]) {
+ case "onboarding":
+ header("Content-Type: text/html");
+
+ ?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="icon" href="https://git.equestria.dev/repo-avatars/1c0dad449a8e21ad16fa0efb1426c1a3301b1f26a8cb3b3902eec88bb568e34c" type="image/png">
+ <title>Luna for Chrome OS</title>
+ <style>
+ html, body {
+ background-color: #0d0b16;
+ color: white;
+ font-family: sans-serif;
+ overflow: hidden;
+ }
+
+ button:hover {
+ opacity: .75;
+ }
+
+ button:active {
+ opacity: .5;
+ }
+ </style>
+</head>
+<body>
+<div style="max-width: 65vw; margin-left: auto; margin-right: auto; height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center;">
+ <div>
+ <img src="https://git.equestria.dev/repo-avatars/1c0dad449a8e21ad16fa0efb1426c1a3301b1f26a8cb3b3902eec88bb568e34c" width="128px">
+ <h1>Please login to Cold Haze</h1>
+ <p>To proceed with activating Luna on this Chromebook, you need to login to Cold Haze. You also need to make sure you properly enroled this computer into Chrome Enterprise.</p>
+ <button onclick='window.open("https://ponies.equestria.horse/-/login/?return=/api/close&mini", "_blank", "popup,top=100,width=100,height:250")' style="cursor: pointer; background: #5958ad; color: white; border: none; padding: 5px 10px; border-radius: 5px;">Login</button>
+ </div>
+</div>
+
+<script>
+ setTimeout(async () => {
+ if (JSON.parse(await (await fetch("https://ponies.equestria.horse/api/chrome")).text())) {
+ window.close();
+ }
+ });
+
+ setInterval(async () => {
+ if (JSON.parse(await (await fetch("https://ponies.equestria.horse/api/chrome")).text())) {
+ window.close();
+ }
+ }, 5000);
+</script>
+</body>
+</html>
+<?php
+
+ die();
+ default:
+ header("Location: /");
+ die();
+ }
+} \ No newline at end of file
diff --git a/pages/api/close.php b/pages/api/close.php
new file mode 100644
index 0000000..07d1cff
--- /dev/null
+++ b/pages/api/close.php
@@ -0,0 +1 @@
+<script>window.close();</script> \ No newline at end of file
diff --git a/pages/api/cloudburst-img.php b/pages/api/cloudburst-img.php
index 1967a90..7d22aad 100644
--- a/pages/api/cloudburst-img.php
+++ b/pages/api/cloudburst-img.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true);
$url = isset($fronters['members'][0]) ? ($fronters['members'][0]["avatar_url"] ? $_SERVER['DOCUMENT_ROOT'] . getAsset("ynmuc", $fronters['members'][0]["id"]) : $_SERVER['DOCUMENT_ROOT'] . "/uploads/raindrops.png") : $_SERVER['DOCUMENT_ROOT'] . "/uploads/raindrops.png";
diff --git a/pages/api/computer.php b/pages/api/computer.php
index d3ec15a..8261fa8 100644
--- a/pages/api/computer.php
+++ b/pages/api/computer.php
@@ -1,12 +1,16 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $_PROFILE;
+if (isset($_GET["chrome"])) {
+ header("Access-Control-Allow-Origin: chrome-extension://klenhenmabddpffgdaijdkjmfkkafbno");
+}
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE;
if (!$isLoggedIn) header("Location: /-/login") and die();
$request_raw = file_get_contents('php://input');
$json_object = json_decode($request_raw, true);
-$host = md5($json_object['host']);
+$host = md5($json_object['host'] ?? $_GET["host"]);
switch ($_GET['type']) {
case "heartbeat":
diff --git a/pages/api/data.php b/pages/api/data.php
index 0a1b01b..eb07824 100644
--- a/pages/api/data.php
+++ b/pages/api/data.php
@@ -1,7 +1,7 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
if (!isset($_GET['f']) || !file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $_GET['f'])) {
diff --git a/pages/api/docs.php b/pages/api/docs.php
index 89e9216..d279765 100644
--- a/pages/api/docs.php
+++ b/pages/api/docs.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $_PROFILE;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE;
if (!$isLoggedIn) header("Location: /-/login") and die();
$request_raw = file_get_contents('php://input');
diff --git a/pages/api/emergency-real.php b/pages/api/emergency-real.php
index 2dd7172..05bbaf7 100644
--- a/pages/api/emergency-real.php
+++ b/pages/api/emergency-real.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/pages/api/emergency.php b/pages/api/emergency.php
index e0726e7..ff79834 100644
--- a/pages/api/emergency.php
+++ b/pages/api/emergency.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/pages/api/fronter.php b/pages/api/fronter.php
index b380a56..9ef5571 100644
--- a/pages/api/fronter.php
+++ b/pages/api/fronter.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
if (!$isLoggedIn || $isLowerLoggedIn) {
header("Location: /-/login");
die();
diff --git a/pages/api/me.php b/pages/api/me.php
index 817b106..215e1cf 100644
--- a/pages/api/me.php
+++ b/pages/api/me.php
@@ -2,7 +2,7 @@
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/pages/api/plex.php b/pages/api/plex.php
index 6d7ad8f..a2fa739 100644
--- a/pages/api/plex.php
+++ b/pages/api/plex.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/random.inc";
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
function formatTitle($metadata) {
@@ -48,8 +48,6 @@ if ($payload["Metadata"]["type"] === "track") {
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/cache/" . $id . ".jpg", file_get_contents("https://plex.equestria.dev" . $payload["Metadata"]["grandparentThumb"] . "?X-Plex-Token=" . $app["plex"]));
}
-file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/.files.json", json_encode($_FILES));
-
if ($payload["event"] === "playback.started" || $payload["event"] === "media.play") {
$hookObject = json_encode([
"username" => "Plex",
diff --git a/pages/api/pluralkit-integration.php b/pages/api/pluralkit-integration.php
index 0793873..f5bb4dd 100644
--- a/pages/api/pluralkit-integration.php
+++ b/pages/api/pluralkit-integration.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/agewarning.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/agewarning.inc";
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$user = $_GET['user'] ?? null;
@@ -86,86 +86,56 @@ if ($input["type"] === "CREATE_SWITCH" || $input["type"] === "UPDATE_SWITCH" ||
}
}
- if ($system !== $app["other"]["id"] || !isset($app["other"])) {
- if (count($fronters["members"]) > 1) {
- $context = stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: 🐴 Switch occurred in the $name\r\n" .
- "Priority: default\r\n" .
- "Tags: switch\r\n" .
- "Actions: view, Open " . $fronters["members"][0]["display_name"] . " on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true;view, Open " . $fronters["members"][1]["display_name"] . " on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][1]["name"] . "/, clear=true\r\n" .
- "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " and " . ($fronters["members"][1]["display_name"] ?? $fronters["members"][1]["name"]) . " switched in just now"
- ]
- ]);
- } else if (count($fronters["members"]) > 0) {
- $context = stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: 🐴 Switch occurred in the $name\r\n" .
- "Priority: default\r\n" .
- "Tags: switch\r\n" .
- "Actions: view, Open on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true\r\n" .
- "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " switched in just now"
- ]
- ]);
- } else {
- $context = stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: 🐴 Switch occurred in the $name\r\n" .
- "Priority: default\r\n" .
- "Tags: switch\r\n" .
- "Actions: view, Open on Cold Haze, https://ponies.equestria.horse/, clear=true\r\n" .
- "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => "The fallback pony switched in just now"
- ]
- ]);
- }
+ if (count($fronters["members"]) > 1) {
+ $context = stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: 🐴 Switch occurred in $name\r\n" .
+ "Priority: default\r\n" .
+ "Tags: switch\r\n" .
+ "Actions: view, Open " . $fronters["members"][0]["display_name"] . " on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true;view, Open " . $fronters["members"][1]["display_name"] . " on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][1]["name"] . "/, clear=true\r\n" .
+ "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
+ 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " and " . ($fronters["members"][1]["display_name"] ?? $fronters["members"][1]["name"]) . " switched in just now"
+ ]
+ ]);
+ } else if (count($fronters["members"]) > 0) {
+ $context = stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: 🐴 Switch occurred in $name\r\n" .
+ "Priority: default\r\n" .
+ "Tags: switch\r\n" .
+ "Actions: view, Open on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true\r\n" .
+ "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
+ 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " switched in just now"
+ ]
+ ]);
+ } else {
+ $context = stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: 🐴 Switch occurred in $name\r\n" .
+ "Priority: default\r\n" .
+ "Tags: switch\r\n" .
+ "Actions: view, Open on Cold Haze, https://ponies.equestria.horse/, clear=true\r\n" .
+ "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
+ 'content' => "The fallback pony switched in just now"
+ ]
+ ]);
+ }
+ if ($system !== $app["other"]["id"] || !isset($app["other"])) {
file_get_contents('https://' . $ntfy["server"] . '/public-switches', false, $context);
}
if ($system === "gdapd") {
$topic = "public-switches-raindrops";
-
- if (count($fronters["members"]) > 0) {
- file_get_contents('https://' . $ntfy["server"] . '/public-switches-fr', false, stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: 🐴 $name vient de switch\r\n" .
- "Priority: default\r\n" .
- "Tags: switch\r\n" .
- "Actions: view, Voir sur Cold Haze, https://fr.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true\r\n" .
- "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " est désormais au front"
- ]
- ]));
- } else {
- file_get_contents('https://' . $ntfy["server"] . '/public-switches-fr', false, stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: 🐴 $name vient de switch\r\n" .
- "Priority: default\r\n" .
- "Tags: switch\r\n" .
- "Actions: view, Voir sur Cold Haze, https://fr.equestria.horse/, clear=true\r\n" .
- "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => "Le poney de trait est désormais au front"
- ]
- ]));
- }
} else if ($system === "ynmuc") {
$topic = "public-switches-cloudburst";
} else {
diff --git a/pages/api/ponytown.php b/pages/api/ponytown.php
index f41ac01..e75ea33 100644
--- a/pages/api/ponytown.php
+++ b/pages/api/ponytown.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $_PROFILE; global $isLowerLoggedIn; global $app;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE; global $isLowerLoggedIn; global $app;
if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die();
$request_raw = file_get_contents('php://input');
diff --git a/pages/api/raindrops-img.php b/pages/api/raindrops-img.php
index 4cbac6b..fcf1ae6 100644
--- a/pages/api/raindrops-img.php
+++ b/pages/api/raindrops-img.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true);
$url = isset($fronters['members'][0]) ? ($fronters['members'][0]["avatar_url"] ? $_SERVER['DOCUMENT_ROOT'] . getAsset("gdapd", $fronters['members'][0]["id"]) : $_SERVER['DOCUMENT_ROOT'] . "/uploads/raindrops.png") : $_SERVER['DOCUMENT_ROOT'] . "/uploads/raindrops.png";
diff --git a/pages/api/save-private.php b/pages/api/save-private.php
index de7d505..6843e2a 100644
--- a/pages/api/save-private.php
+++ b/pages/api/save-private.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
$request_raw = file_get_contents('php://input');
diff --git a/pages/api/save.php b/pages/api/save.php
index 2ea3663..abb477d 100644
--- a/pages/api/save.php
+++ b/pages/api/save.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; global $app;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; global $app;
if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die();
$request_raw = file_get_contents('php://input');
diff --git a/pages/api/token.php b/pages/api/token.php
index 99b9158..5c80ca3 100644
--- a/pages/api/token.php
+++ b/pages/api/token.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
header("Content-Type: text/plain");
diff --git a/pages/api/wakeup-real.php b/pages/api/wakeup-real.php
index 2267a4e..0467f27 100644
--- a/pages/api/wakeup-real.php
+++ b/pages/api/wakeup-real.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/pages/api/wakeup.php b/pages/api/wakeup.php
index 69b0a68..c338b9a 100644
--- a/pages/api/wakeup.php
+++ b/pages/api/wakeup.php
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
diff --git a/pages/byfront.inc b/pages/byfront.inc
index bcdc1e8..2ec62bd 100644
--- a/pages/byfront.inc
+++ b/pages/byfront.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
?>
@@ -174,4 +174,4 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
</style>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/byspecies.inc b/pages/byspecies.inc
index 28f114e..ee2b372 100644
--- a/pages/byspecies.inc
+++ b/pages/byspecies.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $lang; global $pages; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:species"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling;
+<?php global $system; global $systemCommonName; global $lang; global $pages; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:species"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $travelling;
$members = scoreOrderGlobal();
@@ -10,7 +10,7 @@ function species(array $members, string $id, string $name) { global $systemID; g
<div class="relation-item" style="margin-left:10px;padding:0 20px;">
<?php if (count($members) > 0): ?>
- <?php $index = 0; foreach ($members as $member): ?><a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?>
+ <?php $index = 0; foreach ($members as $member): ?><a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?>
<?php else: ?>-<?php endif; ?>
</div>
</div>
@@ -54,4 +54,4 @@ function species(array $members, string $id, string $name) { global $systemID; g
<?php species($changeling, "changeling", "Changelings"); ?>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/pages/computers.inc b/pages/computers.inc
index 56a1b5d..fb88296 100644
--- a/pages/computers.inc
+++ b/pages/computers.inc
@@ -1,6 +1,6 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $pagename; global $_USER;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $pagename; global $_USER; global $_PROFILE;
$computer = [];
$parts = explode("/", $pagename);
@@ -26,7 +26,7 @@ if (isset($parts[2]) && $parts[2] !== "control") {
die();
}
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
$parts = array_values(array_filter($parts, function ($i) {
return $i !== "-";
@@ -36,6 +36,10 @@ if (count($parts) === 2 || count($parts) === 3) {
array_unshift($parts, null);
}
+if (str_ends_with($computer["os"], "unknown")) {
+ $computer["os"] = trim(substr($computer["os"], 0, -7));
+}
+
?>
<script>
@@ -112,11 +116,15 @@ if (count($parts) === 2 || count($parts) === 3) {
</tr>
<tr>
<td style="padding-right: 10px; text-align: right;"><b>Serial:</b></td>
- <td><?= $computer["serial"] ?> (<?= $computer["serial_source"] === "hardware" ? "logic board" : "OS" ?>)</td>
+ <?php if (trim($computer["serial"]) !== ""): ?><td><?= $computer["serial"] ?> (<?= $computer["serial_source"] === "hardware" ? "logic board" : "OS" ?>)</td><?php else: ?><td>-</td><?php endif; ?>
</tr>
<tr>
- <td style="padding-right: 10px; text-align: right;"><b>Last seen:</b></td>
- <td><?= date('j M, g:ia (T)', strtotime($computer["date"])) ?>, <?= timeAgo($computer["date"]) ?></td>
+ <td style="padding-right: 10px; text-align: right;"><b>Status:</b></td>
+ <?php if (timeAgo($computer["date"]) === "now"): ?>
+ <td>Online</td>
+ <?php else: ?>
+ <td>Offline since <?= timeAgo($computer["date"]) ?>, <?= date('j M, g:ia (T)', strtotime($computer["date"])) ?></td>
+ <?php endif; ?>
</tr>
</tbody>
</table>
@@ -225,7 +233,7 @@ if (count($parts) === 2 || count($parts) === 3) {
</tr>
<tr>
<td style="padding-right: 10px; text-align: right;"><b>System:</b></td>
- <td><?= $computer["os_info"]["distro"] ?> <?= $computer["os_info"]["release"] ?></td>
+ <td><?= $computer["os_info"]["distro"] ?> <?= $computer["os_info"]["release"] === "unknown" ? "" : $computer["os_info"]["release"] ?></td>
</tr>
<tr>
<td style="padding-right: 10px; text-align: right;"><b>CPU architecture:</b></td>
@@ -241,7 +249,7 @@ if (count($parts) === 2 || count($parts) === 3) {
</tr>
<tr>
<td style="padding-right: 10px; text-align: right;"><b>Build number:</b></td>
- <td><?= $computer["os_info"]["build"] ?></td>
+ <td><?= $computer["os_info"]["build"] === "rolling" ? "Rolling release" : $computer["os_info"]["build"] ?></td>
</tr>
<tr>
<td style="padding-right: 10px; text-align: right;"><b>Serial number:</b></td>
@@ -449,9 +457,8 @@ if (count($parts) === 2 || count($parts) === 3) {
"LISTEN" => "Listening",
"CLOSING" => "Terminating",
"UNKNOWN" => "?",
- "LAST_ACK", "FIN_WAIT2" => "Waiting",
- "TIME_WAIT" => "Waiting",
- "FIN_WAIT1" => "Closing",
+ "LAST_ACK", "FIN_WAIT2", "TIME_WAIT" => "Waiting",
+ "FIN_WAIT1", "CLOSE_WAIT" => "Closing",
"SYN_RECV" => "Received",
"SYN_SENT" => "Attempting",
default => $connection["state"],
@@ -598,7 +605,6 @@ if (count($parts) === 2 || count($parts) === 3) {
}
}
- document.getElementById("title-bar-action-1").style.display = "none";
window.controlling = false;
window.commandRunInterval = null;
@@ -792,14 +798,10 @@ if (count($parts) === 2 || count($parts) === 3) {
}
function enableControl() {
- document.getElementById("title-bar-action-1").style.display = "inline-block";
- document.getElementById("title-bar-action-0").style.display = "none";
window.controlling = true;
}
function disableControl() {
- document.getElementById("title-bar-action-1").style.display = "none";
- document.getElementById("title-bar-action-0").style.display = "inline-block";
window.controlling = false;
}
</script>
@@ -812,7 +814,13 @@ if (count($parts) === 2 || count($parts) === 3) {
<ul class="list-group">
<?php foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata"), function ($i) {
return !str_starts_with($i, ".");
- }) as $file): $computer = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $file), true); $id = substr($file, 0, -5); $owner = explode("-", $id)[0]; ?>
+ }) as $file): $computer = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $file), true); $id = substr($file, 0, -5); $owner = explode("-", $id)[0];
+
+ if (str_ends_with($computer["os"], "unknown")) {
+ $computer["os"] = trim(substr($computer["os"], 0, -7));
+ }
+
+ ?>
<a href="/-/computers/<?= $id ?>" class="list-group-item list-group-item-action" style="display: grid; grid-template-columns: 100px 1fr; grid-column-gap: 10px;">
<div style="display: flex; align-items: center;">
<img style="width: 100px;" src="https://ponies.equestria.horse/api/data?f=computers/screens/<?= $id . "-" . $computer["screens"][0]["id"] ?>.jpg">
@@ -821,12 +829,16 @@ if (count($parts) === 2 || count($parts) === 3) {
<div>
<b><?= $computer["host"] ?></b> · <?= $computer["os"] ?><br>
Owned by <?= $owner === "raindrops" ? "Raindrops System" : "Cloudburst System"; ?><br>
- Last seen <?= timeAgo($computer["date"]) ?>
+ <?php if (timeAgo($computer["date"]) === "now"): ?>Online<?php else: ?>Offline since <?= timeAgo($computer["date"]) ?><?php endif; ?>
</div>
</div>
</a>
<?php endforeach; ?>
</ul>
+
+ <div id="page-content" style="margin-top: 10px;">
+ <a href="https://static.equestria.horse/luna-cros.crx">Install Chrome OS extension</a>
+ </div>
</div>
<?php endif; ?>
</div>
@@ -881,4 +893,4 @@ if (count($parts) === 2 || count($parts) === 3) {
}
</style>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/debug.inc b/pages/debug.inc
index 1327af5..6d2b4c9 100644
--- a/pages/debug.inc
+++ b/pages/debug.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
function itemToName(string $item): string {
global $lang; global $pages;
@@ -114,4 +114,4 @@ function itemToName(string $item): string {
}
</style>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/docs.inc b/pages/docs.inc
index 2e43727..a94f92e 100644
--- a/pages/docs.inc
+++ b/pages/docs.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $_PROFILE;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/random.inc";
$parts = explode("/", $_GET['_']);
$select = $parts[2] ?? null;
@@ -32,7 +32,7 @@ if ($select === "add") {
}
}
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
function showDocument($item) { ?>
<div style="display: grid; grid-template-columns: 2fr repeat(3, 1fr);">
@@ -401,4 +401,4 @@ function showDocument($item) { ?>
}
</style>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/edit-private.inc b/pages/edit-private.inc
index 4d89b5c..f26c8c6 100644
--- a/pages/edit-private.inc
+++ b/pages/edit-private.inc
@@ -34,7 +34,7 @@ if ($member === null) {
peh_error("System member not found", 404);
}
- require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/edit-private.inc';
+ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/edit-private.inc';
}
exit; \ No newline at end of file
diff --git a/pages/edit.inc b/pages/edit.inc
index e074087..28b8d88 100644
--- a/pages/edit.inc
+++ b/pages/edit.inc
@@ -19,7 +19,7 @@ if ($isLowerLoggedIn && $systemID !== $app["other"]["id"]) {
}
if ($member === null) {
- require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/sysedit.inc';
+ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/sysedit.inc';
} else {
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true);
$memberData = null;
@@ -38,7 +38,7 @@ if ($member === null) {
peh_error("System member not found", 404);
}
- require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/edit.inc';
+ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/edit.inc';
}
exit; \ No newline at end of file
diff --git a/pages/emergency.inc b/pages/emergency.inc
index 0d34251..244571b 100644
--- a/pages/emergency.inc
+++ b/pages/emergency.inc
@@ -1,15 +1,15 @@
<?php
$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
<br>
<div class="container">
<div id="page-content">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/emergency.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/emergency.inc"; ?>
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/fronting.inc b/pages/fronting.inc
index a2b5cb0..6cd464b 100644
--- a/pages/fronting.inc
+++ b/pages/fronting.inc
@@ -1,15 +1,15 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
<br>
<div class="container">
<div>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/planner.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/planner.inc"; ?>
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/games.inc b/pages/games.inc
index 4df95f1..ca881e4 100644
--- a/pages/games.inc
+++ b/pages/games.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $app;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -80,4 +80,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
</ul>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/home.inc b/pages/home.inc
index 82ff3d5..86bf513 100644
--- a/pages/home.inc
+++ b/pages/home.inc
@@ -4,7 +4,7 @@ if (isset($_GET["ec"])) {
header("HTTP/1.1 " . $_GET["ec"] . " Error");
}
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnly; global $isNormallyLoggedIn; global $_PROFILE; global $lang; global $pages; global $isLowerLoggedIn; global $app; global $isLoggedIn; ?>
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly; global $isNormallyLoggedIn; global $_PROFILE; global $lang; global $pages; global $isLowerLoggedIn; global $app; global $isLoggedIn; ?>
<br>
<div class="container">
@@ -21,7 +21,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
</div>
<?php endif; ?>
- <?php global $travelling; $byColor = getMembersByColor($_SERVER['HTTP_HOST'] === "fr.equestria.horse"); ?>
+ <?php global $travelling; $byColor = getMembersByColor(); ?>
<div style="text-align: center;">
<img alt="" src="/assets/logo/newlogo<?= $isLoggedIn || $isLowerLoggedIn ? "3" : "" ?>.png" style="width:128px;">
<p style="z-index:999;position:relative;background:transparent;margin: 20px -10px 0 -20px;padding-right:30px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);">
@@ -34,15 +34,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
</div>
<div style="padding:5px 10px;background:#3332328a;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;position:relative;z-index: 999;backdrop-filter: blur(30px);">
<h2 style="margin-top: 20px;">Cold Haze</h2>
- <?php if ($_SERVER['HTTP_HOST'] === "fr.equestria.horse"): ?>
- <p><?= count($byColor) ?> poneys dans une tête</p>
- <?php else: ?>
<?php if ($isLoggedIn || $isLowerLoggedIn): ?>
<p><?= count($byColor) ?> ponies in 3 plural systems</p>
<?php else: ?>
<p><?= count($byColor) ?> <?= $lang["home"]["intro"] ?></p>
<?php endif; ?>
- <?php endif; ?>
</div>
</div>
@@ -79,4 +75,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/pages/home.old.inc b/pages/home.old.inc
index f918549..085af58 100644
--- a/pages/home.old.inc
+++ b/pages/home.old.inc
@@ -4,7 +4,7 @@ if (isset($_GET["ec"])) {
header("HTTP/1.1 " . $_GET["ec"] . " Error");
}
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnly; global $isNormallyLoggedIn; global $_PROFILE; global $lang; global $pages; global $isLowerLoggedIn; global $app; global $isLoggedIn; ?>
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly; global $isNormallyLoggedIn; global $_PROFILE; global $lang; global $pages; global $isLowerLoggedIn; global $app; global $isLoggedIn; ?>
<br>
<div class="container">
@@ -21,7 +21,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
</div>
<?php endif; ?>
- <?php global $travelling; $byColor = getMembersByColor($_SERVER['HTTP_HOST'] === "fr.equestria.horse"); ?>
+ <?php global $travelling; $byColor = getMembersByColor(); ?>
<div style="text-align: center;">
<img alt="" src="/assets/logo/newlogo<?= $isLoggedIn || $isLowerLoggedIn ? "3" : "" ?>.png" style="width:128px;">
<p style="z-index:999;position:relative;background:transparent;margin: 20px -10px 0 -20px;padding-right:30px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);">
@@ -34,15 +34,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
</div>
<div style="padding:5px 10px;background:#3332328a;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;position:relative;z-index: 999;backdrop-filter: blur(30px);">
<h2 style="margin-top: 20px;">Cold Haze</h2>
- <?php if ($_SERVER['HTTP_HOST'] === "fr.equestria.horse"): ?>
- <p><?= count($byColor) ?> poneys dans une tête</p>
- <?php else: ?>
<?php if ($isLoggedIn || $isLowerLoggedIn): ?>
<p><?= count($byColor) ?> ponies in 3 plural systems</p>
<?php else: ?>
<p><?= count($byColor) ?> <?= $lang["home"]["intro"] ?></p>
<?php endif; ?>
- <?php endif; ?>
</div>
</div>
<hr style="border-color:rgba(255, 255, 255, .25);">
@@ -80,4 +76,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; require_once $_SE
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/pages/login.inc b/pages/login.inc
index 8d71574..313be91 100644
--- a/pages/login.inc
+++ b/pages/login.inc
@@ -1,9 +1,25 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnly; global $isNormallyLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly; global $isNormallyLoggedIn;
+if (isset($_GET["return"])) {
+ setcookie("PEH2_RETURN_PAGE", $_GET["return"], 0, "/");
+}
+
+
+if (isset($_GET["mini"])) {
?>
+<style>
+ #navigation-pane, #title-bar, #footer, #titlebar-separator, #mobile-navigation, #global-search-container {
+ display: none !important;
+ }
+
+ body {
+ margin-left: 0 !important;
+ }
+</style>
+<?php } ?>
<br>
<div class="container">
@@ -36,4 +52,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnl
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/metadata.inc b/pages/metadata.inc
index 9faefef..768f548 100644
--- a/pages/metadata.inc
+++ b/pages/metadata.inc
@@ -1,8 +1,8 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLowerLoggedIn; global $isLoggedIn; global $lang; global $pages; global $app;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
if (!isset($_GET['_']) || trim($_GET['_']) === "") peh_error("Invalid request", 400);
@@ -177,7 +177,7 @@ if ($member === null) {
header("Location: /" . $_GET['_']);
} else {
- require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/metadata.inc';
+ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/metadata.inc';
}
}
diff --git a/pages/money.inc b/pages/money.inc
index 257b87f..7571507 100644
--- a/pages/money.inc
+++ b/pages/money.inc
@@ -13,7 +13,7 @@ $accounts = array_map(function ($i) {
return $data;
}, array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/money"), function ($i) { return !str_starts_with($i, "."); })));
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
function calculateFullAmount($account, $asNumber = false, $gbpOnly = false): string|float|int {
global $rate;
@@ -118,7 +118,7 @@ if ((isset($_GET["create"]) || isset($_GET["delete"])) && isset($parts[2])) {
$rate = (float)trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/exchange.txt"));
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -678,4 +678,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
<?php endif; ?>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/page.inc b/pages/page.inc
index d35dba8..8446062 100644
--- a/pages/page.inc
+++ b/pages/page.inc
@@ -49,8 +49,8 @@ $systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slu
if ($member === null) {
global $_SystemName;
$_SystemName = $system;
- $pageFile = $_SERVER['DOCUMENT_ROOT'] . '/includes/system.inc';
- require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system.inc';
+ $pageFile = $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/system.inc';
+ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/system.inc';
} else if ($member === "-" && isset($parts[2])) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc')) {
global $_SystemPage;
@@ -112,8 +112,8 @@ if ($member === null) {
global $_MemberName;
$_MemberName = $member;
- $pageFile = $_SERVER['DOCUMENT_ROOT'] . '/includes/member.inc';
- require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member.inc';
+ $pageFile = $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/member.inc';
+ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/fragments/member.inc';
}
exit; \ No newline at end of file
diff --git a/pages/ponytown.inc b/pages/ponytown.inc
index d055c9c..7ad38f7 100644
--- a/pages/ponytown.inc
+++ b/pages/ponytown.inc
@@ -23,7 +23,7 @@ if ($isLowerLoggedIn && $member["_system"] !== $app["other"]["id"]) {
$title = ($member["display_name"] ?? $member["name"]) . " · " . $title;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
$member = getMemberWithoutSystem($parts[2]);
@@ -255,4 +255,4 @@ $member = getMemberWithoutSystem($parts[2]);
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/pages/profiles.inc b/pages/profiles.inc
index dd6df4b..41e5222 100644
--- a/pages/profiles.inc
+++ b/pages/profiles.inc
@@ -1,8 +1,8 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $_PROFILE; global $isLowerLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/profiles.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/util/profiles.inc';
?>
@@ -101,4 +101,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/profiles.inc';
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/relations.inc b/pages/relations.inc
index b66ab25..7a05def 100644
--- a/pages/relations.inc
+++ b/pages/relations.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -102,4 +102,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
</style>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/rules.inc b/pages/rules.inc
index ec007df..1238b7d 100644
--- a/pages/rules.inc
+++ b/pages/rules.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/Parsedown.php"; $Parsedown = new Parsedown();
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/Parsedown.php"; $Parsedown = new Parsedown();
if (isset($_POST["updateRules"])) {
header("Content-Type: text/plain");
@@ -35,7 +35,7 @@ if (isset($_POST["updateRules"])) {
die();
}
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -134,7 +134,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
<p><b <?= $index === 1 ? 'id="default-rule--number"' : '' ?>>Rule #<?= $index ?>:</b></p>
<input <?= $index === 1 ? 'id="default-rule--name"' : '' ?> type="text" placeholder="Rule name" class="form-control" style="margin-bottom:15px;color:white;background:#111;border-color:#222;" name="payload[<?= $index - 1 ?>][name]" value="<?= str_replace('"', "&quot;", str_replace("<", "&lt;", str_replace(">", "&gt;", $rule["name"]))) ?>">
- <textarea <?= $index === 1 ? 'id="default-rule--content"' : '' ?> name="payload[<?= $index - 1 ?>][content]" rows="5" class="form-control" style="resize: none;color:white;background:#111;border-color:#222;" placeholder="Rule details"><?= str_replace("<", "&lt;", str_replace(">", "&gt;", $rule["content"] ?? "")) ?></textarea>
+ <textarea <?= $index === 1 ? 'id="default-rule--content"' : '' ?> name="payload[<?= $index - 1 ?>][content]" rows="10" class="form-control" style="resize: none;color:white;background:#111;border-color:#222;" placeholder="Rule details"><?= str_replace("<", "&lt;", str_replace(">", "&gt;", $rule["content"] ?? "")) ?></textarea>
<label style="margin-top:10px;margin-left:5px;">
<input <?= $index === 1 ? 'id="default-rule--approval-1"' : '' ?> <?= ($rule["approved"][0] ?? false) ? "checked" : "" ?> type="checkbox" class="form-check-input" name="payload[<?= $index - 1 ?>][approved][0]">
@@ -273,4 +273,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
}
</style>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/splitting.inc b/pages/splitting.inc
index 520b2c8..d1dccae 100644
--- a/pages/splitting.inc
+++ b/pages/splitting.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -52,4 +52,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
</style>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/stats.inc b/pages/stats.inc
index 1b0fe31..de501bb 100644
--- a/pages/stats.inc
+++ b/pages/stats.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
$switchesRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/switches.json"), true);
$switchesCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/switches.json"), true);
@@ -489,4 +489,4 @@ $switchesCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] .
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/terminology.inc b/pages/terminology.inc
index d94eddc..77a19de 100644
--- a/pages/terminology.inc
+++ b/pages/terminology.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
@@ -12,4 +12,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> \ No newline at end of file
diff --git a/pages/travelling.inc b/pages/travelling.inc
index e0fbfb1..fdcfa99 100644
--- a/pages/travelling.inc
+++ b/pages/travelling.inc
@@ -4,7 +4,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; gl
$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
if (isset($_GET['toggleTravel']) && $isLoggedIn) {
if (isset($travelling[$_GET['member']])) {
@@ -102,7 +102,7 @@ if (isset($_GET['toggleTravel']) && $isLoggedIn) {
die();
}
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
global $travelling;
?>
@@ -203,4 +203,4 @@ global $travelling;
</style>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
diff --git a/pages/wakeup.inc b/pages/wakeup.inc
index 9df2c3e..43fa614 100644
--- a/pages/wakeup.inc
+++ b/pages/wakeup.inc
@@ -1,15 +1,15 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
?>
<br>
<div class="container">
<div id="page-content">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/wakeup.inc"; ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/wakeup.inc"; ?>
</div>
</div>
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>