//************************************************************//
// //
// PHP Image Gallery v2.0 //
// Author: Brian Mahler //
// Copyright (c) 2006 Brian Mahler //
// //
// This script is free to use and modify to your needs as //
// long as this copyright notice remains in tact. //
// //
//************************************************************//
//
// CSS to position and change appearance
// Modify these settings to change the appearance of the page
//
?>
PHP Slideshow v2.0 by Brian Mahler
//
// Configuration Settings
//
define('IMAGE_WIDTH',480); //Width of image in pixels
define('THUMBNAIL_SIZE',60); //Width of thumbnails in pixels
define('THUMB_MAX_HEIGHT',360); //Max height of the thumbnails window in pixels
define('THUMB_COLS',4); //Sets the number of Columns to use in the thumbnails
//---------------------------------------------Do not Edit below this line----------------------------------------------
// Unless you have knowledge of PHP
//Get the path to the current directory
$z = split('/', $_SERVER['SCRIPT_FILENAME']);
$thisname = $z[count($z)-1];
if (!isset($_GET['path'])){
$path = str_replace($thisname, '', $_SERVER['SCRIPT_FILENAME']);
}else{
$path = "./" . $_GET['path'];
}
//Define allowed file extensions
$allowed = array('jpg','gif','png');
//Read through the directory and find all files with proper file extensions
$dir = dir($path);
while ($file = $dir->read()) {
if (($file != '.') && ($file != 'CVS') && ($file != '..')) {
$file_size = filesize($path . $file);
$file_extension = file_ext($file);
if(!is_dir($path . $file) && isset($file_extension) && in_array($file_extension, $allowed)) {
$images[] = array('name' => $file,
'size' => $file_size);
}
}
}
?>
//Check for images present in the directory
if ($count < 1){
die('
No images present in current directory
');
}
//Create the image navigation table
$image_nav = '
';
for ($x=1; $x<=$count; $x++){
if ($x <= $count){
$url = $images[$x -1]['name'];
$image_nav .= '