This commit is contained in:
Michał 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>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title>
<!-- Stylesheets -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/normalise.css">
<!-- Stylesheets -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/normalise.css">
<!-- 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=Secular+One&display=swap">
<!-- 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=Secular+One&display=swap">
<!-- JQuery -->
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</script>
<!-- JQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
</script>
<!-- Sniffle script! -->
<script src="Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='Sniffle/sniffle.css'>
<!-- Sniffle script! -->
<script src="Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='Sniffle/sniffle.css'>
<!-- Flyout script! -->
<script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'>
<!-- Flyout script! -->
<script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'>
</head>
<body>
<?php
include "ui/required.php";
include "ui/nav.php";
?>
<?php
include "ui/required.php";
include "ui/nav.php";
?>
<div class="about-root">
<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>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>
<div class="about-root">
<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>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>
<br>
<br>
<h2 class="space-top-large" id="add-this">Can you add "A" or "B"?</h2>
<p>No.</p>
<h2 class="space-top-large" id="add-this">Can you add "A" or "B"?</h2>
<p>No.</p>
<br>
<br>
<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>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>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>
<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>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>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>
<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 mrHDash...</p>
</div>
<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 <a class='link' href="https://phosphoricons.com/">Phosphor</a> for providing nice SVG icons.</p>
<p>To mrHDash...</p>
</div>
<?php include "ui/footer.php"; ?>
<?php include "ui/footer.php"; ?>
</body>
</html>
</html>

View file

@ -1,79 +1,79 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title>
<!-- Stylesheets -->
<link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/normalise.css">
<!-- Stylesheets -->
<link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/normalise.css">
<!-- 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=Secular+One&display=swap">
<!-- 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=Secular+One&display=swap">
<!-- JQuery -->
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</script>
<!-- JQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
</script>
<!-- Sniffle script! -->
<script src="../Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='../Sniffle/sniffle.css'>
<!-- Sniffle script! -->
<script src="../Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='../Sniffle/sniffle.css'>
<!-- Flyout script! -->
<script src="../Flyout/flyout.js"></script>
<link rel='stylesheet' href='../Flyout/flyout.css'>
<!-- Flyout script! -->
<script src="../Flyout/flyout.js"></script>
<link rel='stylesheet' href='../Flyout/flyout.css'>
</head>
<body>
<?php
include "../ui/required.php";
include "../ui/nav.php";
?>
<?php
include "../ui/required.php";
include "../ui/nav.php";
?>
<div class="account-root">
<h2>Account settings</h2>
<?php
if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
echo "<br>";
if ($_SESSION["id"] == 1) {
echo "<h3>Invite Codes</h3>";
$token_request = mysqli_query($conn, "SELECT * FROM tokens WHERE used = 0");
while ($token = mysqli_fetch_array($token_request)) {
?>
<!-- Button that's displayed with the invite code -->
<button onclick='copyCode()' class='btn btn-neutral'><?php echo $token['code']; ?></button>
<!-- Copy code on click -->
<script>
function copyCode() {
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");
}
</script>
<?php
}
}
?>
<br>
<h3 class='space-top'>Danger ahead</h3>
<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>
<br>
<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>
<?php
} else {
?>
<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>
<?php
}
?>
</div>
<div class="account-root">
<h2>Account settings</h2>
<?php
if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
echo "<br>";
if ($_SESSION["id"] == 1) {
echo "<h3>Invite Codes</h3>";
$token_request = mysqli_query($conn, "SELECT * FROM tokens WHERE used = 0");
while ($token = mysqli_fetch_array($token_request)) {
?>
<!-- Button that's displayed with the invite code -->
<button onclick='copyCode()' class='btn btn-neutral'><?php echo $token['code']; ?></button>
<!-- Copy code on click -->
<script>
function copyCode() {
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");
}
</script>
<?php
}
}
?>
<br>
<h3 class='space-top'>Danger ahead</h3>
<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>
<br>
<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>
<?php
} else {
?>
<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>
<?php
}
?>
</div>
<?php include "../ui/footer.php"; ?>
<?php include "../ui/footer.php"; ?>
</body>
</html>
</html>

View file

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

View file

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

View file

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

View file

@ -81,7 +81,7 @@ if (isset($_POST['submit'])) {
?>
<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');
setTimeout(function(){window.location.href = "../index.php?login=success";}, 4000);
setTimeout(function(){window.location.href = "../index.php?login=success";}, 2000);
</script>
<?php
} else {

View file

@ -210,7 +210,7 @@ if (isset($_POST['submit'])) {
?>
<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');
setTimeout(function(){window.location.href = "../account/login.php";}, 4000);
setTimeout(function(){window.location.href = "../account/login.php";}, 2000);
</script>
<?php
} else {

View file

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

View file

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

View file

@ -13,10 +13,20 @@ footer {
width: calc(100% - 1.4rem);
a {
margin: 0.5rem;
p {
margin: 0 0.5rem;
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;

694
image.php
View file

@ -1,394 +1,394 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title>
<!-- Stylesheets -->
<!-- Stylesheets -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/normalise.css">
<link rel="stylesheet" href="css/normalise.css">
<!-- 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=Secular+One&display=swap">
<!-- 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=Secular+One&display=swap">
<!-- JQuery -->
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</script>
<!-- JQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
</script>
<!-- Sniffle script! -->
<script src="Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='Sniffle/sniffle.css'>
<!-- Sniffle script! -->
<script src="Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='Sniffle/sniffle.css'>
<!-- Flyout script! -->
<script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'>
<!-- Flyout script! -->
<script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'>
</head>
<body>
<?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/nav.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/nav.php";
/*
|-------------------------------------------------------------
| 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 ^^
|-------------------------------------------------------------
*/
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
// Get all image info
$image = get_image_info($conn, $_GET['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 ^^
|-------------------------------------------------------------
*/
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'])) {
$image_present = True;
} else {
?>
<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');
</script>
<?php
$image_present = False;
}
} else {
?>
<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');
</script>
<?php
$image_present = False;
}
// Check if image is avalible
if (isset($image['imagename'])) {
$image_present = True;
} else {
?>
<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');
</script>
<?php
$image_present = False;
}
} else {
?>
<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');
</script>
<?php
$image_present = False;
}
/*
|-------------------------------------------------------------
| Image verification
|-------------------------------------------------------------
| Doublechecking if all information on images exists, if yes
| display it, otherwise don't display at all or replace with
| blank or filler info
|-------------------------------------------------------------
*/
if ($image_present) {
/*
|-------------------------------------------------------------
| Check user details
|-------------------------------------------------------------
*/
if (isset($image['author'])) {
// Get all information on the user
$user = get_user_info($conn, $image['author']);
/*
|-------------------------------------------------------------
| Image verification
|-------------------------------------------------------------
| Doublechecking if all information on images exists, if yes
| display it, otherwise don't display at all or replace with
| blank or filler info
|-------------------------------------------------------------
*/
if ($image_present) {
/*
|-------------------------------------------------------------
| Check user details
|-------------------------------------------------------------
*/
if (isset($image['author'])) {
// Get all information on the user
$user = get_user_info($conn, $image['author']);
if (isset($user['username'])) {
$image_author = $user['username'];
} else {
$image_author = "Deleted User";
}
} else {
$image_author = "No author";
}
if (isset($user['username'])) {
$image_author = $user['username'];
} else {
$image_author = "Deleted User";
}
} else {
$image_author = "No author";
}
/*
|-------------------------------------------------------------
| Check if image path is good
|-------------------------------------------------------------
*/
if (isset($image['imagename'])) {
$image_path = "images/".$image['imagename'];
$image_alt = $image['alt'];
} else {
$image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy";
}
/*
|-------------------------------------------------------------
| Check if image path is good
|-------------------------------------------------------------
*/
if (isset($image['imagename'])) {
$image_path = "images/" . $image['imagename'];
$image_alt = $image['alt'];
} else {
$image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy";
}
/*
|-------------------------------------------------------------
| If description not set or empty, replace with filler
|-------------------------------------------------------------
*/
if (!isset($image_alt) || empty($image_alt)) {
$image_alt = "No description avalible";
}
} else {
/*
|-------------------------------------------------------------
| Image was not present
|-------------------------------------------------------------
*/
$image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy";
}
/*
|-------------------------------------------------------------
| If description not set or empty, replace with filler
|-------------------------------------------------------------
*/
if (!isset($image_alt) || empty($image_alt)) {
$image_alt = "No description avalible";
}
} else {
/*
|-------------------------------------------------------------
| Image was not present
|-------------------------------------------------------------
*/
$image_path = "assets/no_image.png";
$image_alt = "No image could be found, sowwy";
}
/*
|-------------------------------------------------------------
| Check user privilge
|-------------------------------------------------------------
*/
if (image_privilage($image['author']) || is_admin($_SESSION['id'])) {
$privilaged = True;
} else {
$privilaged = False;
}
?>
/*
|-------------------------------------------------------------
| Check user privilge
|-------------------------------------------------------------
*/
if (image_privilage($image['author']) || is_admin($_SESSION['id'])) {
$privilaged = True;
} else {
$privilaged = False;
}
?>
<div class="image-container">
<img class='image' id='<?php echo $image['id']; ?>' src='<?php echo $image_path; ?>' alt='<?php echo $image_alt; ?>'>
</div>
<div class="image-container">
<img class='image' id='<?php echo $image['id']; ?>' src='<?php echo $image_path; ?>' alt='<?php echo $image_alt; ?>'>
</div>
<?php
/*
|-------------------------------------------------------------
| Start of displaying all info on image
|-------------------------------------------------------------
*/
if ($image_present) {
?>
<?php
/*
|-------------------------------------------------------------
| Start of displaying all info on image
|-------------------------------------------------------------
*/
if ($image_present) {
?>
<div class="image-description default-window">
<h2>Description</h2>
<p><?php echo $image_alt; ?></p>
</div>
<div class="image-description default-window">
<h2>Description</h2>
<p><?php echo $image_alt; ?></p>
</div>
<div class="image-detail flex-down default-window">
<h2>Details</h2>
<?php
// User
echo "<p>Author: ".$image_author."</p>";
<div class="image-detail flex-down default-window">
<h2>Details</h2>
<?php
// User
echo "<p>Author: " . $image_author . "</p>";
// Image ID
echo "<p>ID: ".$image['id']."</p>";
// Image ID
echo "<p>ID: " . $image['id'] . "</p>";
// File name
if (strlen($image['imagename']) > 30) {
echo "<p>File Name: ".substr($image['imagename'], 0, 30)."...</p>";
} else {
echo "<p>File Name: ".$image['imagename']."</p>";
}
// File name
if (strlen($image['imagename']) > 30) {
echo "<p>File Name: " . substr($image['imagename'], 0, 30) . "...</p>";
} else {
echo "<p>File Name: " . $image['imagename'] . "</p>";
}
// File extention
echo "<p>File Type: ".pathinfo($image['imagename'], PATHINFO_EXTENSION)."</p>";
// File extention
echo "<p>File Type: " . pathinfo($image['imagename'], PATHINFO_EXTENSION) . "</p>";
// Image resolution
list($width, $height) = getimagesize($image_path);
echo "<p>Image resolution: ".$width."x".$height."</p>";
// Image resolution
list($width, $height) = getimagesize($image_path);
echo "<p>Image resolution: " . $width . "x" . $height . "</p>";
// Image Upload date
echo "<p>Last updated: +0 ".$image['upload']."</p>";
// Image Upload date
echo "<p>Last updated: +0 " . $image['upload'] . "</p>";
echo "<br>";
echo "<br>";
// 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>";
// 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>";
// Copy image
?>
<script>
function copyLink() {
navigator.clipboard.writeText(window.location.href);
// Copy image
?>
<script>
function copyLink() {
navigator.clipboard.writeText(window.location.href);
sniffleAdd("Info", "Link has been copied!", "var(--green)", "assets/icons/clipboard-text.svg");
}
</script>
<?php
echo "<button class='btn btn-good' onclick='copyLink()'><img class='svg' src='assets/icons/clipboard-text.svg'>Copy image link</button>";
?>
</div>
sniffleAdd("Info", "Link has been copied!", "var(--green)", "assets/icons/clipboard-text.svg");
}
</script>
<?php
echo "<button class='btn btn-good' onclick='copyLink()'><img class='svg' src='assets/icons/clipboard-text.svg'>Copy image link</button>";
?>
</div>
<div class="tags-root default-window">
<h2>Tags</h2>
<div class="tags">
<?php
// Get image tags
if (isset($image['tags']) && !empty($image['tags'])) {
$image_tags_array = explode(" ", $image['tags']);
foreach ($image_tags_array as $tag) {
if ($tag == "nsfw") {
echo "<p id='tag' class='tag btn-bad'>".$tag."</p>";
} else {
echo "<p id='tag' class='tag btn-good'>".$tag."</p>";
}
}
} else {
echo "<p>No tags present</p>";
}
?>
</div>
</div>
<div class="tags-root default-window">
<h2>Tags</h2>
<div class="tags">
<?php
// Get image tags
if (isset($image['tags']) && !empty($image['tags'])) {
$image_tags_array = explode(" ", $image['tags']);
foreach ($image_tags_array as $tag) {
if ($tag == "nsfw") {
echo "<p id='tag' class='tag btn-bad'>" . $tag . "</p>";
} else {
echo "<p id='tag' class='tag btn-good'>" . $tag . "</p>";
}
}
} else {
echo "<p>No tags present</p>";
}
?>
</div>
</div>
<?php
/*
|-------------------------------------------------------------
| Check if user is privilaged,
|-------------------------------------------------------------
| If yes, grant them access to the Danger zone, or "the place
| that can fuck things up"
|-------------------------------------------------------------
*/
if ($privilaged) {
?>
<!-- Danger zone -->
<div class='danger-zone flex-down default-window'>
<h2>Danger zone</h2>
<?php
/*
|-------------------------------------------------------------
| Check if user is privilaged,
|-------------------------------------------------------------
| If yes, grant them access to the Danger zone, or "the place
| that can fuck things up"
|-------------------------------------------------------------
*/
if ($privilaged) {
?>
<!-- Danger zone -->
<div class='danger-zone flex-down default-window'>
<h2>Danger zone</h2>
<!--
|-------------------------------------------------------------
| Delete
|-------------------------------------------------------------
| sus
| 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>
<script>
$('#deleteButton').click(function() {
var header = "Are you sure?";
var description = "Deleting this image is pernament, there is no going back after this!!!!!";
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>\
</form>";
flyoutShow(header, description, actionBox);
<!--
|-------------------------------------------------------------
| Delete
|-------------------------------------------------------------
| sus
| 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>
<script>
$('#deleteButton').click(function() {
var header = "Are you sure?";
var description = "Deleting this image is pernament, there is no going back after this!!!!!";
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>\
</form>";
flyoutShow(header, description, actionBox);
$("#deleteConfirm").submit(function(event) {
event.preventDefault();
var deleteSubmit = $("#deleteSubmit").val();
$("#sniffle").load("app/image/delete_image.php", {
id: <?php echo $_GET['id']; ?>,
submit: deleteSubmit
});
});
});
</script>
$("#deleteConfirm").submit(function(event) {
event.preventDefault();
var deleteSubmit = $("#deleteSubmit").val();
$("#sniffle").load("app/image/delete_image.php", {
id: <?php echo $_GET['id']; ?>,
submit: deleteSubmit
});
});
});
</script>
<!--
|-------------------------------------------------------------
| 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 btn-bad'><img class='svg' src='assets/icons/edit.svg'>Edit description</button>
<script>
$('#descriptionButton').click(function() {
var header = "Enter new Description/Alt";
var description = "Whatcha gonna put in there 👀";
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'>\
<button id='descriptionSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Update information</button>\
</form>";
flyoutShow(header, description, actionBox);
<!--
|-------------------------------------------------------------
| 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 btn-bad'><img class='svg' src='assets/icons/edit.svg'>Edit description</button>
<script>
$('#descriptionButton').click(function() {
var header = "Enter new Description/Alt";
var description = "Whatcha gonna put in there 👀";
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'>\
<button id='descriptionSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Update information</button>\
</form>";
flyoutShow(header, description, actionBox);
$("#descriptionConfirm").submit(function(event) {
event.preventDefault();
var descriptionInput = $("#descriptionInput").val();
var descriptionSubmit = $("#descriptionSubmit").val();
$("#sniffle").load("app/image/edit_description.php", {
id: <?php echo $_GET['id']; ?>,
input: descriptionInput,
submit: descriptionSubmit
});
});
});
</script>
$("#descriptionConfirm").submit(function(event) {
event.preventDefault();
var descriptionInput = $("#descriptionInput").val();
var descriptionSubmit = $("#descriptionSubmit").val();
$("#sniffle").load("app/image/edit_description.php", {
id: <?php echo $_GET['id']; ?>,
input: descriptionInput,
submit: descriptionSubmit
});
});
});
</script>
<!--
|-------------------------------------------------------------
| Edit Tags
|-------------------------------------------------------------
| 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
| works but once I re-add the search function this will make
| 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>
<script>
$('#tagsButton').click(function() {
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 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'>\
<button id='tagsSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Edit tags</button>\
</form>";
flyoutShow(header, description, actionBox);
<!--
|-------------------------------------------------------------
| Edit Tags
|-------------------------------------------------------------
| 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
| works but once I re-add the search function this will make
| 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>
<script>
$('#tagsButton').click(function() {
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 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'>\
<button id='tagsSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Edit tags</button>\
</form>";
flyoutShow(header, description, actionBox);
$("#tagsConfirm").submit(function(event) {
event.preventDefault();
var tagsInput = $("#tagsInput").val();
var tagsSubmit = $("#tagsSubmit").val();
$("#sniffle").load("app/image/edit_tags.php", {
id: <?php echo $_GET['id']; ?>,
input: tagsInput,
submit: tagsSubmit
});
});
});
</script>
$("#tagsConfirm").submit(function(event) {
event.preventDefault();
var tagsInput = $("#tagsInput").val();
var tagsSubmit = $("#tagsSubmit").val();
$("#sniffle").load("app/image/edit_tags.php", {
id: <?php echo $_GET['id']; ?>,
input: tagsInput,
submit: tagsSubmit
});
});
});
</script>
<!--
|-------------------------------------------------------------
| Edit Author
|-------------------------------------------------------------
| You must be a super cool person to see this section ;3
|-------------------------------------------------------------
-->
<?php
if (is_admin($_SESSION['id'])) {
?>
<button id='authorButton' class='btn btn-bad'><img class='svg' src='assets/icons/edit.svg'>Edit author</button>
<script>
$('#authorButton').click(function() {
var header = "Who owns the image?????";
var description = "Enter ID of image owner";
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'>\
<button id='authorSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Edit author</button>\
</form>";
flyoutShow(header, description, actionBox);
<!--
|-------------------------------------------------------------
| Edit Author
|-------------------------------------------------------------
| You must be a super cool person to see this section ;3
|-------------------------------------------------------------
-->
<?php
if (is_admin($_SESSION['id'])) {
?>
<button id='authorButton' class='btn btn-bad'><img class='svg' src='assets/icons/edit.svg'>Edit author</button>
<script>
$('#authorButton').click(function() {
var header = "Who owns the image?????";
var description = "Enter ID of image owner";
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'>\
<button id='authorSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Edit author</button>\
</form>";
flyoutShow(header, description, actionBox);
$("#authorConfirm").submit(function(event) {
event.preventDefault();
var authorInput = $("#authorInput").val();
var authorSubmit = $("#authorSubmit").val();
$("#sniffle").load("app/image/edit_author.php", {
id: <?php echo $_GET['id']; ?>,
input: authorInput,
submit: authorSubmit
});
});
});
</script>
<?php
}
echo "</div>";
}
$("#authorConfirm").submit(function(event) {
event.preventDefault();
var authorInput = $("#authorInput").val();
var authorSubmit = $("#authorSubmit").val();
$("#sniffle").load("app/image/edit_author.php", {
id: <?php echo $_GET['id']; ?>,
input: authorInput,
submit: authorSubmit
});
});
});
</script>
<?php
}
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>
</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">
<div class="nav-name flex-left">
<p>Lynx Gallery</p>
<p><?php echo $setup_json['name']; ?></p>
</div>
<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>

View file

@ -47,11 +47,6 @@ include $root_dir."app/image/image_privilage.php";
include $root_dir."app/server/secrete.php";
?>
<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
Used by Sniffle to display notificaions

View file

@ -1,104 +1,104 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lynx Gallery</title>
<!-- Stylesheets -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/normalise.css">
<!-- Stylesheets -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/normalise.css">
<!-- 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=Secular+One&display=swap">
<!-- 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=Secular+One&display=swap">
<!-- JQuery -->
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
</script>
<!-- JQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
</script>
<!-- Sniffle script! -->
<script src="Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='Sniffle/sniffle.css'>
<!-- Sniffle script! -->
<script src="Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='Sniffle/sniffle.css'>
<!-- Flyout script! -->
<script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'>
<!-- Flyout script! -->
<script src="Flyout/flyout.js"></script>
<link rel='stylesheet' href='Flyout/flyout.css'>
<!-- Upload Script -->
<script>
$(document).ready(function() {
$("#uploadSubmit").submit(function(event) {
event.preventDefault();
// Check if image avalible
var file = $("#image").val();
if (file != "") {
// Make form
var formData = new FormData();
<!-- Upload Script -->
<script>
$(document).ready(function() {
$("#uploadSubmit").submit(function(event) {
event.preventDefault();
// 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)', '<?php echo $root_dir; ?>assets/icons/file-search.svg');
}
});
});
</script>
// Empty values
$("#image").val("");
$("#alt").val("");
$("#submit").val("");
} else {
sniffleAdd('Gwha!', 'Pls provide image', 'var(--red)', '<?php echo $root_dir; ?>assets/icons/file-search.svg');
}
});
});
</script>
</head>
<body>
<?php
include "ui/required.php";
include "ui/nav.php";
// Check if user is logged in
if (!loggedin()) {
echo "
<body>
<?php
include "ui/required.php";
include "ui/nav.php";
// Check if user is logged in
if (!loggedin()) {
echo "
<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>
";
}
?>
}
?>
<div class="upload-root">
<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>
<br>
<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="alt" class="btn btn-neutral" type="text" placeholder="Description/Alt for image">
<br>
<button id="submit" class="btn btn-good" type="submit"><img class="svg" src="assets/icons/upload.svg">Upload Image</button>
</form>
</div>
<div class="upload-root">
<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>
<br>
<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="alt" class="btn btn-neutral" type="text" placeholder="Description/Alt for image">
<br>
<button id="submit" class="btn btn-good" type="submit"><img class="svg" src="assets/icons/upload.svg">Upload Image</button>
</form>
</div>
<?php include "ui/footer.php"; ?>
<?php include "ui/footer.php"; ?>
</body>
</html>
</html>