diff --git a/app/image/edit_tags.php b/app/image/edit_tags.php index b3298bf..d18bc2e 100644 --- a/app/image/edit_tags.php +++ b/app/image/edit_tags.php @@ -1,19 +1,3 @@ -/* - Tags Confirm -*/ -if (isset($_POST['tags_confirm']) && $privilaged) { - // Unset all the variables, needed by flyout - unset($header, $content, $action); - - - - - header("Location:image.php?id=".$image["id"]."&update=success"); - } else { - header("Location:image.php?id=".$image["id"]."&update=error"); - } - } -} \ No newline at end of file diff --git a/css/.master.css.swp b/css/.master.css.swp deleted file mode 100644 index 2275154..0000000 Binary files a/css/.master.css.swp and /dev/null differ diff --git a/css/footer.css b/css/footer.css index 02b12af..5b03cac 100644 --- a/css/footer.css +++ b/css/footer.css @@ -6,8 +6,7 @@ footer { width: calc(100vh - 2rem)); - background-color: var(--bg); color: var(--fg); - backdrop-filter: blur(8px); + background-color: var(--bg-3); color: var(--fg); border: 0.2rem solid var(--green); /*outline: 0.5rem solid var(--bg);*/ diff --git a/css/master.css b/css/master.css index 2c51ed5..27b986d 100644 --- a/css/master.css +++ b/css/master.css @@ -28,7 +28,7 @@ --white: #E8E3E3; --shadow: 6px 6px 2px #15151588; - --rad: 2px; + --rad: 0px; --square: 33.33%; } @@ -110,8 +110,7 @@ body { width: auto; - background-color: var(--bg); - backdrop-filter: blur(8px); + background-color: var(--bg-3); /*outline: 0.5rem solid var(--bg);*/ @@ -152,8 +151,7 @@ body { .gallery-root { margin: 0 0 2rem; padding: 0.25rem; - background-color: var(--bg); color: var(--fg); - backdrop-filter: blur(8px); + background-color: var(--bg-3); color: var(--fg); border: 0.2rem solid var(--green); /*outline: 0.5rem solid var(--bg);*/ @@ -332,36 +330,6 @@ body { /* -=-=-= ALERT =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */ - -/* - Notification system - - This is the notification system used by the website. Probably a little too much for what its used for -*/ -.notify-root { - margin: 0; padding: 0; - - max-width: 621px; width: calc(100% - 2rem); - height: auto; - - top: 1rem; left: 50%; - transform: translateX(-50%); - - position: fixed; z-index: 999; -} -.notify { - margin-bottom: 1rem; padding: 0.5rem; - - width: auto; - - text-align: center; - - display: block; - - border-radius: var(--rad); - /*outline: 0.5rem solid var(--bg);*/ -} - .alert { padding: 0.69rem; @@ -447,51 +415,6 @@ a.btn { border-radius: var(--rad); } -/* - -=-=-= FLYOUT =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -*/ -/*.flyout { - margin: 0; padding: 0.5rem 0.5rem 1.5rem; - - max-width: 621px; width: calc(100% - 2.5rem + 3px); - max-height: 20rem; height: auto; min-height: 10rem; - - bottom: -20rem; left: 50%; - - transform: translateX(-50%) scale(0.8); - - position: fixed; z-index: 99999; - - overflow-y: auto; - - border: 0.2rem solid var(--green); - border-bottom: none; - border-radius: inherit inherit none none; - - word-wrap: break-word; - - transition: bottom 0.5s cubic-bezier(.19,1,.22,1), transform 0.5s cubic-bezier(.19,1,.22,1); -} - -.flyout-dim { - margin: 0; padding: 0; - - width: 100vw; height: 100vh; - - left: 0; top: 0; - - position: fixed; z-index: 99998; - - opacity: 1; - - display: none; - - background: #15151588; - backdrop-filter: blur(5px); - - transition: opacity 2s cubic-bezier(.19,1,.22,1); -}*/ - /* -=-=-= FONT SIZES =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */ diff --git a/css/nav.css b/css/nav.css index 266d562..3614ee4 100644 --- a/css/nav.css +++ b/css/nav.css @@ -6,14 +6,13 @@ nav { width: calc(100vh - 2rem)); height: 2.5rem; - position: sticky; z-index: 99; + position: static; z-index: 99; top: 1rem; align-items: center; vertical-align: middle; - background-color: var(--bg); color: var(--fg); - backdrop-filter: blur(8px); + background-color: var(--bg-3); color: var(--fg); border: 0.2rem solid var(--green); /*outline: 0.5rem solid var(--bg);*/ @@ -62,6 +61,9 @@ nav hr { position: fixed; top: auto; bottom: 0; left: 0; right: 0; + background-color: var(--bg); + backdrop-filter: blur(8px); + border: none; border-top: 3px solid var(--green); border-radius: 0; diff --git a/image.php b/image.php index 7eb15e0..d4bcc63 100644 --- a/image.php +++ b/image.php @@ -41,6 +41,8 @@ |------------------------------------------------------------- */ include "ui/required.php"; + include "ui/nav.php"; + /* |------------------------------------------------------------- @@ -50,98 +52,132 @@ | If ID cannot be obtained, give error. ID going here ^^ |------------------------------------------------------------- */ - if (isset($_GET['id'])) { + if (isset($_GET['id']) && is_numeric($_GET['id'])) { // Get all image info $image = get_image_info($conn, $_GET['id']); // Check if image is avalible if (isset($image['imagename'])) { - // Display image - $image_path = "images/".$image['imagename']; - $image_alt = $image['alt']; + $image_present = True; } else { - // ID not avalible toast - echo "

Could not find image with ID: ".$_GET['id']."

"; - - // Replacement "no image" image and description - $image_path = "assets/no_image.png"; - $image_alt = "No image could be found, sowwy"; + ?> + + No ID present

"; - - // Replacement "no image" image and description - //$image_path = "assets/no_image.png"; - //$image_alt = "No image could be found, sowwy"; + ?> + +
' src='' alt=''>
+

Description

- ".$image_alt."

"; - } else { - echo "

No description provided

"; - } - ?> +

Details

Author: ".$user['username']."

"; - } else { - echo "

Author: Deleted User

"; - } - } else { - echo "

Author: No author

"; - } + // User + echo "

Author: ".$image_author."

"; // Image ID echo "

ID: ".$image['id']."

"; // File name if (strlen($image['imagename']) > 30) { - echo "

File Name: ".trim(substr($image['imagename'], 0, 30))."...

"; + echo "

File Name: ".substr($image['imagename'], 0, 30)."...

"; } else { echo "

File Name: ".$image['imagename']."

"; } @@ -195,8 +231,8 @@ |------------------------------------------------------------- | Check if user is privilaged, |------------------------------------------------------------- - | If yes, grant them access to the Danger zone, or "the place that can fuck things up" - | Checking is done prior to here + | If yes, grant them access to the Danger zone, or "the place + | that can fuck things up" |------------------------------------------------------------- */ if ($privilaged) { @@ -338,6 +374,13 @@ } echo "
"; } + + /* + |------------------------------------------------------------- + | End of displaying all user info + |------------------------------------------------------------- + */ + } ?> diff --git a/upload.php b/upload.php index 66eee17..e4687a0 100644 --- a/upload.php +++ b/upload.php @@ -33,30 +33,41 @@ $(document).ready(function() { $("#uploadSubmit").submit(function(event) { event.preventDefault(); - // Make form - var formData = new FormData(); + // Check if image avalible + var file = $("#image").val(); + if (file != "") { + // Make form + var formData = new FormData(); - // Get image - var image_data = $("#image").prop("files")[0]; - formData.append("image", image_data); - // Get ALT - var alt = $("#alt").val(); - formData.append("alt", alt); - // Get ALT - var submit = $("#submit").val(); - formData.append("submit", submit); + // Get image + var image_data = $("#image").prop("files")[0]; + formData.append("image", image_data); + // Get ALT + var alt = $("#alt").val(); + formData.append("alt", alt); + // Get ALT + var submit = $("#submit").val(); + formData.append("submit", submit); - // Upload the information - $.ajax({ - url: 'app/image/upload_image.php', - type: 'post', - data: formData, - contentType: false, - processData: false, - success: function(response){ - $("#sniffle").html(response); - } - }); + // Upload the information + $.ajax({ + url: 'app/image/upload_image.php', + type: 'post', + data: formData, + contentType: false, + processData: false, + success: function(response){ + $("#sniffle").html(response); + } + }); + + // Empty values + $("#image").val(""); + $("#alt").val(""); + $("#submit").val(""); + } else { + sniffleAdd('Gwha!', 'Pls provide image', 'var(--red)', 'assets/icons/file-search.svg'); + } }); });