-
Notifications
You must be signed in to change notification settings - Fork 3
/
quick-gallery.php
42 lines (36 loc) · 1.15 KB
/
quick-gallery.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
// images directory
$imagesDirectory = "uploads";
// list of files to skip
$toSkip = [".", "..", ".htaccess", ".htpasswd"];
?>
<section id="quickGallery" class="slideInLeft">
<h1>Gallery</h1>
<?php
$images = scandir($imagesDirectory);
if (empty(array_diff($images, $toSkip))) {
echo "<p>No images in <b>$imagesDirectory</b> directory</p>";
} else {
foreach ($images as $fileName)
{
if (in_array($fileName, $toSkip)) continue;
echo <<<_EOF
<div class="galleryImage">
<a href="javascript:void(0);" class="openBtn" data-src="$imagesDirectory/$fileName">
<img src="$imagesDirectory/$fileName" alt="$fileName">
</a>
</div>
<!-- /.galleryImage -->
_EOF;
}
}
?>
</section>
<!-- /#quickGallery -->
<div id="imagePreview" class="quickModal">
<div id="modalContent">
<span class="closeBtn"><i class="fa fa-times" aria-hidden="true"></i></span>
<img src="#" alt="">
</div>
</div>
<!-- /#imagePreview -->