From e19bab45cdb58d09140953ba428cd51533a834e5 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Fri, 23 Sep 2022 23:02:59 +0000 Subject: [PATCH] World shittest gallery implementation :flushed: --- app/image/group.php | 80 ++++++++++++++++++++++++++++++++++++-- app/settings/manifest.json | 2 +- css/main.css | 50 ++++++++++++++++++++++++ css/scss/_body.scss | 41 +++++++++++++++++++ group.php | 63 ++++++++++++++++++++++++++---- image.php | 14 +++---- index.php | 42 +++++++++++++++++++- 7 files changed, 273 insertions(+), 19 deletions(-) diff --git a/app/image/group.php b/app/image/group.php index bb223f7..d42991b 100644 --- a/app/image/group.php +++ b/app/image/group.php @@ -25,9 +25,9 @@ if (isset($_POST['group_submit'])) { if ($stmt = mysqli_prepare($conn, $sql)) { // Bind variables to the prepared statement as parameters mysqli_stmt_bind_param($stmt, "i", $param_user_id); - + $param_user_id = $_POST['group_id']; - + $stmt->execute(); $query = $stmt->get_result(); @@ -47,7 +47,9 @@ if (isset($_POST['group_submit'])) { ?> execute(); + $query = $stmt->get_result(); + + if ($_SESSION['id'] == $query || $user_info->is_admin($conn, $_SESSION['id'])) { + // getting ready forSQL asky asky + $sql = "UPDATE groups SET group_name = ? WHERE id = ?"; + + // Checking if databse is doing ok + if ($stmt = mysqli_prepare($conn, $sql)) { + mysqli_stmt_bind_param($stmt, "si", $param_title, $param_id); + + // Setting parameters + $param_title = $_POST['group_title']; + $param_id = $_POST['group_id']; + + // Attempt to execute the prepared statement + if (mysqli_stmt_execute($stmt)) { + ?> + + + + + + + + * { + display: none; +} + +.group-item:hover .group-name { + opacity: 1; +} + /* |------------------------------------------------------------- | profile diff --git a/css/scss/_body.scss b/css/scss/_body.scss index 084e739..e62d18d 100644 --- a/css/scss/_body.scss +++ b/css/scss/_body.scss @@ -412,7 +412,48 @@ .selectedImage { outline: $page-accent solid 0.3rem; } +.group-name { + @include defaultFont(); + margin: 0; + + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + + transition: opacity 0.1s cubic-bezier(.19, 1, .22, 1); + + z-index: 6; + + opacity: 0; + font-size: 17px; +} + +.gallery-group { + width: 100%; + height: 100%; + + top: 0; + bottom: 0; + left: 0; + right: 0; + + position: absolute; + z-index: 5; +} + +.group-item:hover { + & .gallery-group { + backdrop-filter: brightness(0.5); + } + & .nsfw-warning > * { + display: none; + } +} +.group-item:hover .group-name { + opacity: 1; +} /* |------------------------------------------------------------- | profile diff --git a/group.php b/group.php index 52907e5..645a058 100644 --- a/group.php +++ b/group.php @@ -36,14 +36,37 @@ $group = mysqli_fetch_array($query); - $image_list = explode(" ", $group['image_list']); + $image_list = array_reverse(explode(" ", $group['image_list'])); } } ?>

-

By:

-

Made on:

-

Updated on:

+ get_user_info($conn, $group['author']); + + if (isset($user['username'])) { + echo "

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

"; + } else { + echo "

By: Deleted User

"; + } + + $upload_time = new DateTime($group['created_on']); + echo "

Created at: ".$upload_time->format('d/m/Y H:i:s T')."

"; + ?> + + +

Last Modified: time($group['last_modified']); ?>

is_admin($conn, $_SESSION['id'])) { $privilaged = True; @@ -54,7 +77,33 @@ if (isset($_GET['mode']) && $_GET['mode'] == "edit") { if (!$privilaged) header("Location: group.php?id=".$_GET['id']); - echo ""; + echo ""; + + ?> + + + "; @@ -65,9 +114,9 @@ echo ""; } } - echo ""; + echo ""; - echo "Cancel"; + echo "Back"; } else { if ($privilaged) echo "Edit"; } diff --git a/image.php b/image.php index 280cee1..723e5a9 100644 --- a/image.php +++ b/image.php @@ -327,13 +327,13 @@