Json config file

This commit is contained in:
Michał 2022-09-20 15:47:23 +00:00
parent 7f5aab165e
commit 1d4c25af28
10 changed files with 76 additions and 150 deletions

View file

@ -13,44 +13,29 @@
?>
<div class="about-root">
<h2>What is this?</h2>
<p>This Gallery is a smol project I originally started to control the images on my main page, but quickly turned into something much bigger...</p>
<p>What Do I want this to become in the future? No clue, but I do want this to be usable by others, if its a file they download a docker image they setup on your own web server.</p>
<p>Will it become that any time soon? No, but. I am going to work on this untill it becomes what I want it to be!</p>
<h1><?php echo $user_settings['website_name']; ?></h1>
<p><?php echo $user_settings['website_description']; ?></p>
<p>Version <?php echo $user_settings['version']; ?></p>
<br>
<h2>TOS</h2>
<p><?php echo $user_settings['tos']; ?></p>
<p>This project is protected under the <?php echo $user_settings['license']; ?> license by <?php echo $user_settings['user_name']; ?></p>
<br>
<h2>Credits to development</h2>
<p>Carty: Kickstarting development and SQL/PHP development</p>
<p>Jeetix: Helping patch holes in some features</p>
<p>mrHDash, Verg, Fennec, Carty, Jeetix and everyone else for helping with early bug testing</p>
<p><a class='link' href="https://phosphoricons.com/">Phosphor</a> for providing nice SVG icons</p>
<br>
<h2>Can you add "A" or "B"?</h2>
<p>No.</p>
<br>
<h2>How do I use this!</h2>
<p>First you must obtain the invite code. If you don't have one and are interested in trying this, feel free to DM me on Telegram!</p>
<p>But once you're done doing that, you can start making your account <a class='link' href="https://superdupersecteteuploadtest.fluffybean.gay/account/signup.php">at the signup page here</a>.</p>
<p>From there you should be able to go and login <a class='link' href="https://superdupersecteteuploadtest.fluffybean.gay/account/login.php">at this fancy page here</a>!</p>
<p>Now you should see "Welcome (your username)" at the homepage. From there navigate to the navbar and click on the upload button. Choose your file, enter the description and your image is up!</p>
<br>
<h2>Where to find me</h2>
<a class='link' href="https://gay.fluffybean.gay">
<img class='svg' src='assets/icons/link.svg'>
My website!
</a>
<a class='link' href="https://t.me/Fluffy_Bean">
<img class='svg' src='assets/icons/telegram-logo.svg'>
Telegram
</a>
<a class='link' href="https://twitter.com/fluffybeanUwU">
<img class='svg' src='assets/icons/twitter-logo.svg'>
Twitter
</a>
<h2>Credits!</h2>
<p>To Carty for being super cool again and helping me get started with SQL and PHP!</p>
<p>To <a class='link' href="https://phosphoricons.com/">Phosphor</a> for providing nice SVG icons.</p>
<p>To mrHDash...</p>
<h2>Development</h2>
<a href="https://github.com/Fluffy-Bean/image-gallery" class="link">Project Github</a>
<a href="https://twitter.com/fluffybeanUwU" class="link">Creators Twitter</a>
</div>
<?php require_once __DIR__."/ui/footer.php"; ?>

View file

@ -0,0 +1,33 @@
{
"website_name": "Only Legs",
"website_description": "A simple PHP gallery with multiple users in mind",
"tos": "When making an account and interacting with the login/signup page, you agree to have your IP logged for banning purposes.",
"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",
"The world will not be destroyed by those who do evil, but by those who watch them and do nothing."
],
"license":"GPL 3.0",
"version": "22.09.20",
"user_name": "Michal",
"is_testing": true,
"upload_max": "20"
}

View file

@ -8,22 +8,13 @@
| the default background and accent colour
|-------------------------------------------------------------
*/
$user_import = file_get_contents("app/settings/user_settings.json");
$user_import = file_get_contents(__DIR__."/manifest.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 ($user_settings->data as $website) {
foreach ($website->debug as $debug) {
}
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

@ -1,50 +0,0 @@
{
"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",
"The world will not be destroyed by those who do evil, but by those who watch them and do nothing."
],
"license":"GPL 3.0",
"database": {
"ip": "192.168.0.79:3306",
"username": "uwu",
"password": "fennec621",
"database": "gallery"
},
"debug": {
"testing": true,
"version": "22.09.12"
}
},
"plugins": {
"sniffle": {
"location": "Sniffle/sniffle.js",
"using": true
},
"flyout": {
"location": "Flyout/flyout.js",
"using": true
}
}
}

