Guess what, even more bugs!

This commit is contained in:
Michał 2022-09-29 15:39:30 +00:00
parent 9212267777
commit 956758fa25
3 changed files with 20 additions and 23 deletions

View file

@ -387,13 +387,6 @@
if (empty($check_sanity) || !isset($check_sanity)) {
echo "<p class='btn btn-good' style='outline: none;'>No errors! Lookin' good</p>";
?>
<style>
.sanity-check {
border-color: var(--page-accent);
}
</style>
<?php
} else {
?>
<style>

View file

@ -35,7 +35,7 @@
if ($user_info->is_admin($conn, $_SESSION['id'])) {
$check_sanity = $sanity->get_results();
if (!empty($check_sanity) || isset($check_sanity)) {
if (!empty($check_sanity)) {
?>
<script>
sniffleAdd('Uh oh', 'Website has not passed some Sanity checks, please check your settings for more information', 'var(--warning)', 'assets/icons/warning.svg');

View file

@ -74,21 +74,23 @@
?>
</div>
<div id="gallery" class="gallery-root defaultDecoration">
<?php
<?php
// Reading images from table
$sql = "SELECT * FROM images WHERE author = ? ORDER BY id DESC";
// Reading images from table
$sql = "SELECT * FROM images WHERE author = ? ORDER BY id DESC";
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 = $_GET['user'];
$stmt->execute();
$query = $stmt->get_result();
if (mysqli_num_rows($query) != 0) {
echo "<div id='gallery' class='gallery-root defaultDecoration'>";
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 = $_GET['user'];
$stmt->execute();
$query = $stmt->get_result();
while ($image = mysqli_fetch_array($query)) {
// Getting thumbnail
if (file_exists("images/thumbnails/".$image['imagename'])) {
@ -109,9 +111,11 @@
</div>";
}
}
echo "</div>";
}
?>
</div>
}
?>
<script>
var postCount = $("#gallery").children().length;