tag)
$hSub = 90; // Height of subfolder thumbs
/***** No further user set options below here. *****/
/* TODO: script execution clock */
/*
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$begintime = $time;
*/
// TODO: the following must also be the same in image_resize.php
//$cache_thumbs = 1; // Set to 1 to store thumbs in _di-cache directory in root folder
$cache_dir = '_di-cache'; // Name of cache directory if you so choose
/* setup the script */
$rootdir = stripslashes(dirname($_SERVER['SCRIPT_NAME']));
$rootlink = htmlentities($rootdir, ENT_QUOTES).'/';
// If not specified, use top folder for gallery name
if(!$rootname){
$rootname = explode('/', $rootdir);
$rootname = htmlentities(end($rootname), ENT_QUOTES);
}
if ($_GET[d])
{
$d = stripslashes(urldecode($_GET['d'])); // remove escape characters
$d_string = 'd='.urlencode($d).'&'; // for use in passing to URL strings
$d .= '/'; // put trailing slash after its converted to a string
$current_dir .= $d;
$replace = array ("_", "/", "\\");
$with = array (" ", " - ", "");
$title = htmlentities(str_replace($replace, $with, $_GET[d]), ENT_QUOTES);
}
else
$title = 'Home';
if($pg = $_GET['pg'])
{
$start_from = (($pg-1)*$limit);
$pg_string = 'pg='.$pg.'&';
}
else
$img = 0;
if(ereg("\.\.", $_GET['d'])) // important to prevent browsing upper directories
header ("Location: ?");
// additional paramaters for (thumbnails) - based on whether name or dimensions is displayed
$pwidth = $w+12;
$pheight = $h+12;
if($ititle)
$pheight +=10; // increase height of thumbnail
element
if($isize || $idim) // if displaying dimensions or size of image, increase height of thumbnail
element.
$pheight +=10;
/*** Get list of folders ***/
$folder_list = count_folders();
$num_folders = count($folder_list);
/*** Get list of Images ***/
$img_list = array();
if ($dir = opendir("./$current_dir"))
{
while ($file = readdir($dir))
{
if ((eregi('((.jpg)|(.gif)|(.png))', $file)) && ($file != $icon)) // Don't add the icon to the list
$img_list[] = $file;
}
closedir($dir);
}
asort($img_list); // sort alpha
$num_images = count($img_list); // total number of images in folder
$whole_img_list = $img_list; // save it before we chunk it
$paginated = array_chunk($whole_img_list, $limit);
if ($pg)
$img_list = $paginated[($pg-1)];
$num_remain = $num_images-$start_from; // total remaining thumbs in the array (current directory)
?>
-