mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2024-12-28 18:36:22 +00:00
You wont belive it
This commit is contained in:
parent
8da2aff265
commit
ffa8a8e1a3
|
@ -20,7 +20,7 @@
|
||||||
max-width: 621px; width: calc(100% - 3.5rem);
|
max-width: 621px; width: calc(100% - 3.5rem);
|
||||||
max-height: 20rem; height: auto; min-height: 10rem;
|
max-height: 20rem; height: auto; min-height: 10rem;
|
||||||
|
|
||||||
position: fixed; z-index: 99999;
|
position: fixed; z-index: 999999999;
|
||||||
left: 50%; bottom: -15rem;
|
left: 50%; bottom: -15rem;
|
||||||
transform: translateX(-50%) scale(0.5);
|
transform: translateX(-50%) scale(0.5);
|
||||||
|
|
||||||
|
@ -42,10 +42,12 @@
|
||||||
display: inline;
|
display: inline;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Worlds shittest workaround to a problem I have no clue how to fix */
|
/* Worlds shittest workaround to a problem I have no clue how to fix */
|
||||||
.flyout-actionbox * {
|
.flyout-actionbox *,
|
||||||
|
.flyout-actionbox * * {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.flyout-actionbox * * {
|
.flyout-actionbox * * * {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ function flyoutShow(header, description, actionbox) {
|
||||||
// Set information in flyout
|
// Set information in flyout
|
||||||
flyoutHeader.textContent = header;
|
flyoutHeader.textContent = header;
|
||||||
flyoutDescription.textContent = description;
|
flyoutDescription.textContent = description;
|
||||||
flyoutActionbox.innerHTML = actionbox;
|
$(flyoutActionbox).html(actionbox);
|
||||||
|
|
||||||
// Show the flyout
|
// Show the flyout
|
||||||
flyoutRoot.style.display = "flex";
|
flyoutRoot.style.display = "flex";
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
<p>What Do I want this to become in the future? No clue, but I do want this to be usable by others, if its a file they download a docker image they setup on your own web server.</p>
|
<p>What Do I want this to become in the future? No clue, but I do want this to be usable by others, if its a file they download a docker image they setup on your own web server.</p>
|
||||||
<p>Will it become that any time soon? No, but. I am going to work on this untill it becomes what I want it to be!</p>
|
<p>Will it become that any time soon? No, but. I am going to work on this untill it becomes what I want it to be!</p>
|
||||||
|
|
||||||
|
<h2 class="space-top-large" id="add-this">Can you add "A" or "B"?</h2>
|
||||||
|
<p>No.</p>
|
||||||
|
|
||||||
<h2 class="space-top-large" id="guide">How do I use this!</h2>
|
<h2 class="space-top-large" id="guide">How do I use this!</h2>
|
||||||
<p>First you must obtain the invite code. If you don't have one and are interested in trying this, feel free to DM me on Telegram!</p>
|
<p>First you must obtain the invite code. If you don't have one and are interested in trying this, feel free to DM me on Telegram!</p>
|
||||||
<p>But once you're done doing that, you can start making your account <a class='link' href="https://superdupersecteteuploadtest.fluffybean.gay/account/signup.php">at the signup page here</a>.</p>
|
<p>But once you're done doing that, you can start making your account <a class='link' href="https://superdupersecteteuploadtest.fluffybean.gay/account/signup.php">at the signup page here</a>.</p>
|
||||||
|
@ -40,9 +43,6 @@
|
||||||
<p>To mrHDash...</p>
|
<p>To mrHDash...</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php include "ui/footer.php"; ?>
|
||||||
include "ui/top.html";
|
|
||||||
include "ui/footer.php";
|
|
||||||
?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -24,9 +24,9 @@ if (isset($_POST['submit'])) {
|
||||||
|
|
||||||
// Attempt to execute the prepared statement
|
// Attempt to execute the prepared statement
|
||||||
if (mysqli_stmt_execute($stmt)) {
|
if (mysqli_stmt_execute($stmt)) {
|
||||||
echo "sniffleAdd('Info','Description has been updated successfully! You may need to refresh the page to see the new information.','var(--green)')";
|
echo "sniffleAdd('Info', 'Description has been updated successfully! You may need to refresh the page to see the new information.', 'var(--green)', ".$root_dir."'assets/icons/check.svg')";
|
||||||
} else {
|
} else {
|
||||||
echo "sniffleAdd('Error','An error occured on the servers','var(--red)')";
|
echo "sniffleAdd('Error', 'An error occured on the servers', 'var(--red)', ".$root_dir."'assets/icons/check.svg')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
assets/icons/check.svg
Normal file
1
assets/icons/check.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="#e8e3e3" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"></rect><polyline points="216 72 104 184 48 128" fill="none" stroke="#e8e3e3" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>
|
After Width: | Height: | Size: 304 B |
1
assets/icons/cross.svg
Normal file
1
assets/icons/cross.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="#e8e3e3" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"></rect><line x1="200" y1="56" x2="56" y2="200" stroke="#e8e3e3" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line><line x1="200" y1="200" x2="56" y2="56" stroke="#e8e3e3" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>
|
After Width: | Height: | Size: 416 B |
|
@ -72,7 +72,7 @@ body {
|
||||||
#back-to-top {
|
#back-to-top {
|
||||||
margin: 0; padding: 0.5rem;
|
margin: 0; padding: 0.5rem;
|
||||||
|
|
||||||
position: fixed; z-index: 9999999999;
|
position: fixed; z-index: 9999999;
|
||||||
right: -2.5rem; bottom: 1rem;
|
right: -2.5rem; bottom: 1rem;
|
||||||
|
|
||||||
object-position: center;
|
object-position: center;
|
||||||
|
|
96
image.php
96
image.php
|
@ -1,13 +1,3 @@
|
||||||
<?php
|
|
||||||
function info_check($string){
|
|
||||||
if (isset($string) && !empty($string)) {
|
|
||||||
return $string;
|
|
||||||
} else {
|
|
||||||
return "No information provided.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -23,6 +13,10 @@ function info_check($string){
|
||||||
<!-- JQuery -->
|
<!-- JQuery -->
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Sniffle script! -->
|
<!-- Sniffle script! -->
|
||||||
<script src="Sniffle/sniffle.js"></script>
|
<script src="Sniffle/sniffle.js"></script>
|
||||||
<link rel='stylesheet' href='Sniffle/sniffle.css'>
|
<link rel='stylesheet' href='Sniffle/sniffle.css'>
|
||||||
|
@ -33,13 +27,25 @@ function info_check($string){
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
|-------------------------------------------------------------
|
||||||
|
| Import Required
|
||||||
|
|-------------------------------------------------------------
|
||||||
|
| These are common scripts used across all pages of the
|
||||||
|
| website. At some point I want the whole website to be only
|
||||||
|
| one index page. But that's going to require many many many
|
||||||
|
| many rewrites and hours of learning....
|
||||||
|
|-------------------------------------------------------------
|
||||||
|
*/
|
||||||
include "ui/required.php";
|
include "ui/required.php";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Get image ID
|
|-------------------------------------------------------------
|
||||||
|
| Get image ID
|
||||||
Image ID should be written in the URL of the page as ?id=69
|
|-------------------------------------------------------------
|
||||||
If ID cannot be obtained, give error. ID going here ^^
|
| Image ID should be written in the URL of the page as ?id=69
|
||||||
|
| If ID cannot be obtained, give error. ID going here ^^
|
||||||
|
|-------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
if (isset($_GET['id'])) {
|
if (isset($_GET['id'])) {
|
||||||
// Get all image info
|
// Get all image info
|
||||||
|
@ -69,18 +75,22 @@ function info_check($string){
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Get all user details
|
|-------------------------------------------------------------
|
||||||
|
| Get all user details
|
||||||
This gets the user info from the image
|
|-------------------------------------------------------------
|
||||||
|
| This gets the user info from the image
|
||||||
|
|-------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
if (isset($image['author'])) {
|
if (isset($image['author'])) {
|
||||||
$user = get_user_info($conn, $image['author']);
|
$user = get_user_info($conn, $image['author']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Check user privilge
|
|-------------------------------------------------------------
|
||||||
|
| Check user privilge
|
||||||
This requires the user to be logged in or an admin
|
|-------------------------------------------------------------
|
||||||
|
| This requires the user to be logged in or an admin
|
||||||
|
|-------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
if (image_privilage($image['author']) || is_admin($_SESSION['id'])) {
|
if (image_privilage($image['author']) || is_admin($_SESSION['id'])) {
|
||||||
$privilaged = True;
|
$privilaged = True;
|
||||||
|
@ -175,10 +185,12 @@ function info_check($string){
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
Check if user is privilaged,
|
|-------------------------------------------------------------
|
||||||
If yes, grant them access to the Danger zone, or "the place that can fuck things up"
|
| Check if user is privilaged,
|
||||||
|
|-------------------------------------------------------------
|
||||||
Checking is done prior to here
|
| If yes, grant them access to the Danger zone, or "the place that can fuck things up"
|
||||||
|
| Checking is done prior to here
|
||||||
|
|-------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
if ($privilaged) {
|
if ($privilaged) {
|
||||||
?>
|
?>
|
||||||
|
@ -186,6 +198,8 @@ function info_check($string){
|
||||||
<div class='danger-zone flex-down default-window'>
|
<div class='danger-zone flex-down default-window'>
|
||||||
<h2>Danger zone</h2>
|
<h2>Danger zone</h2>
|
||||||
|
|
||||||
|
<script id="conformationMessage"></script>
|
||||||
|
|
||||||
<!-- Delete -->
|
<!-- Delete -->
|
||||||
<button id='deleteButton' class='btn alert-low'><img class='svg' src='assets/icons/trash.svg'>Delete image</button>
|
<button id='deleteButton' class='btn alert-low'><img class='svg' src='assets/icons/trash.svg'>Delete image</button>
|
||||||
<script>
|
<script>
|
||||||
|
@ -201,27 +215,33 @@ function info_check($string){
|
||||||
|-------------------------------------------------------------
|
|-------------------------------------------------------------
|
||||||
| Edit description
|
| Edit description
|
||||||
|-------------------------------------------------------------
|
|-------------------------------------------------------------
|
||||||
|
| Most people reading through the code will probably say
|
||||||
|
| how shit it is. YOU HAVE NO FUCKING CLUE HOW LONG THIS TOOK
|
||||||
|
| ME TO FIGURE OUT. i hate js.
|
||||||
|
|-------------------------------------------------------------
|
||||||
-->
|
-->
|
||||||
<button id='descriptionButton' class='btn alert-low space-top-small'><img class='svg' src='assets/icons/edit.svg'>Edit description</button>
|
<button id='descriptionButton' class='btn alert-low space-top-small'><img class='svg' src='assets/icons/edit.svg'>Edit description</button>
|
||||||
<script>
|
<script>
|
||||||
$('#descriptionButton').click(function(){
|
$('#descriptionButton').click(function(){
|
||||||
var header = "Enter new Description/Alt";
|
var header = "Enter new Description/Alt";
|
||||||
var description = "Whatcha gonna put in there 👀";
|
var description = "Whatcha gonna put in there 👀";
|
||||||
var actionBox = "<form id='descriptionConfirm'>\
|
var actionBox = "<form id='descriptionConfirm' action='app/image/edit_description.php' method='POST'>\
|
||||||
<input id='descriptionInput' class='btn alert-default space-bottom' type='text' placeholder='Description/Alt for image'>\
|
<input id='descriptionInput' class='btn alert-default space-bottom' type='text' name='descriptionInput' placeholder='Description/Alt for image'>\
|
||||||
<button id='descriptionSubmit' class='btn alert-low' type='submit'><img class='svg' src='assets/icons/edit.svg'>Update information</button>\
|
<button id='descriptionSubmit' class='btn alert-low' type='submit' name='descriptionSubmit'><img class='svg' src='assets/icons/edit.svg'>Update information</button>\
|
||||||
</form>\
|
</form>";
|
||||||
<div id='descriptionErrorHandling'></div>";
|
|
||||||
flyoutShow(header, description, actionBox);
|
flyoutShow(header, description, actionBox);
|
||||||
});
|
|
||||||
$("#descriptionConfirm").submit(function(event) {
|
$("#descriptionConfirm").submit(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var descriptionInput = $("#descriptionInput").val();
|
var descriptionInput = $("#descriptionInput").val();
|
||||||
var descriptionSubmit = $("#descriptionSubmit").val();
|
var descriptionSubmit = $("#descriptionSubmit").val();
|
||||||
$("#descriptionErrorHandling").load("app/image/edit_description.php", {
|
$.post("app/image/edit_description.php", {
|
||||||
id: <?php echo $_GET['id']; ?>,
|
id: <?php echo $_GET['id']; ?>,
|
||||||
description: descriptionInput,
|
description: descriptionInput,
|
||||||
submit: descriptionSubmit
|
submit: descriptionSubmit
|
||||||
|
}, function(returnData) {
|
||||||
|
$("#conformationMessage").html(returnData);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue