mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-13 13:43:13 +00:00
Remaking file structure for easier updating
This commit is contained in:
parent
e7a2284809
commit
d897215023
17 changed files with 119 additions and 103 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
session_start();
|
||||
// Include server connection
|
||||
include dirname(__DIR__) . "/server/conn.php";
|
||||
include dirname(__DIR__) . "/conn.php";
|
||||
include dirname(__DIR__) . "/app.php";
|
||||
|
||||
use App\Account;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
session_start();
|
||||
// Include server connection
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
include dirname(__DIR__)."/conn.php";
|
||||
include dirname(__DIR__)."/app.php";
|
||||
|
||||
use App\Account;
|
||||
|
@ -36,16 +36,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(dirname(__DIR__)."/images/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/usr/images/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/usr/images/".$image_array['imagename']);
|
||||
}
|
||||
// Delete thumbnail if exitsts
|
||||
if (is_file(dirname(__DIR__)."/images/thumbnails/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/thumbnails/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/usr/images/thumbnails/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/usr/images/thumbnails/".$image_array['imagename']);
|
||||
}
|
||||
// Delete preview if exitsts
|
||||
if (is_file(dirname(__DIR__)."/images/previews/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/images/previews/".$image_array['imagename']);
|
||||
if (is_file(dirname(__DIR__)."/usr/images/previews/".$image_array['imagename'])) {
|
||||
unlink(dirname(__DIR__)."/usr/images/previews/".$image_array['imagename']);
|
||||
}
|
||||
// TP user to the homepage with a success message
|
||||
mysqli_query($conn, "INSERT INTO logs (ipaddress, action) VALUES('$user_ip','Deleted image " . $_POST['id'] . "')");
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
*/
|
||||
session_start();
|
||||
// Include server connection
|
||||
include dirname(__DIR__)."/server/conn.php";
|
||||
include dirname(__DIR__)."/conn.php";
|
||||
include dirname(__DIR__)."/app.php";
|
||||
include dirname(__DIR__)."/settings/settings.php";
|
||||
include dirname(__DIR__)."/settings.php";
|
||||
|
||||
use App\Make;
|
||||
|
||||
|
@ -21,7 +21,7 @@ if (isset($_POST['submit'])) {
|
|||
$error = 0;
|
||||
|
||||
// Root paths
|
||||
$dir = "../../images/";
|
||||
$dir = "../../usr/images/";
|
||||
$thumb_dir = $dir."thumbnails/";
|
||||
$preview_dir = $dir."previews/";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue