This commit is contained in:
Michał Gdula 2022-08-15 10:56:05 +00:00
parent 6a6fac8c66
commit b7362ca195
18 changed files with 776 additions and 746 deletions

0
.gitmodules vendored
View file

View file

@ -1,66 +1,66 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title> <title>Lynx Gallery</title>
<!-- Stylesheets --> <!-- Stylesheets -->
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/normalise.css"> <link rel="stylesheet" href="css/normalise.css">
<!-- Google Fonts --> <!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap">
<!-- JQuery --> <!-- JQuery -->
<script <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
src="https://code.jquery.com/jquery-3.6.0.min.js" </script>
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</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'>
<!-- Flyout script! --> <!-- Flyout script! -->
<script src="Flyout/flyout.js"></script> <script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'> <link rel='stylesheet' href='Flyout/flyout.css'>
</head> </head>
<body> <body>
<?php <?php
include "ui/required.php"; include "ui/required.php";
include "ui/nav.php"; include "ui/nav.php";
?> ?>
<div class="about-root"> <div class="about-root">
<h2 id="about">What is Fluffys Amazing Gallery?</h2> <h2 id="about">What is Fluffys Amazing Gallery?</h2>
<p>Fluffys Amazing Gallery is a smol project I originally started to control the images on my main page, but quickly turned into something much bigger...</p> <p>Fluffys Amazing Gallery is a smol project I originally started to control the images on my main page, but quickly turned into something much bigger...</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>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>
<br> <br>
<h2 class="space-top-large" id="add-this">Can you add "A" or "B"?</h2> <h2 class="space-top-large" id="add-this">Can you add "A" or "B"?</h2>
<p>No.</p> <p>No.</p>
<br> <br>
<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>
<p>From there you should be able to go and login <a class='link' href="https://superdupersecteteuploadtest.fluffybean.gay/account/login.php">at this fancy page here</a>!</p> <p>From there you should be able to go and login <a class='link' href="https://superdupersecteteuploadtest.fluffybean.gay/account/login.php">at this fancy page here</a>!</p>
<p>Now you should see "Welcome (your username)" at the homepage. From there navigate to the navbar and click on the upload button. Choose your file, enter the description and your image is up!</p> <p>Now you should see "Welcome (your username)" at the homepage. From there navigate to the navbar and click on the upload button. Choose your file, enter the description and your image is up!</p>
<br> <br>
<h2 class="space-top-large">Credits!</h2> <h2 class="space-top-large">Credits!</h2>
<p>To Carty for being super cool again and helping me get started with SQL and PHP!</p> <p>To Carty for being super cool again and helping me get started with SQL and PHP!</p>
<p>To <a class='link' href="https://phosphoricons.com/">Phosphor</a> for providing nice SVG icons.</p> <p>To <a class='link' href="https://phosphoricons.com/">Phosphor</a> for providing nice SVG icons.</p>
<p>To mrHDash...</p> <p>To mrHDash...</p>
</div> </div>
<?php include "ui/footer.php"; ?> <?php include "ui/footer.php"; ?>
</body> </body>
</html>
</html>

View file

@ -1,79 +1,79 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title> <title>Lynx Gallery</title>
<!-- Stylesheets --> <!-- Stylesheets -->
<link rel="stylesheet" href="../css/main.css"> <link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/normalise.css"> <link rel="stylesheet" href="../css/normalise.css">
<!-- Google Fonts --> <!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap">
<!-- JQuery --> <!-- JQuery -->
<script <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
src="https://code.jquery.com/jquery-3.6.0.min.js" </script>
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</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'>
<!-- Flyout script! --> <!-- Flyout script! -->
<script src="../Flyout/flyout.js"></script> <script src="../Flyout/flyout.js"></script>
<link rel='stylesheet' href='../Flyout/flyout.css'> <link rel='stylesheet' href='../Flyout/flyout.css'>
</head> </head>
<body> <body>
<?php <?php
include "../ui/required.php"; include "../ui/required.php";
include "../ui/nav.php"; include "../ui/nav.php";
?> ?>
<div class="account-root"> <div class="account-root">
<h2>Account settings</h2> <h2>Account settings</h2>
<?php <?php
if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) { if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
echo "<br>"; echo "<br>";
if ($_SESSION["id"] == 1) { if ($_SESSION["id"] == 1) {
echo "<h3>Invite Codes</h3>"; echo "<h3>Invite Codes</h3>";
$token_request = mysqli_query($conn, "SELECT * FROM tokens WHERE used = 0"); $token_request = mysqli_query($conn, "SELECT * FROM tokens WHERE used = 0");
while ($token = mysqli_fetch_array($token_request)) { while ($token = mysqli_fetch_array($token_request)) {
?> ?>
<!-- Button that's displayed with the invite code --> <!-- Button that's displayed with the invite code -->
<button onclick='copyCode()' class='btn btn-neutral'><?php echo $token['code']; ?></button> <button onclick='copyCode()' class='btn btn-neutral'><?php echo $token['code']; ?></button>
<!-- Copy code on click --> <!-- Copy code on click -->
<script> <script>
function copyCode() { function copyCode() {
navigator.clipboard.writeText("<?php echo $token['code']; ?>"); navigator.clipboard.writeText("<?php echo $token['code']; ?>");
sniffleAdd("Info", "Invite code has been copied!", "var(--green)", "<?php echo $root_dir; ?>assets/icons/clipboard-text.svg"); sniffleAdd("Info", "Invite code has been copied!", "var(--green)", "<?php echo $root_dir; ?>assets/icons/clipboard-text.svg");
} }
</script> </script>
<?php <?php
} }
} }
?> ?>
<br> <br>
<h3 class='space-top'>Danger ahead</h3> <h3 class='space-top'>Danger ahead</h3>
<p>Resetting your password regularly is a good way of keeping your account safe</p> <p>Resetting your password regularly is a good way of keeping your account safe</p>
<a class='btn btn-bad' href='https://superdupersecteteuploadtest.fluffybean.gay/account/password-reset.php'><img class='svg' src='../assets/icons/password.svg'>Reset Password</a> <a class='btn btn-bad' href='https://superdupersecteteuploadtest.fluffybean.gay/account/password-reset.php'><img class='svg' src='../assets/icons/password.svg'>Reset Password</a>
<br> <br>
<p>Don't leave! I'm with the science team!</p> <p>Don't leave! I'm with the science team!</p>
<a class='btn btn-bad' href='https://superdupersecteteuploadtest.fluffybean.gay/account/logout.php'><img class='svg' src='../assets/icons/sign-out.svg'>Logout</a> <a class='btn btn-bad' href='https://superdupersecteteuploadtest.fluffybean.gay/account/logout.php'><img class='svg' src='../assets/icons/sign-out.svg'>Logout</a>
<?php <?php
} else { } else {
?> ?>
<p>You must be logged in to change your account settings!</p> <p>You must be logged in to change your account settings!</p>
<a class='btn btn-good' href='https://superdupersecteteuploadtest.fluffybean.gay/account/login.php'>Login!</a> <a class='btn btn-good' href='https://superdupersecteteuploadtest.fluffybean.gay/account/login.php'>Login!</a>
<?php <?php
} }
?> ?>
</div> </div>
<?php include "../ui/footer.php"; ?> <?php include "../ui/footer.php"; ?>
</body> </body>
</html>
</html>

View file

@ -1,75 +1,75 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title> <title>Lynx Gallery</title>
<!-- Stylesheets --> <!-- Stylesheets -->
<link rel="stylesheet" href="../css/main.css"> <link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/normalise.css"> <link rel="stylesheet" href="../css/normalise.css">
<!-- Google Fonts --> <!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap">
<!-- JQuery --> <!-- JQuery -->
<script <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
src="https://code.jquery.com/jquery-3.6.0.min.js" </script>
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</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'>
<!-- Flyout script! --> <!-- Flyout script! -->
<script src="../Flyout/flyout.js"></script> <script src="../Flyout/flyout.js"></script>
<link rel='stylesheet' href='../Flyout/flyout.css'> <link rel='stylesheet' href='../Flyout/flyout.css'>
</head> </head>
<body> <body>
<?php <?php
include "../ui/required.php"; include "../ui/required.php";
include "../ui/nav.php"; include "../ui/nav.php";
// Check if the user is already logged in, if yes then redirect him to welcome page // Check if the user is already logged in, if yes then redirect him to welcome page
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){ if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
?> ?>
<script> <script>
sniffleAdd('Whatcha doing here?', 'You are already logged in! No need to try again', 'var(--black)', '<?php echo $root_dir; ?>assets/icons/warning.svg'); sniffleAdd('Whatcha doing here?', 'You are already logged in! No need to try again', 'var(--black)', '<?php echo $root_dir; ?>assets/icons/warning.svg');
</script> </script>
<?php <?php
} }
?> ?>
<div class="login-root"> <div class="login-root">
<h2>Login</h2> <h2>Login</h2>
<p>Passwords are important to keep safe. Don't tell anyone your password, not even Fluffy!</p> <p>Passwords are important to keep safe. Don't tell anyone your password, not even Fluffy!</p>
<br> <br>
<form id="loginForm" method="POST" enctype="multipart/form-data"> <form id="loginForm" method="POST" enctype="multipart/form-data">
<input id="loginUsername" class="btn btn-neutral" type="text" name="username" placeholder="Username"> <input id="loginUsername" class="btn btn-neutral" type="text" name="username" placeholder="Username">
<input id="loginPassword" class="btn btn-neutral" type="password" name="password" placeholder="Password"> <input id="loginPassword" class="btn btn-neutral" type="password" name="password" placeholder="Password">
<br> <br>
<button id="loginSubmit" class="btn btn-good" type="submit" name="login"><img class="svg" src="../assets/icons/sign-in.svg">Login</button> <button id="loginSubmit" class="btn btn-good" type="submit" name="login"><img class="svg" src="../assets/icons/sign-in.svg">Login</button>
</form> </form>
<a class='btn btn-neutral' href='https://superdupersecteteuploadtest.fluffybean.gay/account/signup.php'><img class="svg" src="../assets/icons/sign-in.svg">Need an account? Sign up!</a> <a class='btn btn-neutral' href='https://superdupersecteteuploadtest.fluffybean.gay/account/signup.php'><img class="svg" src="../assets/icons/sign-in.svg">Need an account? Sign up!</a>
</div> </div>
<script> <script>
$("#loginForm").submit(function(event) { $("#loginForm").submit(function(event) {
event.preventDefault(); event.preventDefault();
var username = $("#loginUsername").val(); var username = $("#loginUsername").val();
var password = $("#loginPassword").val(); var password = $("#loginPassword").val();
var submit = $("#loginSubmit").val(); var submit = $("#loginSubmit").val();
$("#sniffle").load("../app/account/login.php", { $("#sniffle").load("../app/account/login.php", {
username: username, username: username,
password: password, password: password,
submit: submit submit: submit
}); });
}); });
</script> </script>
<?php include "../ui/footer.php"; ?> <?php include "../ui/footer.php"; ?>
</body> </body>
</html>
</html>

View file

@ -1,71 +1,71 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title> <title>Lynx Gallery</title>
<!-- Stylesheets --> <!-- Stylesheets -->
<link rel="stylesheet" href="../css/main.css"> <link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/normalise.css"> <link rel="stylesheet" href="../css/normalise.css">
<!-- Google Fonts --> <!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap">
<!-- JQuery --> <!-- JQuery -->
<script <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
src="https://code.jquery.com/jquery-3.6.0.min.js" </script>
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</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'>
<!-- Flyout script! --> <!-- Flyout script! -->
<script src="../Flyout/flyout.js"></script> <script src="../Flyout/flyout.js"></script>
<link rel='stylesheet' href='../Flyout/flyout.css'> <link rel='stylesheet' href='../Flyout/flyout.css'>
</head> </head>
<body> <body>
<?php <?php
include "../ui/required.php"; include "../ui/required.php";
include "../ui/nav.php"; include "../ui/nav.php";
// Check if the user is logged in, otherwise redirect to login page // Check if the user is logged in, otherwise redirect to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){ if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true) {
header("location: https://superdupersecteteuploadtest.fluffybean.gay/account/login.php"); header("location: https://superdupersecteteuploadtest.fluffybean.gay/account/login.php");
exit; exit;
} }
?> ?>
<div class="password-reset-root"> <div class="password-reset-root">
<h2>Reset Password</h2> <h2>Reset Password</h2>
<p>After reset, you will be kicked out to login again</p> <p>After reset, you will be kicked out to login again</p>
<br> <br>
<form id="passwordForm" method="POST" enctype="multipart/form-data"> <form id="passwordForm" method="POST" enctype="multipart/form-data">
<input id="newPassword" class="btn btn-neutral" type="password" name="new_password" placeholder="New Password"> <input id="newPassword" class="btn btn-neutral" type="password" name="new_password" placeholder="New Password">
<input id="confirmSassword" class="btn btn-neutral" type="password" name="confirm_password" placeholder="Confirm Password"> <input id="confirmSassword" class="btn btn-neutral" type="password" name="confirm_password" placeholder="Confirm Password">
<br> <br>
<button id="passwordSubmit" class="btn btn-bad" type="submit" name="reset"><img class="svg" src="../assets/icons/sign-in.svg">Reset</button> <button id="passwordSubmit" class="btn btn-bad" type="submit" name="reset"><img class="svg" src="../assets/icons/sign-in.svg">Reset</button>
</form> </form>
</div> </div>
<script> <script>
$("#passwordForm").submit(function(event) { $("#passwordForm").submit(function(event) {
event.preventDefault(); event.preventDefault();
var new_passowrd = $("#newPassword").val(); var new_passowrd = $("#newPassword").val();
var confirm_password = $("#confirmSassword").val(); var confirm_password = $("#confirmSassword").val();
var submit = $("#passwordSubmit").val(); var submit = $("#passwordSubmit").val();
$("#sniffle").load("../app/account/password_reset.php", { $("#sniffle").load("../app/account/password_reset.php", {
new_passowrd: new_passowrd, new_passowrd: new_passowrd,
confirm_password: confirm_password, confirm_password: confirm_password,
submit: submit submit: submit
}); });
}); });
</script> </script>
<?php include "../ui/footer.php"; ?> <?php include "../ui/footer.php"; ?>
</body> </body>
</html>
</html>

View file

@ -1,73 +1,73 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title> <title>Lynx Gallery</title>
<!-- Stylesheets --> <!-- Stylesheets -->
<link rel="stylesheet" href="../css/main.css"> <link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/normalise.css"> <link rel="stylesheet" href="../css/normalise.css">
<!-- Google Fonts --> <!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap">
<!-- JQuery --> <!-- JQuery -->
<script <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
src="https://code.jquery.com/jquery-3.6.0.min.js" </script>
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</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'>
<!-- Flyout script! --> <!-- Flyout script! -->
<script src="../Flyout/flyout.js"></script> <script src="../Flyout/flyout.js"></script>
<link rel='stylesheet' href='../Flyout/flyout.css'> <link rel='stylesheet' href='../Flyout/flyout.css'>
</head> </head>
<body> <body>
<?php <?php
include "../ui/required.php"; include "../ui/required.php";
include "../ui/nav.php"; include "../ui/nav.php";
?> ?>
<div class="signup-root"> <div class="signup-root">
<h2>Make account</h2> <h2>Make account</h2>
<p>And amazing things happened here...</p> <p>And amazing things happened here...</p>
<br> <br>
<form id="signupForm" method="POST" action="signup.php" enctype="multipart/form-data"> <form id="signupForm" method="POST" action="signup.php" enctype="multipart/form-data">
<input id="signupUsername" class="btn btn-neutral" type="text" name="username" placeholder="Username"> <input id="signupUsername" class="btn btn-neutral" type="text" name="username" placeholder="Username">
<br> <br>
<input id="signupPassword" class="btn btn-neutral" type="password" name="password" placeholder="Password"> <input id="signupPassword" class="btn btn-neutral" type="password" name="password" placeholder="Password">
<input id="signupPasswordConfirm" class="btn btn-neutral" type="password" name="confirm_password" placeholder="Re-enter Password"> <input id="signupPasswordConfirm" class="btn btn-neutral" type="password" name="confirm_password" placeholder="Re-enter Password">
<br> <br>
<input id="signupToken" class="btn btn-neutral" type="text" name="token" placeholder="Invite Code"> <input id="signupToken" class="btn btn-neutral" type="text" name="token" placeholder="Invite Code">
<br> <br>
<button id="signupSubmit" class="btn btn-good" type="submit" name="signup"><img class="svg" src="../assets/icons/sign-in.svg">Sign Up</button> <button id="signupSubmit" class="btn btn-good" type="submit" name="signup"><img class="svg" src="../assets/icons/sign-in.svg">Sign Up</button>
</form> </form>
</div> </div>
<script> <script>
$("#signupForm").submit(function(event) { $("#signupForm").submit(function(event) {
event.preventDefault(); event.preventDefault();
var username = $("#signupUsername").val(); var username = $("#signupUsername").val();
var password = $("#signupPassword").val(); var password = $("#signupPassword").val();
var confirm_password = $("#signupPasswordConfirm").val(); var confirm_password = $("#signupPasswordConfirm").val();
var token = $("#signupToken").val(); var token = $("#signupToken").val();
var submit = $("#signupSubmit").val(); var submit = $("#signupSubmit").val();
$("#sniffle").load("../app/account/signup.php", { $("#sniffle").load("../app/account/signup.php", {
username: username, username: username,
password: password, password: password,
confirm_password: confirm_password, confirm_password: confirm_password,
token: token, token: token,
submit: submit submit: submit
}); });
}); });
</script> </script>
<?php include "../ui/footer.php"; ?> <?php include "../ui/footer.php"; ?>
</body> </body>
</html>
</html>

View file

@ -81,7 +81,7 @@ if (isset($_POST['submit'])) {
?> ?>
<script> <script>
sniffleAdd('O hi <?php echo $_SESSION["username"]; ?>', 'You are now logged in! You will be redirected in a few seconds', 'var(--green)', '../assets/icons/hand-waving.svg'); sniffleAdd('O hi <?php echo $_SESSION["username"]; ?>', 'You are now logged in! You will be redirected in a few seconds', 'var(--green)', '../assets/icons/hand-waving.svg');
setTimeout(function(){window.location.href = "../index.php?login=success";}, 4000); setTimeout(function(){window.location.href = "../index.php?login=success";}, 2000);
</script> </script>
<?php <?php
} else { } else {

View file

@ -210,7 +210,7 @@ if (isset($_POST['submit'])) {
?> ?>
<script> <script>
sniffleAdd('Success!', 'You account made for <?php echo $username; ?>!!!!! You will be redirected in a moment to login', 'var(--green)', '../assets/icons/hand-waving.svg'); sniffleAdd('Success!', 'You account made for <?php echo $username; ?>!!!!! You will be redirected in a moment to login', 'var(--green)', '../assets/icons/hand-waving.svg');
setTimeout(function(){window.location.href = "../account/login.php";}, 4000); setTimeout(function(){window.location.href = "../account/login.php";}, 2000);
</script> </script>
<?php <?php
} else { } else {

View file

@ -218,7 +218,7 @@ nav .btn {
} }
.nsfw-blur { .nsfw-blur {
filter: blur(10px); filter: blur(8px);
} }
.nsfw-warning { .nsfw-warning {
@ -236,21 +236,24 @@ nav .btn {
align-items: center; align-items: center;
text-decoration: none; text-decoration: none;
font-family: "Secular One", sans-serif; font-family: "Secular One", sans-serif;
background-color: rgba(21, 21, 21, 0.7333333333);
} }
.nsfw-warning span { .nsfw-warning span {
color: #B66467; color: #B66467;
text-align: center; text-align: center;
text-shadow: 0 0 2px #151515; }
.nsfw-warning span::after {
content: " Content";
} }
.nsfw-warning img { .nsfw-warning img {
margin: 0.25rem; margin: 0.25rem;
width: 2rem; width: 2.5rem;
height: 2rem; height: 2.5rem;
} }
@media (max-width: 500px) { @media (max-width: 500px) {
.nsfw-warning span { .nsfw-warning span::after {
display: none; content: none;
} }
} }
/* /*
@ -675,9 +678,16 @@ footer > * {
margin-top: 0; margin-top: 0;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
footer a { footer p {
margin: 0.5rem; margin: 0 0.5rem;
text-decoration: none; text-decoration: none;
font-size: 16px;
font-family: "Secular One", sans-serif;
}
footer a {
margin: 0 0.5rem;
text-decoration: none;
font-size: 16px;
font-family: "Secular One", sans-serif; font-family: "Secular One", sans-serif;
} }
footer a:hover { footer a:hover {

View file

@ -96,8 +96,9 @@
} }
.nsfw-blur { .nsfw-blur {
filter: blur(10px); filter: blur(8px);
} }
.nsfw-warning { .nsfw-warning {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -106,38 +107,46 @@
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
position: absolute; position: absolute;
z-index: 5; z-index: 5;
display: flex; flex-direction: column; display: flex;
flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
text-decoration: none; text-decoration: none;
font-family: $font-body; font-family: $font-body;
background-color: $bg-alt;
span { span {
color: $red; color: $red;
text-align: center; text-align: center;
text-shadow: 0 0 2px $black;
&::after {
content: ' Content';
}
} }
img { img {
margin: 0.25rem; margin: 0.25rem;
width: 2rem; width: 2.5rem;
height: 2rem; height: 2.5rem;
} }
} }
@media (max-width: 500px) { @media (max-width: 500px) {
.nsfw-warning { .nsfw-warning {
span { span::after {
display: none; content: none;
} }
} }
} }
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| IMAGE | IMAGE
@ -213,6 +222,7 @@
border-radius: $rad; border-radius: $rad;
font-family: $font-body; font-family: $font-body;
&::before { &::before {
content: '# '; content: '# ';
} }

View file

@ -13,10 +13,20 @@ footer {
width: calc(100% - 1.4rem); width: calc(100% - 1.4rem);
a { p {
margin: 0.5rem; margin: 0 0.5rem;
text-decoration: none; text-decoration: none;
font-size: 16px;
font-family: $font-body;
}
a {
margin: 0 0.5rem;
text-decoration: none;
font-size: 16px;
font-family: $font-body; font-family: $font-body;

694
image.php
View file

@ -1,394 +1,394 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title> <title>Lynx Gallery</title>
<!-- Stylesheets --> <!-- Stylesheets -->
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/normalise.css"> <link rel="stylesheet" href="css/normalise.css">
<!-- Google Fonts --> <!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap">
<!-- JQuery --> <!-- JQuery -->
<script <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
src="https://code.jquery.com/jquery-3.6.0.min.js" </script>
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</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'>
<!-- Flyout script! --> <!-- Flyout script! -->
<script src="Flyout/flyout.js"></script> <script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'> <link rel='stylesheet' href='Flyout/flyout.css'>
</head> </head>
<body> <body>
<?php <?php
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Import Required | Import Required
|------------------------------------------------------------- |-------------------------------------------------------------
| These are common scripts used across all pages of the | These are common scripts used across all pages of the
| website. At some point I want the whole website to be only | website. At some point I want the whole website to be only
| one index page. But that's going to require many many many | one index page. But that's going to require many many many
| many rewrites and hours of learning.... | many rewrites and hours of learning....
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
include "ui/required.php"; include "ui/required.php";
include "ui/nav.php"; include "ui/nav.php";
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Get image ID | Get image ID
|------------------------------------------------------------- |-------------------------------------------------------------
| Image ID should be written in the URL of the page as ?id=69 | 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 ID cannot be obtained, give error. ID going here ^^
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
if (isset($_GET['id']) && is_numeric($_GET['id'])) { if (isset($_GET['id']) && is_numeric($_GET['id'])) {
// Get all image info // Get all image info
$image = get_image_info($conn, $_GET['id']); $image = get_image_info($conn, $_GET['id']);
// Check if image is avalible // Check if image is avalible
if (isset($image['imagename'])) { if (isset($image['imagename'])) {
$image_present = True; $image_present = True;
} else { } else {
?> ?>
<script> <script>
sniffleAdd('Woops', 'Something happened, either image with the ID <?php echo $_GET['id']; ?> was deleted or never existed, either way it could not be found!', 'var(--red)', '<?php echo $root_dir; ?>assets/icons/cross.svg'); sniffleAdd('Woops', 'Something happened, either image with the ID <?php echo $_GET['id']; ?> was deleted or never existed, either way it could not be found!', 'var(--red)', '<?php echo $root_dir; ?>assets/icons/cross.svg');
</script> </script>
<?php <?php
$image_present = False; $image_present = False;
} }
} else { } else {
?> ?>
<script> <script>
sniffleAdd('Where is da image?', 'The link you followed seems to be broken, or there was some other error, who knows!', 'var(--red)', '<?php echo $root_dir; ?>assets/icons/cross.svg'); sniffleAdd('Where is da image?', 'The link you followed seems to be broken, or there was some other error, who knows!', 'var(--red)', '<?php echo $root_dir; ?>assets/icons/cross.svg');
</script> </script>
<?php <?php
$image_present = False; $image_present = False;
} }
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Image verification | Image verification
|------------------------------------------------------------- |-------------------------------------------------------------
| Doublechecking if all information on images exists, if yes | Doublechecking if all information on images exists, if yes
| display it, otherwise don't display at all or replace with | display it, otherwise don't display at all or replace with
| blank or filler info | blank or filler info
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
if ($image_present) { if ($image_present) {
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Check user details | Check user details
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
if (isset($image['author'])) { if (isset($image['author'])) {
// Get all information on the user // Get all information on the user
$user = get_user_info($conn, $image['author']); $user = get_user_info($conn, $image['author']);
if (isset($user['username'])) { if (isset($user['username'])) {
$image_author = $user['username']; $image_author = $user['username'];
} else { } else {
$image_author = "Deleted User"; $image_author = "Deleted User";
} }
} else { } else {
$image_author = "No author"; $image_author = "No author";
} }
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Check if image path is good | Check if image path is good
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
if (isset($image['imagename'])) { if (isset($image['imagename'])) {
$image_path = "images/".$image['imagename']; $image_path = "images/" . $image['imagename'];
$image_alt = $image['alt']; $image_alt = $image['alt'];
} else { } else {
$image_path = "assets/no_image.png"; $image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy"; $image_alt = "No image could be found, sowwy";
} }
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| If description not set or empty, replace with filler | If description not set or empty, replace with filler
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
if (!isset($image_alt) || empty($image_alt)) { if (!isset($image_alt) || empty($image_alt)) {
$image_alt = "No description avalible"; $image_alt = "No description avalible";
} }
} else { } else {
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Image was not present | Image was not present
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
$image_path = "assets/no_image.png"; $image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy"; $image_alt = "No image could be found, sowwy";
} }
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Check user privilge | Check user privilge
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
if (image_privilage($image['author']) || is_admin($_SESSION['id'])) { if (image_privilage($image['author']) || is_admin($_SESSION['id'])) {
$privilaged = True; $privilaged = True;
} else { } else {
$privilaged = False; $privilaged = False;
} }
?> ?>
<div class="image-container"> <div class="image-container">
<img class='image' id='<?php echo $image['id']; ?>' src='<?php echo $image_path; ?>' alt='<?php echo $image_alt; ?>'> <img class='image' id='<?php echo $image['id']; ?>' src='<?php echo $image_path; ?>' alt='<?php echo $image_alt; ?>'>
</div> </div>
<?php <?php
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Start of displaying all info on image | Start of displaying all info on image
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
if ($image_present) { if ($image_present) {
?> ?>
<div class="image-description default-window"> <div class="image-description default-window">
<h2>Description</h2> <h2>Description</h2>
<p><?php echo $image_alt; ?></p> <p><?php echo $image_alt; ?></p>
</div> </div>
<div class="image-detail flex-down default-window"> <div class="image-detail flex-down default-window">
<h2>Details</h2> <h2>Details</h2>
<?php <?php
// User // User
echo "<p>Author: ".$image_author."</p>"; echo "<p>Author: " . $image_author . "</p>";
// Image ID // Image ID
echo "<p>ID: ".$image['id']."</p>"; echo "<p>ID: " . $image['id'] . "</p>";
// File name // File name
if (strlen($image['imagename']) > 30) { if (strlen($image['imagename']) > 30) {
echo "<p>File Name: ".substr($image['imagename'], 0, 30)."...</p>"; echo "<p>File Name: " . substr($image['imagename'], 0, 30) . "...</p>";
} else { } else {
echo "<p>File Name: ".$image['imagename']."</p>"; echo "<p>File Name: " . $image['imagename'] . "</p>";
} }
// File extention // File extention
echo "<p>File Type: ".pathinfo($image['imagename'], PATHINFO_EXTENSION)."</p>"; echo "<p>File Type: " . pathinfo($image['imagename'], PATHINFO_EXTENSION) . "</p>";
// Image resolution // Image resolution
list($width, $height) = getimagesize($image_path); list($width, $height) = getimagesize($image_path);
echo "<p>Image resolution: ".$width."x".$height."</p>"; echo "<p>Image resolution: " . $width . "x" . $height . "</p>";
// Image Upload date // Image Upload date
echo "<p>Last updated: +0 ".$image['upload']."</p>"; echo "<p>Last updated: +0 " . $image['upload'] . "</p>";
echo "<br>"; echo "<br>";
// Image download // Image download
echo "<a class='btn btn-good' href='images/".$image['imagename']."' download='".$image['imagename']."'><img class='svg' src='assets/icons/download.svg'>Download image</a>"; echo "<a class='btn btn-good' href='images/" . $image['imagename'] . "' download='" . $image['imagename'] . "'><img class='svg' src='assets/icons/download.svg'>Download image</a>";
// Copy image // Copy image
?> ?>
<script> <script>
function copyLink() { function copyLink() {
navigator.clipboard.writeText(window.location.href); navigator.clipboard.writeText(window.location.href);
sniffleAdd("Info", "Link has been copied!", "var(--green)", "assets/icons/clipboard-text.svg"); sniffleAdd("Info", "Link has been copied!", "var(--green)", "assets/icons/clipboard-text.svg");
} }
</script> </script>
<?php <?php
echo "<button class='btn btn-good' onclick='copyLink()'><img class='svg' src='assets/icons/clipboard-text.svg'>Copy image link</button>"; echo "<button class='btn btn-good' onclick='copyLink()'><img class='svg' src='assets/icons/clipboard-text.svg'>Copy image link</button>";
?> ?>
</div> </div>
<div class="tags-root default-window"> <div class="tags-root default-window">
<h2>Tags</h2> <h2>Tags</h2>
<div class="tags"> <div class="tags">
<?php <?php
// Get image tags // Get image tags
if (isset($image['tags']) && !empty($image['tags'])) { if (isset($image['tags']) && !empty($image['tags'])) {
$image_tags_array = explode(" ", $image['tags']); $image_tags_array = explode(" ", $image['tags']);
foreach ($image_tags_array as $tag) { foreach ($image_tags_array as $tag) {
if ($tag == "nsfw") { if ($tag == "nsfw") {
echo "<p id='tag' class='tag btn-bad'>".$tag."</p>"; echo "<p id='tag' class='tag btn-bad'>" . $tag . "</p>";
} else { } else {
echo "<p id='tag' class='tag btn-good'>".$tag."</p>"; echo "<p id='tag' class='tag btn-good'>" . $tag . "</p>";
} }
} }
} else { } else {
echo "<p>No tags present</p>"; echo "<p>No tags present</p>";
} }
?> ?>
</div> </div>
</div> </div>
<?php <?php
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| Check if user is privilaged, | Check if user is privilaged,
|------------------------------------------------------------- |-------------------------------------------------------------
| If yes, grant them access to the Danger zone, or "the place | If yes, grant them access to the Danger zone, or "the place
| that can fuck things up" | that can fuck things up"
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
if ($privilaged) { if ($privilaged) {
?> ?>
<!-- Danger zone --> <!-- Danger zone -->
<div class='danger-zone flex-down default-window'> <div class='danger-zone flex-down default-window'>
<h2>Danger zone</h2> <h2>Danger zone</h2>
<!-- <!--
|------------------------------------------------------------- |-------------------------------------------------------------
| Delete | Delete
|------------------------------------------------------------- |-------------------------------------------------------------
| sus | sus
| I cannot describe the anxiety this gives me. pls help | I cannot describe the anxiety this gives me. pls help
|------------------------------------------------------------- |-------------------------------------------------------------
--> -->
<button id='deleteButton' class='btn btn-bad'><img class='svg' src='assets/icons/trash.svg'>Delete image</button> <button id='deleteButton' class='btn btn-bad'><img class='svg' src='assets/icons/trash.svg'>Delete image</button>
<script> <script>
$('#deleteButton').click(function() { $('#deleteButton').click(function() {
var header = "Are you sure?"; var header = "Are you sure?";
var description = "Deleting this image is pernament, there is no going back after this!!!!!"; var description = "Deleting this image is pernament, there is no going back after this!!!!!";
var actionBox = "<form id='deleteConfirm' method='POST'>\ var actionBox = "<form id='deleteConfirm' method='POST'>\
<button id='deleteSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/trash.svg'>Delete image</button>\ <button id='deleteSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/trash.svg'>Delete image</button>\
</form>"; </form>";
flyoutShow(header, description, actionBox); flyoutShow(header, description, actionBox);
$("#deleteConfirm").submit(function(event) { $("#deleteConfirm").submit(function(event) {
event.preventDefault(); event.preventDefault();
var deleteSubmit = $("#deleteSubmit").val(); var deleteSubmit = $("#deleteSubmit").val();
$("#sniffle").load("app/image/delete_image.php", { $("#sniffle").load("app/image/delete_image.php", {
id: <?php echo $_GET['id']; ?>, id: <?php echo $_GET['id']; ?>,
submit: deleteSubmit submit: deleteSubmit
}); });
}); });
}); });
</script> </script>
<!-- <!--
|------------------------------------------------------------- |-------------------------------------------------------------
| Edit Description | Edit Description
|------------------------------------------------------------- |-------------------------------------------------------------
| Most people reading through the code will probably say how | Most people reading through the code will probably say how
| shit it is. YOU HAVE NO FUCKING CLUE HOW LONG THIS TOOK ME | shit it is. YOU HAVE NO FUCKING CLUE HOW LONG THIS TOOK ME
| TO FIGURE OUT. i hate js. | TO FIGURE OUT. i hate js.
|------------------------------------------------------------- |-------------------------------------------------------------
--> -->
<button id='descriptionButton' class='btn btn-bad'><img class='svg' src='assets/icons/edit.svg'>Edit description</button> <button id='descriptionButton' class='btn btn-bad'><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' action='app/image/edit_description.php' method='POST'>\ var actionBox = "<form id='descriptionConfirm' action='app/image/edit_description.php' method='POST'>\
<input id='descriptionInput' class='btn btn-neutral space-bottom' type='text' placeholder='Description/Alt for image'>\ <input id='descriptionInput' class='btn btn-neutral space-bottom' type='text' placeholder='Description/Alt for image'>\
<button id='descriptionSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Update information</button>\ <button id='descriptionSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Update information</button>\
</form>"; </form>";
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();
$("#sniffle").load("app/image/edit_description.php", { $("#sniffle").load("app/image/edit_description.php", {
id: <?php echo $_GET['id']; ?>, id: <?php echo $_GET['id']; ?>,
input: descriptionInput, input: descriptionInput,
submit: descriptionSubmit submit: descriptionSubmit
}); });
}); });
}); });
</script> </script>
<!-- <!--
|------------------------------------------------------------- |-------------------------------------------------------------
| Edit Tags | Edit Tags
|------------------------------------------------------------- |-------------------------------------------------------------
| Literally no amount of work will get tags/lists to play well | Literally no amount of work will get tags/lists to play well
| with SQL so I gave up and made my own shitty system. It | with SQL so I gave up and made my own shitty system. It
| works but once I re-add the search function this will make | works but once I re-add the search function this will make
| anyone cry. I am so sorry. | anyone cry. I am so sorry.
|------------------------------------------------------------- |-------------------------------------------------------------
--> -->
<button id='tagsButton' class='btn btn-bad'><img class='svg' src='assets/icons/tag.svg'>Add image tags</button> <button id='tagsButton' class='btn btn-bad'><img class='svg' src='assets/icons/tag.svg'>Add image tags</button>
<script> <script>
$('#tagsButton').click(function() { $('#tagsButton').click(function() {
var header = "Tags"; var header = "Tags";
var description = "Add image tags here! This is still being tested so your tags may be removed later on. Tags ONLY accept, letters, numbers and underscores. Hyphens will be stitched to underscores and spaces will seperate the different tags from eachother"; var description = "Add image tags here! This is still being tested so your tags may be removed later on. Tags ONLY accept, letters, numbers and underscores. Hyphens will be stitched to underscores and spaces will seperate the different tags from eachother";
var actionBox = "<form id='tagsConfirm' action='app/image/edit_tags.php' method='POST'>\ var actionBox = "<form id='tagsConfirm' action='app/image/edit_tags.php' method='POST'>\
<input id='tagsInput' class='btn btn-neutral space-bottom' type='text' placeholder='Tags are seperated by spaces'>\ <input id='tagsInput' class='btn btn-neutral space-bottom' type='text' placeholder='Tags are seperated by spaces'>\
<button id='tagsSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Edit tags</button>\ <button id='tagsSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Edit tags</button>\
</form>"; </form>";
flyoutShow(header, description, actionBox); flyoutShow(header, description, actionBox);
$("#tagsConfirm").submit(function(event) { $("#tagsConfirm").submit(function(event) {
event.preventDefault(); event.preventDefault();
var tagsInput = $("#tagsInput").val(); var tagsInput = $("#tagsInput").val();
var tagsSubmit = $("#tagsSubmit").val(); var tagsSubmit = $("#tagsSubmit").val();
$("#sniffle").load("app/image/edit_tags.php", { $("#sniffle").load("app/image/edit_tags.php", {
id: <?php echo $_GET['id']; ?>, id: <?php echo $_GET['id']; ?>,
input: tagsInput, input: tagsInput,
submit: tagsSubmit submit: tagsSubmit
}); });
}); });
}); });
</script> </script>
<!-- <!--
|------------------------------------------------------------- |-------------------------------------------------------------
| Edit Author | Edit Author
|------------------------------------------------------------- |-------------------------------------------------------------
| You must be a super cool person to see this section ;3 | You must be a super cool person to see this section ;3
|------------------------------------------------------------- |-------------------------------------------------------------
--> -->
<?php <?php
if (is_admin($_SESSION['id'])) { if (is_admin($_SESSION['id'])) {
?> ?>
<button id='authorButton' class='btn btn-bad'><img class='svg' src='assets/icons/edit.svg'>Edit author</button> <button id='authorButton' class='btn btn-bad'><img class='svg' src='assets/icons/edit.svg'>Edit author</button>
<script> <script>
$('#authorButton').click(function() { $('#authorButton').click(function() {
var header = "Who owns the image?????"; var header = "Who owns the image?????";
var description = "Enter ID of image owner"; var description = "Enter ID of image owner";
var actionBox = "<form id='authorConfirm' action='app/image/edit_author.php' method='POST'>\ var actionBox = "<form id='authorConfirm' action='app/image/edit_author.php' method='POST'>\
<input id='authorInput' class='btn btn-neutral space-bottom' type='text' placeholder='le author'>\ <input id='authorInput' class='btn btn-neutral space-bottom' type='text' placeholder='le author'>\
<button id='authorSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Edit author</button>\ <button id='authorSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Edit author</button>\
</form>"; </form>";
flyoutShow(header, description, actionBox); flyoutShow(header, description, actionBox);
$("#authorConfirm").submit(function(event) { $("#authorConfirm").submit(function(event) {
event.preventDefault(); event.preventDefault();
var authorInput = $("#authorInput").val(); var authorInput = $("#authorInput").val();
var authorSubmit = $("#authorSubmit").val(); var authorSubmit = $("#authorSubmit").val();
$("#sniffle").load("app/image/edit_author.php", { $("#sniffle").load("app/image/edit_author.php", {
id: <?php echo $_GET['id']; ?>, id: <?php echo $_GET['id']; ?>,
input: authorInput, input: authorInput,
submit: authorSubmit submit: authorSubmit
}); });
}); });
}); });
</script> </script>
<?php <?php
} }
echo "</div>"; echo "</div>";
} }
/* /*
|------------------------------------------------------------- |-------------------------------------------------------------
| End of displaying all user info | End of displaying all user info
|------------------------------------------------------------- |-------------------------------------------------------------
*/ */
} }
?> ?>
<?php include "ui/footer.php"; ?> <?php include "ui/footer.php"; ?>
</body> </body>
</html> </html>

6
setup.json Normal file
View file

@ -0,0 +1,6 @@
{
"name": "Only Legs",
"description": "A simple gallery with multiple users in mind",
"version": "15.08.22",
"license":"GPL 3.0"
}

View file

@ -1 +0,0 @@
<?php

View file

@ -1,6 +1,6 @@
<nav class="nav-root flex-left"> <nav class="nav-root flex-left">
<div class="nav-name flex-left"> <div class="nav-name flex-left">
<p>Lynx Gallery</p> <p><?php echo $setup_json['name']; ?></p>
</div> </div>
<div class="nav-links flex-left"> <div class="nav-links flex-left">
<a class='btn' href='<?php echo $root_dir; ?>index.php'><img class='svg' src='<?php echo $root_dir; ?>assets/icons/house.svg'><span class='nav-hide'>Home</span></a> <a class='btn' href='<?php echo $root_dir; ?>index.php'><img class='svg' src='<?php echo $root_dir; ?>assets/icons/house.svg'><span class='nav-hide'>Home</span></a>

View file

@ -47,11 +47,6 @@ include $root_dir."app/image/image_privilage.php";
include $root_dir."app/server/secrete.php"; include $root_dir."app/server/secrete.php";
?> ?>
<script> <script>
/*
This is a little secrete for the ones who care, nothing important
*/
console.log(" . . /|/| . . . . . . . \n .. /0 0 \\ . . . . . .. \n (III% . \\________, . . \n .. .\\_, .%###%/ \\'\\,.. \n . . . .||#####| |'\\ \\. \n .. . . ||. . .|/. .\\V. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . .|| . . || . . . \n .. . . ||. . .||. . .. \n . . . cc/ . .cc/ . . .");
/* /*
Gets Querys from the URL the user is at Gets Querys from the URL the user is at
Used by Sniffle to display notificaions Used by Sniffle to display notificaions

View file

@ -1,104 +1,104 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title> <title>Lynx Gallery</title>
<!-- Stylesheets --> <!-- Stylesheets -->
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/normalise.css"> <link rel="stylesheet" href="css/normalise.css">
<!-- Google Fonts --> <!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap">
<!-- JQuery --> <!-- JQuery -->
<script <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
src="https://code.jquery.com/jquery-3.6.0.min.js" </script>
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</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'>
<!-- Flyout script! --> <!-- Flyout script! -->
<script src="Flyout/flyout.js"></script> <script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'> <link rel='stylesheet' href='Flyout/flyout.css'>
<!-- Upload Script --> <!-- Upload Script -->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$("#uploadSubmit").submit(function(event) { $("#uploadSubmit").submit(function(event) {
event.preventDefault(); event.preventDefault();
// Check if image avalible // Check if image avalible
var file = $("#image").val(); var file = $("#image").val();
if (file != "") { if (file != "") {
// Make form // Make form
var formData = new FormData(); var formData = new FormData();
// Get image // Get image
var image_data = $("#image").prop("files")[0]; var image_data = $("#image").prop("files")[0];
formData.append("image", image_data); formData.append("image", image_data);
// Get ALT // Get ALT
var alt = $("#alt").val(); var alt = $("#alt").val();
formData.append("alt", alt); formData.append("alt", alt);
// Get ALT // Get ALT
var submit = $("#submit").val(); var submit = $("#submit").val();
formData.append("submit", submit); formData.append("submit", submit);
// Upload the information // Upload the information
$.ajax({ $.ajax({
url: 'app/image/upload_image.php', url: 'app/image/upload_image.php',
type: 'post', type: 'post',
data: formData, data: formData,
contentType: false, contentType: false,
processData: false, processData: false,
success: function(response){ success: function(response) {
$("#sniffle").html(response); $("#sniffle").html(response);
} }
}); });
// Empty values // Empty values
$("#image").val(""); $("#image").val("");
$("#alt").val(""); $("#alt").val("");
$("#submit").val(""); $("#submit").val("");
} else { } else {
sniffleAdd('Gwha!', 'Pls provide image', 'var(--red)', '<?php echo $root_dir; ?>assets/icons/file-search.svg'); sniffleAdd('Gwha!', 'Pls provide image', 'var(--red)', '<?php echo $root_dir; ?>assets/icons/file-search.svg');
} }
}); });
}); });
</script> </script>
</head> </head>
<body>
<?php
include "ui/required.php";
include "ui/nav.php";
// Check if user is logged in <body>
if (!loggedin()) { <?php
echo " include "ui/required.php";
include "ui/nav.php";
// Check if user is logged in
if (!loggedin()) {
echo "
<script> <script>
sniffleAdd('Who are you!', 'You must be loggedin to upload things, sowwy!', 'var(--red)', '".$root_dir."assets/icons/cross.svg'); sniffleAdd('Who are you!', 'You must be loggedin to upload things, sowwy!', 'var(--red)', '" . $root_dir . "assets/icons/cross.svg');
</script> </script>
"; ";
} }
?> ?>
<div class="upload-root"> <div class="upload-root">
<h2>Upload image</h2> <h2>Upload image</h2>
<p>In this world you have 2 choices, to upload a really cute picture of an animal or fursuit, or something other than those 2 things.</p> <p>In this world you have 2 choices, to upload a really cute picture of an animal or fursuit, or something other than those 2 things.</p>
<br> <br>
<form id="uploadSubmit" class="flex-down between" method="POST" enctype="multipart/form-data"> <form id="uploadSubmit" class="flex-down between" method="POST" enctype="multipart/form-data">
<input id="image" class="btn btn-neutral" type="file" placeholder="select image UwU"> <input id="image" class="btn btn-neutral" type="file" placeholder="select image UwU">
<input id="alt" class="btn btn-neutral" type="text" placeholder="Description/Alt for image"> <input id="alt" class="btn btn-neutral" type="text" placeholder="Description/Alt for image">
<br> <br>
<button id="submit" class="btn btn-good" type="submit"><img class="svg" src="assets/icons/upload.svg">Upload Image</button> <button id="submit" class="btn btn-good" type="submit"><img class="svg" src="assets/icons/upload.svg">Upload Image</button>
</form> </form>
</div> </div>
<?php include "ui/footer.php"; ?> <?php include "ui/footer.php"; ?>
</body> </body>
</html>
</html>