mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-01-29 17:28:27 +00:00
Fixing directory and required file issues
This commit is contained in:
parent
9ed36e2738
commit
1472692ed5
|
@ -2,14 +2,14 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<?php include "ui/header.php"; ?>
|
||||
<?php require_once __DIR__."/ui/header.php"; ?>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<?php
|
||||
include "ui/required.php";
|
||||
include "ui/nav.php";
|
||||
require_once __DIR__."/ui/required.php";
|
||||
require_once __DIR__."/ui/nav.php";
|
||||
?>
|
||||
|
||||
<div class="about-root">
|
||||
|
@ -53,7 +53,7 @@
|
|||
<p>To mrHDash...</p>
|
||||
</div>
|
||||
|
||||
<?php include "ui/footer.php"; ?>
|
||||
<?php require_once __DIR__."/ui/footer.php"; ?>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -2,13 +2,13 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<?php include "ui/header.php"; ?>
|
||||
<?php require_once __DIR__."/ui/header.php"; ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
include "ui/required.php";
|
||||
include "ui/nav.php";
|
||||
require_once __DIR__."/ui/required.php";
|
||||
require_once __DIR__."/ui/nav.php";
|
||||
|
||||
use App\Account;
|
||||
|
||||
|
@ -124,7 +124,7 @@
|
|||
}
|
||||
?>
|
||||
|
||||
<?php include "ui/footer.php"; ?>
|
||||
<?php require_once __DIR__."/ui/footer.php"; ?>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
// Include server connection
|
||||
include "../server/conn.php";
|
||||
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Initialize the session
|
||||
session_start();
|
||||
// Include server connection
|
||||
include "../server/conn.php";
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
/*
|
||||
|
@ -32,7 +32,7 @@ if (isset($_POST['submit'])) {
|
|||
if (empty(trim($_POST["new_password"]))) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Meep', 'Enter a new password!', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('Meep', 'Enter a new password!', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
@ -40,7 +40,7 @@ if (isset($_POST['submit'])) {
|
|||
} elseif(strlen(trim($_POST["new_password"])) < 6) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Not long enough...', 'Password, must be 6 or more characters in length uwu', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('Not long enough...', 'Password, must be 6 or more characters in length uwu', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
@ -53,7 +53,7 @@ if (isset($_POST['submit'])) {
|
|||
if (empty(trim($_POST["confirm_password"]))) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Meep', 'You must confirm the password!!!!', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('Meep', 'You must confirm the password!!!!', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
@ -63,7 +63,7 @@ if (isset($_POST['submit'])) {
|
|||
if(empty($error) && ($new_password != $confirm_password)) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('AAAA', 'Passwords do not match!!!', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('AAAA', 'Passwords do not match!!!', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
@ -89,14 +89,14 @@ if (isset($_POST['submit'])) {
|
|||
session_destroy();
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Password updated', 'Now goodbye.... you will be redirected in a moment', 'var(--green)', '../assets/icons/check.svg');
|
||||
setTimeout(function(){window.location.href = "../account/login.php";}, 2000);
|
||||
sniffleAdd('Password updated', 'Now goodbye.... you will be redirected in a moment', 'var(--green)', 'assets/icons/check.svg');
|
||||
setTimeout(function(){window.location.href = "account/login.php";}, 2000);
|
||||
</script>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Bruh', 'Something happened on our end, sowwy', 'var(--red)', '../assets/icons/cross.svg');
|
||||
sniffleAdd('Bruh', 'Something happened on our end, sowwy', 'var(--red)', 'assets/icons/cross.svg');
|
||||
flyoutClose();
|
||||
</script>
|
||||
<?php
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
session_start();
|
||||
// Include server connection
|
||||
include "../server/conn.php";
|
||||
include "../app.php";
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
include dirname(__DIR__)."/app.php";
|
||||
|
||||
use App\Account;
|
||||
use App\Image;
|
||||
|
@ -37,16 +37,16 @@ if (isset($_POST['submit_delete'])) {
|
|||
// Attempt to execute the prepared statement
|
||||
if (mysqli_stmt_execute($stmt)) {
|
||||
// See if image is in the directory
|
||||
if (is_file("../../images/".$image_array['imagename'])) {
|
||||
unlink("../../images/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/images/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/".$image_array['imagename']);
|
||||
}
|
||||
// Delete thumbnail if exitsts
|
||||
if (is_file("../../images/thumbnails/".$image_array['imagename'])) {
|
||||
unlink("../../images/thumbnails/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/images/thumbnails/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/thumbnails/".$image_array['imagename']);
|
||||
}
|
||||
// Delete preview if exitsts
|
||||
if (is_file("../../images/previews/".$image_array['imagename'])) {
|
||||
unlink("../../images/previews/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/images/previews/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/previews/".$image_array['imagename']);
|
||||
}
|
||||
// TP user to the homepage with a success message
|
||||
?>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
*/
|
||||
session_start();
|
||||
// Include server connection
|
||||
include "../server/conn.php";
|
||||
include "../app.php";
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
include dirname(__DIR__)."/app.php";
|
||||
|
||||
use App\Make;
|
||||
|
||||
|
|
|
@ -9,11 +9,6 @@ $conn_username = "uwu";
|
|||
$conn_password = "fennec621";
|
||||
$conn_database = "gallery";
|
||||
|
||||
/*
|
||||
echo $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['SCRIPT_NAME']);
|
||||
echo $_SERVER['PHP_SELF'];
|
||||
*/
|
||||
|
||||
$conn = mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
|
||||
if ($conn->connect_error) {
|
||||
?>
|
||||
|
|
|
@ -1,16 +1,4 @@
|
|||
<script>
|
||||
console.log("⣿⣿⣿⣿⣿⡿⠿⠻⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠻⠻⠟⠻⢿⣿⣿⣿⣿\n\
|
||||
⣿⣿⡟⠁⢀⣠⣤⣤⣤⣤⣄⣀⣀⣀⣹⣿⣿⣷⣄⣀⣀⣀⣀⣤⣤⣤⣤⣀⠐⢽⣿⣿⣿\n\
|
||||
⣿⣿⣿⣶⣿⡿⣛⡒⠒⠒⢒⠒⣲⠙⣿⣿⣿⣿⠟⣵⡒⢒⠒⠒⡀⣘⡻⣿⣿⣾⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣏⣞⡛⠃⠀⠀⠸⠷⢿⣧⣿⣿⣿⣿⣧⣿⣷⣛⣀⣀⣁⣛⣛⣮⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢏⣾⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢻⣿⠏⣼⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⡿⢿⣿⣿⣿⣿⣿⣿⡿⠿⠿⠿⠟⢛⣉⣴⣿⡏⣸⣿⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣧⣠⣤⣤⣤⣤⣤⣤⣶⣶⣶⣶⣿⣿⣿⣿⣿⠃⣿⣿⣿⣿⣿⣿⣿\n\
|
||||
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿");
|
||||
|
||||
console.log(". . /|/| . . . . . . .\n\
|
||||
.. /0 0 \\ . . . . . ..\n\
|
||||
(III% . \\________, . .\n\
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<?php include "ui/header.php"; ?>
|
||||
<?php require_once __DIR__."/ui/header.php"; ?>
|
||||
</head>
|
||||
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
|||
| many rewrites and hours of learning....
|
||||
|-------------------------------------------------------------
|
||||
*/
|
||||
include "ui/required.php";
|
||||
include "ui/nav.php";
|
||||
require_once __DIR__."/ui/required.php";
|
||||
require_once __DIR__."/ui/nav.php";
|
||||
|
||||
use App\Account;
|
||||
use App\Image;
|
||||
|
@ -416,7 +416,7 @@
|
|||
}
|
||||
?>
|
||||
|
||||
<?php include "ui/footer.php"; ?>
|
||||
<?php require_once __DIR__."/ui/footer.php"; ?>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -2,13 +2,13 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<?php include "ui/header.php"; ?>
|
||||
<?php require_once __DIR__."/ui/header.php"; ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
include "ui/required.php";
|
||||
include "ui/nav.php";
|
||||
require_once __DIR__."/ui/required.php";
|
||||
require_once __DIR__."/ui/nav.php";
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
@ -83,6 +83,6 @@ include "ui/nav.php";
|
|||
?>
|
||||
</div>
|
||||
|
||||
<?php include "ui/footer.php"; ?>
|
||||
<?php require_once __DIR__."/ui/footer.php"; ?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<?php include "ui/header.php"; ?>
|
||||
<?php require_once __DIR__."/ui/header.php"; ?>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<?php
|
||||
include "ui/required.php";
|
||||
include "ui/nav.php";
|
||||
require_once __DIR__."/ui/required.php";
|
||||
require_once __DIR__."/ui/nav.php";
|
||||
|
||||
use App\Account;
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<?php include "ui/footer.php"; ?>
|
||||
<?php require_once __DIR__."/ui/footer.php"; ?>
|
||||
</body>
|
||||
|
||||
</html>
|
48
search.php
48
search.php
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
/*if (isset($_GET['q']) && !empty($_GET['q'])) {
|
||||
// Make search into an array
|
||||
$search_array = explode(" ", $_GET['q']);
|
||||
|
||||
// Get images tags for comparing
|
||||
$image_tag_array = explode(" ", $image['tags']);
|
||||
|
||||
// Compare arrays
|
||||
$compare_results = array_intersect($image_tag_array, $search_array);
|
||||
if (count($compare_results) > 0) {
|
||||
// Getting thumbnail
|
||||
if (file_exists("images/thumbnails/".$image['imagename'])) {
|
||||
$image_path = "images/thumbnails/".$image['imagename'];
|
||||
} else {
|
||||
$image_path = "images/".$image['imagename'];
|
||||
}
|
||||
|
||||
// Image loading
|
||||
echo "<div class='gallery-item'>";
|
||||
echo "<a href='image.php?id=".$image['id']."'><img class='gallery-image' loading='lazy' src='".$image_path."' id='".$image['id']."'></a>";
|
||||
echo "</div>";
|
||||
}
|
||||
}*/
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<?php include "ui/header.php"; ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
include "ui/required.php";
|
||||
include "ui/nav.php";
|
||||
?>
|
||||
|
||||
<div class="search-root">
|
||||
<h2>Where did the search go!</h2>
|
||||
<p>Due to how it was implemented originally, it was hard to handle and work with. So I removed it.</p>
|
||||
<p>It'll be coming back, but since it's going to be a lot of work it'll have to be much later.</p>
|
||||
</div>
|
||||
|
||||
<?php include "ui/footer.php"; ?>
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +1,10 @@
|
|||
<footer class="flex-left around">
|
||||
<a class='link' href="https://github.com/Fluffy-Bean">
|
||||
<img class='svg' src='<?php echo $root_dir; ?>assets/icons/github-logo.svg'>
|
||||
<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="<?php echo $root_dir; ?>about.php">
|
||||
<img class='svg' src='<?php echo $root_dir; ?>assets/icons/scroll.svg'>
|
||||
<a class='link' href="about.php">
|
||||
<img class='svg' src='assets/icons/scroll.svg'>
|
||||
About
|
||||
</a>
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@ $loggedin = new Account();
|
|||
<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>
|
||||
<hr>
|
||||
<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->is_loggedin()) {
|
||||
?>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
User defined settings
|
||||
*/
|
||||
include "app/settings/settings.php";
|
||||
require_once dirname(__DIR__)."/app/settings/settings.php";
|
||||
|
||||
/*if ($debug["testing"]) {
|
||||
// Used for testing, do not use this in production
|
||||
|
@ -36,13 +36,13 @@ if (is_file("index.php")) {
|
|||
/*
|
||||
Connect to the server
|
||||
*/
|
||||
include "app/server/conn.php";
|
||||
include "app/server/secrete.php";
|
||||
require_once dirname(__DIR__)."/app/server/conn.php";
|
||||
require_once dirname(__DIR__)."/app/server/secrete.php";
|
||||
|
||||
/*
|
||||
Classes
|
||||
*/
|
||||
require_once 'app/app.php';
|
||||
require_once dirname(__DIR__)."/app/app.php";
|
||||
|
||||
?>
|
||||
<script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<?php include "ui/header.php"; ?>
|
||||
<?php require_once __DIR__."/ui/header.php"; ?>
|
||||
|
||||
<!-- Upload Script -->
|
||||
<script>
|
||||
|
@ -55,8 +55,8 @@
|
|||
|
||||
<body>
|
||||
<?php
|
||||
include "ui/required.php";
|
||||
include "ui/nav.php";
|
||||
require_once __DIR__."/ui/required.php";
|
||||
require_once __DIR__."/ui/nav.php";
|
||||
|
||||
use App\Account;
|
||||
$user_info = new Account();
|
||||
|
@ -84,7 +84,7 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<?php include "ui/footer.php"; ?>
|
||||
<?php require_once __DIR__."/ui/footer.php"; ?>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue