mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-29 06:43:11 +00:00
Adding Json config
This commit is contained in:
parent
8713a6321a
commit
b261368a9b
18 changed files with 285 additions and 519 deletions
|
@ -1,18 +1,9 @@
|
|||
<?php
|
||||
if (is_file("index.php")) {
|
||||
$root_dir = "";
|
||||
} else {
|
||||
$root_dir = "../";
|
||||
}
|
||||
?>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php echo $setup_json['website']['name']; ?></title>
|
||||
<title><?php echo $user_settings['website']['name']; ?></title>
|
||||
|
||||
<!-- Stylesheets -->
|
||||
<link rel="stylesheet" href="<?php echo $root_dir; ?>css/main.css">
|
||||
<link rel="stylesheet" href="<?php echo $root_dir; ?>css/normalise.css">
|
||||
<link rel="stylesheet" href="css/main.css">
|
||||
|
||||
|
||||
<!-- Google Fonts -->
|
||||
|
@ -27,9 +18,9 @@ if (is_file("index.php")) {
|
|||
</script>
|
||||
|
||||
<!-- Sniffle script! -->
|
||||
<script src="<?php echo $root_dir; ?>Sniffle/sniffle.js"></script>
|
||||
<link rel='stylesheet' href='<?php echo $root_dir; ?>Sniffle/sniffle.css'>
|
||||
<script src="Sniffle/sniffle.js"></script>
|
||||
<link rel='stylesheet' href='Sniffle/sniffle.css'>
|
||||
|
||||
<!-- Flyout script! -->
|
||||
<script src="<?php echo $root_dir; ?>Flyout/flyout.js"></script>
|
||||
<link rel='stylesheet' href='<?php echo $root_dir; ?>Flyout/flyout.css'>
|
||||
<script src="Flyout/flyout.js"></script>
|
||||
<link rel='stylesheet' href='Flyout/flyout.css'>
|
||||
|
|
12
ui/nav.php
12
ui/nav.php
|
@ -1,19 +1,19 @@
|
|||
<nav class="nav-root flex-left">
|
||||
<div class="nav-name flex-left">
|
||||
<p><?php echo $setup_json['name']; ?></p>
|
||||
<p><?php echo $user_settings['website']['name']; ?></p>
|
||||
</div>
|
||||
<div class="nav-links flex-left">
|
||||
<a class='btn' href='<?php echo $root_dir; ?>index.php'><img class='svg' src='<?php echo $root_dir; ?>assets/icons/house.svg'><span class='nav-hide'>Home</span></a>
|
||||
<a class='btn' href='index.php'><img class='svg' src='assets/icons/house.svg'><span class='nav-hide'>Home</span></a>
|
||||
<hr>
|
||||
<a class='btn' href='<?php echo $root_dir; ?>search.php'><img class='svg' src='<?php echo $root_dir; ?>assets/icons/binoculars.svg'><span class='nav-hide'>Search</span></a>
|
||||
<a class='btn' href='search.php'><img class='svg' src='assets/icons/binoculars.svg'><span class='nav-hide'>Search</span></a>
|
||||
<hr>
|
||||
<?php
|
||||
if (loggedin()) {
|
||||
echo "<a class='btn' href='".$root_dir."upload.php'><img class='svg' src='".$root_dir."assets/icons/upload.svg'><span class='nav-hide'>Upload</span></a>";
|
||||
echo "<a class='btn' href='upload.php'><img class='svg' src='assets/icons/upload.svg'><span class='nav-hide'>Upload</span></a>";
|
||||
echo "<hr>";
|
||||
echo "<a class='btn' href='".$root_dir."/account.php'><img class='svg' src='".$root_dir."assets/icons/user-circle.svg'><span class='nav-hide'>".substr($_SESSION["username"], 0, 15)."</span></a>";
|
||||
echo "<a class='btn' href='account.php'><img class='svg' src='assets/icons/user-circle.svg'><span class='nav-hide'>".substr($_SESSION["username"], 0, 15)."</span></a>";
|
||||
} else {
|
||||
echo "<a class='btn' href='".$root_dir."/account.php'><img class='svg' src='".$root_dir."assets/icons/sign-in.svg'><span class='nav-hide'>Login</span></a>";
|
||||
echo "<a class='btn' href='account.php'><img class='svg' src='assets/icons/sign-in.svg'><span class='nav-hide'>Login</span></a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -1,53 +1,39 @@
|
|||
<?php
|
||||
/*
|
||||
Used for testing, do not use this in production
|
||||
User defined settings
|
||||
*/
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ERROR | E_PARSE | E_NOTICE);;
|
||||
include "app/settings/settings.php";
|
||||
|
||||
if ($debug["testing"]) {
|
||||
/*
|
||||
Used for testing, do not use this in production
|
||||
*/
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
Start session
|
||||
|
||||
This is important as most pages use the PHP session and will complain if its not possible to access.
|
||||
*/
|
||||
session_start();
|
||||
|
||||
|
||||
/*
|
||||
Check which directory user is in
|
||||
|
||||
I don't know if theres a better way of doing this? If there is please let me know
|
||||
*/
|
||||
if (is_file("index.php")) {
|
||||
$root_dir = "";
|
||||
} else {
|
||||
$root_dir = "../";
|
||||
}
|
||||
|
||||
|
||||
$import_json = file_get_contents($root_dir."default.json");
|
||||
$setup_json = json_decode($import_json, true);
|
||||
|
||||
/*
|
||||
Connect to the server
|
||||
*/
|
||||
include $root_dir."app/server/conn.php";
|
||||
include "app/server/conn.php";
|
||||
include "app/server/secrete.php";
|
||||
|
||||
/*
|
||||
Add functions
|
||||
*/
|
||||
include $root_dir."app/account/get_info.php";
|
||||
include $root_dir."app/account/is_admin.php";
|
||||
include $root_dir."app/account/login_status.php";
|
||||
include "app/account/get_info.php";
|
||||
include "app/account/is_admin.php";
|
||||
include "app/account/login_status.php";
|
||||
|
||||
include $root_dir."app/format/string_to_tags.php";
|
||||
|
||||
include $root_dir."app/image/get_image_info.php";
|
||||
include $root_dir."app/image/image_privilage.php";
|
||||
|
||||
include $root_dir."app/server/secrete.php";
|
||||
?>
|
||||
<script>
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue