mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-05 09:53:12 +00:00
Bug fixes
This commit is contained in:
parent
6407669a5a
commit
59b30d9d73
4 changed files with 67 additions and 59 deletions
|
@ -800,6 +800,7 @@ nav .btn {
|
|||
|
||||
.active-tab {
|
||||
background-color: #8C977D !important;
|
||||
background-image: linear-gradient(to top, #7f8b6f, #8C977D) !important;
|
||||
}
|
||||
|
||||
.logs {
|
||||
|
@ -1093,6 +1094,7 @@ a.btn {
|
|||
|
||||
.btn-neutral {
|
||||
background-color: #121212;
|
||||
background-image: linear-gradient(to top, #111111, #121212);
|
||||
/*color: $white;*/
|
||||
}
|
||||
|
||||
|
|
|
@ -136,6 +136,7 @@ a.btn {
|
|||
}
|
||||
.btn-neutral {
|
||||
background-color: $neutral;
|
||||
background-image: linear-gradient(to top, darken($neutral, 0.5%), $neutral);
|
||||
/*color: $white;*/
|
||||
}
|
||||
|
||||
|
|
|
@ -787,6 +787,7 @@
|
|||
}
|
||||
.active-tab {
|
||||
background-color: $page-accent !important;
|
||||
background-image: linear-gradient(to top, darken($page-accent, 5%), $page-accent) !important;
|
||||
}
|
||||
|
||||
.logs {
|
||||
|
|
122
group.php
122
group.php
|
@ -30,6 +30,11 @@
|
|||
|
||||
$group['created_at'] = new DateTime($group['created_at']);
|
||||
}
|
||||
|
||||
if ($_GET['mode'] == "edit" && $_SESSION['id'] != $group['author'] && !$user_info->is_admin($conn, $_SESSION['id'])) {
|
||||
$_SESSION['err'] = "You do not have permission to view this page";
|
||||
header("Location: group.php?id=".$_GET['id']);
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
@ -86,78 +91,77 @@
|
|||
echo "<p>Last Modified: ".$diff->time($group['last_modified'])."</p>";
|
||||
|
||||
if ($_GET['mode'] == "edit") {
|
||||
if ($_SESSION['id'] == $group['author'] || $user_info->is_admin($conn, $_SESSION['id'])) {
|
||||
echo "<br>";
|
||||
echo "<br>";
|
||||
|
||||
echo "<button id='deleteGroup' class='btn btn-bad'>Delete</button>";
|
||||
?>
|
||||
<script>
|
||||
$('#deleteGroup').click(function() {
|
||||
var header = "Are you surrrrrre?";
|
||||
var description = "The images will still be up, but all your hard work setting this group up will be gone!";
|
||||
var actionBox = "<form id='titleForm' method='POST'>\
|
||||
<button id='deleteSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/trash.svg'>Delete group</button>\
|
||||
</form>";
|
||||
flyoutShow(header, description, actionBox);
|
||||
|
||||
$("#titleForm").submit(function(event) {
|
||||
event.preventDefault();
|
||||
var deleteSubmit = $("#deleteSubmit").val();
|
||||
$("#newSniff").load("app/image/group.php", {
|
||||
group_id: <?php echo $_GET['id']; ?>,
|
||||
group_delete: deleteSubmit
|
||||
});
|
||||
echo "<button id='deleteGroup' class='btn btn-bad'>Delete</button>";
|
||||
?>
|
||||
<script>
|
||||
$('#deleteGroup').click(function() {
|
||||
var header = "Are you surrrrrre?";
|
||||
var description = "The images will still be up, but all your hard work setting this group up will be gone!";
|
||||
var actionBox = "<form id='titleForm' method='POST'>\
|
||||
<button id='deleteSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/trash.svg'>Delete group</button>\
|
||||
</form>";
|
||||
flyoutShow(header, description, actionBox);
|
||||
|
||||
$("#titleForm").submit(function(event) {
|
||||
event.preventDefault();
|
||||
var deleteSubmit = $("#deleteSubmit").val();
|
||||
$("#newSniff").load("app/image/group.php", {
|
||||
group_id: <?php echo $_GET['id']; ?>,
|
||||
group_delete: deleteSubmit
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
echo "<button id='editTitle' class='btn btn-bad'>Update title</button>";
|
||||
?>
|
||||
<script>
|
||||
$('#editTitle').click(function() {
|
||||
var header = "Newwww photo group name!";
|
||||
var description = "What will it be? uwu";
|
||||
var actionBox = "<form id='titleForm' action='app/image/edit_description.php' method='POST'>\
|
||||
<input id='titleText' class='btn btn-neutral' type='text' placeholder='New title'>\
|
||||
<button id='titleSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Update title</button>\
|
||||
</form>";
|
||||
flyoutShow(header, description, actionBox);
|
||||
|
||||
$("#titleForm").submit(function(event) {
|
||||
event.preventDefault();
|
||||
var titleText = $("#titleText").val();
|
||||
var titleSubmit = $("#titleSubmit").val();
|
||||
$("#newSniff").load("app/image/group.php", {
|
||||
group_id: <?php echo $_GET['id']; ?>,
|
||||
group_title: titleText,
|
||||
title_submit: titleSubmit
|
||||
});
|
||||
echo "<button id='editTitle' class='btn btn-bad'>Update title</button>";
|
||||
?>
|
||||
<script>
|
||||
$('#editTitle').click(function() {
|
||||
var header = "Newwww photo group name!";
|
||||
var description = "What will it be? uwu";
|
||||
var actionBox = "<form id='titleForm' action='app/image/edit_description.php' method='POST'>\
|
||||
<input id='titleText' class='btn btn-neutral' type='text' placeholder='New title'>\
|
||||
<button id='titleSubmit' class='btn btn-bad' type='submit'><img class='svg' src='assets/icons/edit.svg'>Update title</button>\
|
||||
</form>";
|
||||
flyoutShow(header, description, actionBox);
|
||||
|
||||
$("#titleForm").submit(function(event) {
|
||||
event.preventDefault();
|
||||
var titleText = $("#titleText").val();
|
||||
var titleSubmit = $("#titleSubmit").val();
|
||||
$("#newSniff").load("app/image/group.php", {
|
||||
group_id: <?php echo $_GET['id']; ?>,
|
||||
group_title: titleText,
|
||||
title_submit: titleSubmit
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
echo "<br>";
|
||||
echo "<br>";
|
||||
|
||||
$image_request = mysqli_query($conn, "SELECT * FROM images");
|
||||
echo "<form id='groupForm'>";
|
||||
while ($image = mysqli_fetch_array($image_request)) {
|
||||
if (in_array($image['id'], $image_list)) {
|
||||
echo "<input style='display: none;' type='checkbox' id='".$image['id']."' name='".$image['id']."' checked/>";
|
||||
} else {
|
||||
echo "<input style='display: none;' type='checkbox' id='".$image['id']."' name='".$image['id']."'/>";
|
||||
}
|
||||
}
|
||||
echo "<button id='groupSubmit' class='btn btn-good' type='submit'>Save changes</button>
|
||||
</form>";
|
||||
|
||||
echo "<a href='group.php?id=".$_GET['id']."' class='btn btn-neutral'>Back</a>";
|
||||
$image_request = mysqli_query($conn, "SELECT * FROM images");
|
||||
echo "<form id='groupForm'>";
|
||||
while ($image = mysqli_fetch_array($image_request)) {
|
||||
if (in_array($image['id'], $image_list)) {
|
||||
echo "<input style='display: none;' type='checkbox' id='".$image['id']."' name='".$image['id']."' checked/>";
|
||||
} else {
|
||||
echo "<input style='display: none;' type='checkbox' id='".$image['id']."' name='".$image['id']."'/>";
|
||||
}
|
||||
}
|
||||
echo "<button id='groupSubmit' class='btn btn-good' type='submit'>Save changes</button>
|
||||
</form>";
|
||||
|
||||
echo "<a href='group.php?id=".$_GET['id']."' class='btn btn-neutral'>Back</a>";
|
||||
} else {
|
||||
if ($_SESSION['id'] == $group['author'] || $user_info->is_admin($conn, $_SESSION['id'])) {
|
||||
echo "<a href='group.php?id=".$_GET['id']."&mode=edit' class='btn btn-neutral'>Edit</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
<button class='btn btn-good' onclick='copyLink()'><img class='svg' src='assets/icons/clipboard-text.svg'>Copy link</button>
|
||||
<script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue