mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-07-03 14:26:19 +00:00
Terrible terrible code
This commit is contained in:
parent
afdaab4e13
commit
59de59024c
2 changed files with 16 additions and 3 deletions
13
group.php
13
group.php
|
@ -309,6 +309,19 @@
|
||||||
|
|
||||||
$group_list = mysqli_query($conn, "SELECT * FROM groups ORDER BY id DESC");
|
$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) {
|
foreach ($group_list as $group) {
|
||||||
$image_list = array_reverse(explode(" ", $group['image_list']));
|
$image_list = array_reverse(explode(" ", $group['image_list']));
|
||||||
$image = $image_info->get_image_info($conn, $image_list[array_rand($image_list, 1)]);
|
$image = $image_info->get_image_info($conn, $image_list[array_rand($image_list, 1)]);
|
||||||
|
|
|
@ -94,12 +94,12 @@
|
||||||
// Check for NSFW tag
|
// Check for NSFW tag
|
||||||
if (str_contains($image['tags'], "nsfw")) {
|
if (str_contains($image['tags'], "nsfw")) {
|
||||||
echo "<div class='gallery-item'>
|
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']."' 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']."'><img class='gallery-image nsfw-blur' loading='lazy' src='".$image_path."' id='".$image['id']."'></a>
|
||||||
</div>";
|
</div>";
|
||||||
} else {
|
} else {
|
||||||
echo "<div class='gallery-item'>
|
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>";
|
</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue