mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-07-15 06:06:01 +00:00
Added thumbnails and resolution to image info
This commit is contained in:
parent
fda00c7c31
commit
29eda68d8f
3 changed files with 35 additions and 7 deletions
11
index.php
11
index.php
|
@ -42,9 +42,16 @@
|
|||
// Reading images from table
|
||||
$img = mysqli_query($conn, "SELECT * FROM swag_table");
|
||||
while ($row = mysqli_fetch_array($img)) {
|
||||
echo "<div class='gallery-item'>";
|
||||
// Getting thumbnail
|
||||
if (file_exists("images/thumbnails/".$row['imagename'])) {
|
||||
$image_path = "images/thumbnails/".$row['imagename'];
|
||||
}else{
|
||||
$image_path = "images/".$row['imagename'];
|
||||
}
|
||||
|
||||
// Image loading
|
||||
echo "<a href='https://superdupersecteteuploadtest.fluffybean.gay/image.php?id=".$row['id']."'><img class='gallery-image' loading='lazy' src='images/".$row['imagename']."' id='".$row['id']."'></a>";
|
||||
echo "<div class='gallery-item'>";
|
||||
echo "<a href='https://superdupersecteteuploadtest.fluffybean.gay/image.php?id=".$row['id']."'><img class='gallery-image' loading='lazy' src='".$image_path."' id='".$row['id']."'></a>";
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue