Terrible terrible code

This commit is contained in:
Michał 2022-09-29 11:56:14 +00:00
parent afdaab4e13
commit 59de59024c
2 changed files with 16 additions and 3 deletions

View file

@ -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)]);

View file

@ -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>";
}
}