diff --git a/app/image/group.php b/app/image/group.php index 0f1e1b7..265b5fa 100644 --- a/app/image/group.php +++ b/app/image/group.php @@ -120,7 +120,7 @@ if (isset($_POST['title_submit'])) { if (isset($_POST['new_group_submit'])) { if ($user_info->is_loggedin()) { - $group_name = $_SESSION['username']." new image group"; + $group_name = $_SESSION['username']."\'s Group"; $sql = "INSERT INTO groups (group_name, author, image_list) VALUES('$group_name', '".$_SESSION['id']."', '')"; mysqli_query($conn, $sql); diff --git a/app/image/image.php b/app/image/image.php index 4a898ff..ee6425b 100644 --- a/app/image/image.php +++ b/app/image/image.php @@ -31,10 +31,7 @@ if (isset($_POST['submit_delete'])) { // Delete from table $sql = "DELETE FROM images WHERE id = ?"; if ($stmt = mysqli_prepare($conn, $sql)) { - mysqli_stmt_bind_param($stmt, "i", $param_id); - - // Setting parameters - $param_id = $_POST['id']; + mysqli_stmt_bind_param($stmt, "i", $_POST['id']); // Attempt to execute the prepared statement if (mysqli_stmt_execute($stmt)) { @@ -52,9 +49,10 @@ if (isset($_POST['submit_delete'])) { } // TP user to the homepage with a success message mysqli_query($conn,"INSERT INTO logs (ipaddress, action) VALUES('$user_ip','Deleted image ".$_POST['id']."')"); + $_SESSION['del'] = $_POST['id']; ?> Groups
is_loggedin()) { + if ($_SESSION["loggedin"]) { ?> Upload
diff --git a/css/main.css b/css/main.css index cf08f9a..7f4c340 100644 --- a/css/main.css +++ b/css/main.css @@ -243,7 +243,7 @@ nav .btn { max-width: calc(20% - 0.5rem); min-width: calc(20% - 0.5rem); background-color: #151515; - border-radius: -0.1rem; + border-radius: -0.3rem; position: relative; overflow: hidden; flex: 1 0 150px; @@ -487,6 +487,48 @@ nav .btn { | Groups |------------------------------------------------------------- */ +.group-banner { + position: relative; +} + +.group-description { + height: auto; + width: auto; + position: relative; + z-index: 1; +} +.group-description > * { + margin: 0 0 0.5rem 0; +} + +.group-cover { + height: 100%; + max-width: 40%; + width: auto; + position: absolute; + display: inline-block; + right: 0; + top: 0; + overflow: hidden; + z-index: 0; +} +.group-cover span { + width: 100%; + height: 100%; + position: absolute; + background: linear-gradient(to right, #151515, rgba(21, 21, 21, 0.7333333333)); + z-index: 1; + border-radius: 0.2rem; +} +.group-cover img { + width: 100%; + height: 100%; + -o-object-fit: cover; + object-fit: cover; + margin-left: auto; + border-radius: 0.2rem; +} + .selectedImage { outline: #8C977D solid 0.3rem; } @@ -503,6 +545,7 @@ nav .btn { font-size: 17px; font-family: "Secular One", sans-serif; text-decoration: none; + text-align: center; } .gallery-group { @@ -516,14 +559,14 @@ nav .btn { z-index: 5; } -.group-item:hover .gallery-group { +.group-item .gallery-group { -webkit-backdrop-filter: brightness(0.5); backdrop-filter: brightness(0.5); } -.group-item:hover .nsfw-warning > * { +.group-item .nsfw-warning > * { display: none; } -.group-item:hover .group-name { +.group-item .group-name { opacity: 1; } diff --git a/css/scss/_body.scss b/css/scss/_body.scss index 4eae7fb..2ff51f5 100644 --- a/css/scss/_body.scss +++ b/css/scss/_body.scss @@ -72,7 +72,7 @@ min-width: calc(20% - 0.5rem); background-color: $bg; - border-radius: calc($rad - 0.5rem); + border-radius: calc($rad - 0.7rem); position: relative; @@ -384,6 +384,64 @@ | Groups |------------------------------------------------------------- */ +.group-banner { + position: relative; +} + +.group-description { + height: auto; + width: auto; + + position: relative; + + z-index: +1; + + & > * { + margin: 0 0 0.5rem 0; + } +} + +.group-cover { + height: 100%; + max-width: 40%; + width: auto; + + position: absolute; + + display: inline-block; + + right: 0; + top: 0; + + overflow: hidden; + + z-index: 0; + + span { + width: 100%; + height: 100%; + + position: absolute; + + background: linear-gradient(to right, $bg, $bg-alt); + + z-index: +1; + + border-radius: calc($rad - 0.2rem); + } + + img { + width: 100%; + height: 100%; + + object-fit: cover; + + margin-left: auto; + + border-radius: calc($rad - 0.2rem); + } +} + .selectedImage { outline: $page-accent solid 0.3rem; } @@ -403,6 +461,7 @@ font-size: 17px; font-family: $font-body; text-decoration: none; + text-align: center; } .gallery-group { @@ -419,16 +478,14 @@ } .group-item { - &:hover { - & .gallery-group { - backdrop-filter: brightness(0.5); - } - & .nsfw-warning > * { - display: none; - } - & .group-name { - opacity: 1; - } + & .gallery-group { + backdrop-filter: brightness(0.5); + } + & .nsfw-warning > * { + display: none; + } + & .group-name { + opacity: 1; } } diff --git a/group.php b/group.php index 09e6e21..e0b04a5 100644 --- a/group.php +++ b/group.php @@ -30,7 +30,8 @@ if (isset($_GET['id'])) { $image_list = array_reverse(explode(" ", $group['image_list'])); - echo "
"; + echo "
+
"; echo "

".$group['group_name']."

"; @@ -42,11 +43,13 @@ $members_array = array(); foreach ($group_members as $member) { $member_info = $user_info->get_user_info($conn, $member); - if (!empty($member_info['username'])) $members_array[] = $member_info['username']; + if (!empty($member_info['username'])) $members_array[] = "".$member_info['username'].""; } echo "

Members: ".implode(", ", $members_array)."

"; } + if (!empty($group['image_list'])) echo "

Images: ".count(explode(" ", $group['image_list']))."

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

Created at: ".$upload_time->format('d/m/Y H:i:s T').""; ?> @@ -88,8 +91,8 @@ ?> diff --git a/profile.php b/profile.php index 89baf0f..7c572ef 100644 --- a/profile.php +++ b/profile.php @@ -93,10 +93,7 @@ $("#postCount").html("Posts: "+postCount); var updateDate = new Date('format('m/d/Y T'); ?>'); - var format = {year: 'numeric', - month: 'short', - day: 'numeric' - }; + var format = {year: 'numeric', month: 'short', day: 'numeric'}; updateDate = updateDate.toLocaleDateString('en-GB', format);