View file

@ -940,12 +940,9 @@ nav .btn {
|-------------------------------------------------------------
*/
footer {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
margin: 0 auto;
width: calc(100% - 1.4rem);
text-align: center;
}
footer p {
margin: 0 0.5rem;

View file

@ -4,12 +4,11 @@
|-------------------------------------------------------------
*/
footer {
@include flexLeft(space-around);
margin: 0 auto;
width: calc(100% - 1.4rem);
text-align: center;
p {
margin: 0 0.5rem;

View file

@ -9,13 +9,15 @@
<?php
require_once __DIR__."/ui/required.php";
require_once __DIR__."/ui/nav.php";
?>
<script>
if (params.del == "true") {
sniffleAdd("Image Deleted", "Successfully deleted image: <?php echo $_GET['id']; ?>", "var(--green)", "assets/icons/trash.svg");
if ($_GET['del']) {
?>
<script>
sniffleAdd("Image Deleted", "Successfully deleted image: <?php echo $_GET['id']; ?>", "var(--green)", "assets/icons/trash.svg");
</script>
<?php
}
</script>
?>
<div class="info-text">
<?php
@ -40,7 +42,7 @@
}
// Random welcome message
$welcome_message = $user_settings['website']['welcome_msg'];
$welcome_message = $user_settings['welcome_msg'];
echo "<p>".$welcome_message[array_rand($welcome_message, 1)]."</p>";
?>
</div>

View file

@ -1,11 +1,5 @@
<footer class="flex-left around">
<a class='link' href="https://github.com/Fluffy-Bean/image-gallery">
<img class='svg' src='assets/icons/github-logo.svg'>
Github
</a>
<a class='link' href="about.php">
<img class='svg' src='assets/icons/scroll.svg'>
About
</a>
<footer>
<p>Hosted by <?php echo $user_settings['user_name']; ?> under <?php echo $user_settings['license']; ?></p>
<p>Version <?php echo $user_settings['version']; ?></p>
<a class='link' href="about.php">About</a>
</footer>

View file

@ -6,7 +6,7 @@ $loggedin = new Account();
<nav class="nav-root flex-left">
<div class="nav-name flex-left">
<p><?php echo $user_settings['website']['name']; ?></p>
<p><?php echo $user_settings['website_name']; ?></p>
</div>
<div class="nav-links flex-left">
<a class='btn' href='index.php'><img class='svg' src='assets/icons/house.svg'><span class='nav-hide'>Home</span></a>

View file

@ -4,8 +4,10 @@
*/
require_once dirname(__DIR__)."/app/settings/settings.php";
/*if ($debug["testing"]) {
// Used for testing, do not use this in production
ini_set('post_max_size', $user_settings['upload_max']);
ini_set('upload_max_filesize', ($user_settings['upload_max'] + 1));
if ($user_settings['is_testing']) {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ERROR | E_PARSE | E_NOTICE);
@ -14,23 +16,6 @@ require_once dirname(__DIR__)."/app/settings/settings.php";
sniffleAdd('Notice', 'This website is currently in a testing state, bugs may occur', 'var(--red)', 'assets/icons/cross.svg');
</script>
<?php
}*/
ini_set('post_max_size', '20M');
ini_set('upload_max_filesize', '20M');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ERROR | E_PARSE | E_NOTICE);
?>
<script>
sniffleAdd('Notice', 'This website is currently in a testing state, bugs may occur', 'var(--red)', 'assets/icons/cross.svg');
</script>
<?php
if (is_file("index.php")) {
$root_dir = "";
} else {
$root_dir = "../";
}
/*
@ -45,16 +30,6 @@ require_once dirname(__DIR__)."/app/server/secrete.php";
require_once dirname(__DIR__)."/app/app.php";
?>
<script>
/*
Gets Querys from the URL the user is at
Used by Sniffle to display notificaions
*/
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
</script>
<!--
Used by Sniffle to add Notifications
Div can be displayed all time as it has no width or height initself