| Current Path : /home/juvelize/www/modules/mod_artsexylightbox_lite/ |
| Current File : /home/juvelize/www/modules/mod_artsexylightbox_lite/imglist.php |
<?php
if ($handle = opendir('.')) {
$url = curPageURL();
$url = substr($url, 0, -11);
while ($entry = readdir ($handle)) {
if ($entry != '.' && $entry != '..' && isImage($entry)) {
echo $url . $entry . '<br />';
}
}
}
function isImage($fileName) {
$extensions = array('.jpeg', '.jpg', '.gif', '.png', '.bmp', '.tiff', '.tif', '.ico', '.rle', '.dib', '.pct', '.pict');
$extension = substr($fileName,strrpos($fileName,"."));
if (in_array($extension, $extensions)) return true;
return false;
}
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>