forked from sdevaney/Deltoria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getpics.php
30 lines (27 loc) · 1.09 KB
/
getpics.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
<?
/**************************************************************************************
* Deltoria.com *
* (c)1999-2010 Scott Devaney, All rights reserved *
* Distribution Prohibited *
**************************************************************************************/
// Gets full pictures for album
Header("content-type: application/x-javascript");
function returnimages($dirname="./images/album/full") {
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
$filedate=date ("M d, Y H:i:s", filemtime($file));
echo 'galleryarray[' . $curimage .']=["' . $file . '", "'.$filedate.'"];' . "\n";
$curimage++;
}
}
closedir($handle);
}
return($files);
}
echo "var galleryarray=new Array();" . "\n";
returnimages();
?>