mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-01-29 17:28:27 +00:00
Terrible terrible code
This commit is contained in:
parent
afdaab4e13
commit
59de59024c
13
group.php
13
group.php
|
@ -309,6 +309,19 @@
|
|||
|
||||
$group_list = mysqli_query($conn, "SELECT * FROM groups ORDER BY id DESC");
|
||||
|
||||
if (empty($group_list) && !$_SESSION["loggedin"]) {
|
||||
?>
|
||||
<style>
|
||||
.gallery-root {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$('body').append("<div class='info-text defaultFonts'><h1>There are no groups yet</h1><p>Login to make a group!</p></div>");
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
foreach ($group_list as $group) {
|
||||
$image_list = array_reverse(explode(" ", $group['image_list']));
|
||||
$image = $image_info->get_image_info($conn, $image_list[array_rand($image_list, 1)]);
|
||||
|
|
|
@ -94,12 +94,12 @@
|
|||
// Check for NSFW tag
|
||||
if (str_contains($image['tags'], "nsfw")) {
|
||||
echo "<div class='gallery-item'>
|
||||
<a href='image.php?id=".$image['id']."' class='nsfw-warning'><img class='svg' src='assets/icons/warning_red.svg'><span>NSFW</span></a>
|
||||
<a href='image.php?id=".$image['id']."'><img class='gallery-image nsfw-blur' loading='lazy' src='".$image_path."' id='".$image['id']."'></a>
|
||||
<a href='image.php?id=".$image['id']."' class='nsfw-warning'><img class='svg' src='assets/icons/warning_red.svg'><span>NSFW</span></a>
|
||||
<a href='image.php?id=".$image['id']."'><img class='gallery-image nsfw-blur' loading='lazy' src='".$image_path."' id='".$image['id']."'></a>
|
||||
</div>";
|
||||
} else {
|
||||
echo "<div class='gallery-item'>
|
||||
<a href='image.php?id=".$image['id']."'><img class='gallery-image' loading='lazy' src='".$image_path."' id='".$image['id']."'></a>
|
||||
<a href='image.php?id=".$image['id']."'><img class='gallery-image' loading='lazy' src='".$image_path."' id='".$image['id']."'></a>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue