Remove pointless error.php and fix image.php

This commit is contained in:
Michał 2022-09-21 20:39:22 +00:00
parent 2b6347da1b
commit 9187164582
5 changed files with 9 additions and 27 deletions

View file

@ -14,7 +14,7 @@ $conn_database = "gallery";
try {
$conn = @mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
} catch (Exception $e) {
header("location: error.php?e=conn");
die("Unable to connect to the database");
}
session_start();

View file

@ -361,6 +361,7 @@ nav .btn {
.fullscreen-image button:hover {
outline: #E8E3E3 0.2rem solid;
color: #E8E3E3;
cursor: pointer;
}
.image-container {
@ -419,6 +420,7 @@ nav .btn {
.preview-button:hover {
outline: #E8E3E3 0.2rem solid;
color: #E8E3E3;
cursor: pointer;
}
.image-description {

View file

@ -243,6 +243,8 @@
&:hover {
outline: $white 0.2rem solid;
color: $fg;
cursor: pointer;
}
}
}
@ -323,6 +325,8 @@
&:hover {
outline: $white 0.2rem solid;
color: $fg;
cursor: pointer;
}
}

View file

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<?php require_once __DIR__."/assets/ui/header.php"; ?>
</head>
<body>
<div></div>
<div class="error-root">
<h2>Woops...</h2>
<?php
if ($_GET["e"] == "conn") {
echo "<p>An error occured while connecting to the server. If you're an admin, check the database configuration and/or make sure the database is alive</p>";
} else {
echo "<p>An error occured! But no description was provided.</p>";
}
?>
</div>
<?php require_once __DIR__."/assets/ui/footer.php"; ?>
</body>
</html>

View file

@ -143,6 +143,7 @@
<script>
function fullScreen() {
document.querySelector(".preview-button").style.display = "none";
document.querySelector("html").style.overflow = "hidden";
document.querySelector(".fullscreen-image").style.display = "block";
document.querySelector(".fullscreen-image > img").src = "<?php echo $image_path;?>";
@ -153,6 +154,7 @@
function closeFullScreen() {
document.querySelector(".preview-button").style.display = "block";
document.querySelector("html").style.overflow = "auto";
document.querySelector(".fullscreen-image").style.opacity = 0;
setTimeout(function(){