-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
46 lines (38 loc) · 1.68 KB
/
index.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
43
44
45
46
<?php
include('includes/header.php');
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/jquery.lazy.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.lazy/1.7.9/jquery.lazy.min.js"></script>
<?php
if(isset($_SESSION['folder'])){
echo "<div id=\"lazy-container\">";
date_default_timezone_set('America/New_York');
$mainDir = '../../KG_uploads';
$subDirectories = scandir($mainDir);
unset($subDirectories[0]);
unset($subDirectories[1]);
foreach($subDirectories as $subDirectory) {
foreach(glob($mainDir.'/'.$subDirectory.'/*') as $file){
if (!substr($file, 0, 1) != '.') {
$image_size = getimagesize("$mainDir/$subDirectory/$file");
$image_name = basename($file);
$user = str_replace("/","",dirname(substr($file, strpos($file, '/', 6))));
echo "<h3 class=\"lazy\">By $user</h3>";
$directory = dirname($file);
echo "<img class=\"lazy\" data-src=\"show_image.php?image=$image_name&imgLocation=$directory\"/>";
}
}
}
echo "</div>"; } ?>
<section id="info">
<h3>info</h3>
<p>This is a place to upload pictures of your cats</p>
</section>
<script type="text/javascript" src="./js/jquery.lazy.min.js"></script>
<script> $(function() {
$('#lazy-container .lazy').lazy({
appendScroll: $('#lazy-container')
});
});</script>
<?php include('includes/footer.php'); ?>