mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-11 21:03:11 +00:00
Rewrite errors
Fix fullscreen images
This commit is contained in:
parent
a6b9ab0e5a
commit
9a7c042b52
6 changed files with 26 additions and 24 deletions
|
@ -82,6 +82,7 @@
|
|||
<input id="image" class="btn btn-neutral" type="file" placeholder="select image UwU">
|
||||
<button id="pfpSubmit" class="btn btn-primary btn-icon" type="submit"><img class="svg" src="assets/icons/upload.svg"></button>
|
||||
</form>
|
||||
<a class="btn btn-primary" href="profile.php?user=<?php echo $_SESSION['id'] ?>">Profile</a>
|
||||
<script>
|
||||
$("#pfpForm").submit(function(event) {
|
||||
event.preventDefault();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"license": "MIT",
|
||||
"version": "22.11.09",
|
||||
"version": "22.11.16",
|
||||
"branch": "main"
|
||||
}
|
|
@ -104,8 +104,7 @@ if (defined('ROOT') && $_SESSION['id'] == 1) {
|
|||
if (!empty($error_type)) {
|
||||
$results[] = array(
|
||||
'type'=>'warning',
|
||||
'message'=> 'Table "'.$table.'" is not setup correctly, the errors you see below may seem crypic,
|
||||
and thats normal because of the shit way I made this:<br><br>'.implode(", ",$error_type[$table]),
|
||||
'message'=> 'Table "'.$table.'" is not setup correctly. Please make sure you setup the table correctly. Errors found: '.count($error_type[$table]),
|
||||
'fix'=>'manual'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,12 +14,10 @@ if (defined('ROOT') && $_SESSION['id'] == 1) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (check_database($conn, 'images')) {
|
||||
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found images table</p>";
|
||||
} else {
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find images table</p>";
|
||||
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find images table, creating test table...</p>";
|
||||
|
||||
$sql = "CREATE TABLE IF NOT EXISTS images (
|
||||
id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||
|
@ -38,8 +36,7 @@ if (defined('ROOT') && $_SESSION['id'] == 1) {
|
|||
if (check_database($conn, 'users')) {
|
||||
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found users table</p>";
|
||||
} else {
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find users table</p>";
|
||||
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find users table, creating test table...</p>";
|
||||
|
||||
$sql = "CREATE TABLE IF NOT EXISTS users (
|
||||
id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||
|
@ -58,8 +55,7 @@ if (defined('ROOT') && $_SESSION['id'] == 1) {
|
|||
if (check_database($conn, 'groups')) {
|
||||
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found groups table</p>";
|
||||
} else {
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find groups table</p>";
|
||||
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find groups table, creating test table...</p>";
|
||||
|
||||
$sql = "CREATE TABLE IF NOT EXISTS groups (
|
||||
id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||
|
@ -76,8 +72,7 @@ if (defined('ROOT') && $_SESSION['id'] == 1) {
|
|||
if (check_database($conn, 'logs')) {
|
||||
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found logs table</p>";
|
||||
} else {
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find logs table</p>";
|
||||
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find logs table, creating test table...</p>";
|
||||
|
||||
$sql = "CREATE TABLE IF NOT EXISTS logs (
|
||||
id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||
|
@ -93,8 +88,7 @@ if (defined('ROOT') && $_SESSION['id'] == 1) {
|
|||
if (check_database($conn, 'bans')) {
|
||||
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found bans table</p>";
|
||||
} else {
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find bans table</p>";
|
||||
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find bans table, creating test table...</p>";
|
||||
|
||||
$sql = "CREATE TABLE IF NOT EXISTS bans (
|
||||
id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||
|
@ -112,8 +106,7 @@ if (defined('ROOT') && $_SESSION['id'] == 1) {
|
|||
if (check_database($conn, 'tokens')) {
|
||||
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found tokens table</p>";
|
||||
} else {
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find tokens table</p>";
|
||||
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
|
||||
echo "<p><span style='color: var(--warning);'>[INFO]</span> Could not find tokens table, creating test table...</p>";
|
||||
|
||||
$sql = "CREATE TABLE IF NOT EXISTS tokens (
|
||||
id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||
|
@ -129,7 +122,6 @@ if (defined('ROOT') && $_SESSION['id'] == 1) {
|
|||
if (check_database($conn, 'test')) {
|
||||
echo "<p><span style='color: var(--accent);'>[INFO]</span> Found test table</p>";
|
||||
} else {
|
||||
echo "<p><span style='color: var(--warning);'>[ERRO]</span> Could not find test table</p>";
|
||||
echo "<p><span style='color: var(--alert);'>[INFO]</span> Creating test table...</p>";
|
||||
echo "<p><span style='color: var(--warning);'>[ERRO]</span> Could not find test table, creating test table...</p>";
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
include "../conn.php";
|
||||
require_once "../conn.php";
|
||||
|
||||
if (isset($_POST['fix'])) {
|
||||
$timer_start = microtime(true);
|
||||
|
|
20
image.php
20
image.php
|
@ -75,32 +75,42 @@
|
|||
|
||||
?>
|
||||
<script>
|
||||
var fullScreenTimeout = false;
|
||||
|
||||
$('.fullscreen-image').click(function(e) {
|
||||
//if (e.target !== this) return;
|
||||
closeFullScreen();
|
||||
if (fullScreenTimeout) {
|
||||
closeFullScreen();
|
||||
}
|
||||
});
|
||||
|
||||
function fullScreen() {
|
||||
document.querySelector(".preview-button").style.display = "none";
|
||||
document.querySelector("html").style.overflow = "hidden";
|
||||
fullScreenTimeout = false;
|
||||
|
||||
document.querySelector("html").style.overflow = "hidden";
|
||||
document.querySelector(".fullscreen-image").style.display = "block";
|
||||
document.querySelector(".fullscreen-image > img").src = "<?php echo $image_path;?>";
|
||||
|
||||
setTimeout(function(){
|
||||
document.querySelector(".fullscreen-image").style.opacity = 1;
|
||||
document.querySelector(".fullscreen-image").style.transform = "translateX(-50%) translateY(-50%) scale(1)";
|
||||
}, 1);
|
||||
|
||||
setTimeout(function(){fullScreenTimeout = true;}, 500);
|
||||
}
|
||||
|
||||
function closeFullScreen() {
|
||||
document.querySelector(".preview-button").style.display = "block";
|
||||
fullScreenTimeout = false;
|
||||
|
||||
document.querySelector("html").style.overflow = "auto";
|
||||
|
||||
document.querySelector(".fullscreen-image").style.opacity = 0;
|
||||
|
||||
setTimeout(function(){
|
||||
document.querySelector(".fullscreen-image").style.display = "none";
|
||||
document.querySelector(".fullscreen-image").style.transform = "translateX(-50%) translateY(-50%) scale(0.9)";
|
||||
}, 500);
|
||||
|
||||
setTimeout(function(){fullScreenTimeout = true;}, 500);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue