Adding Json config

This commit is contained in:
Michał Gdula 2022-09-08 13:29:45 +00:00
parent 8713a6321a
commit b261368a9b
18 changed files with 285 additions and 519 deletions

29
app/settings/settings.php Normal file
View file

@ -0,0 +1,29 @@
<?php
/*
|-------------------------------------------------------------
| Settings (decode)
|-------------------------------------------------------------
| This is for decoding the settings Json, used throughout
| most of the website. Used for settings things such as
| the default background and accent colour
|-------------------------------------------------------------
*/
$user_import = file_get_contents("app/settings/user_settings.json");
$user_settings = json_decode($user_import, true);
foreach ($user_settings->data as $settings_list) {
foreach ($settings_list->website as $website) {
foreach ($website->database as $database) {
}
foreach ($website->debug as $debug) {
}
foreach ($website->plugins as $plugins) {
}
}
}
$database = $user_settings["website"]["database"];
$debug = $user_settings["website"]["debug"];
$plugins = $user_settings["website"]["plugins"];

View file

@ -0,0 +1,50 @@
{
"website": {
"name": "Only Legs",
"description": "A simple gallery with multiple users in mind",
"welcome_msg": [
"*internal screaming*",
"Don't forget to drink water!",
"Bruh",
"Fluffy made this!",
"maybe",
"I'm gay",
"I wish we were better strangers.",
"<span style='color:#ffff00;'>Just like Minecraft!</span>",
"If I were you, I'd run now",
"This is the part where I kill you",
"SILICA GEL \"DO NOT EAT\".",
"This was supposed to be a simple project",
"AAAAAAAAAAAAAAAAAAAA",
"Let me out",
"nice",
"I'm glad you're here",
"The weather is dry",
"Need me a man 👀",
"Gods die too.",
"Eat hotchip and lie"
],
"license":"GPL 3.0",
"database": {
"ip": "192.168.0.79",
"port": "3306",
"username": "uwu",
"password": "fennec621",
"database": "gallery"
},
"debug": {
"testing": true,
"version": "22.09.08"
}
},
"plugins": {
"sniffle": {
"location": "Sniffle/sniffle.js",
"using": true
},
"flyout": {
"location": "Flyout/flyout.js",
"using": true
}
}
}