I can't get it to work!
This is the script that I think needs changing:
it's php4 if that helps!! See below:
<?php
function php_thumbnails($imagefolder,$thumbfolder,$lightbox)
{
//Get image and thumbnail folder from function
$images = "portfolio/" . $imagefolder; //The folder that contains your images. This folder must contain ONLY ".jpg files"!
$thumbnails = "portfolio/" . $thumbfolder; // the folder that contains all created thumbnails.
//Load Images
//load images into an array and sort them alphabeticall:
$files = array();
if ($handle = opendir($images))
{
while (false !== ($file = readdir($handle)))
{
//Only do JPG's
if(eregi("((.jpeg|.jpg)$)", $file))
{
$files[] = array("name" => $file);
}
}
closedir($handle);
}
//Obtain a list of columns
foreach ($files as $key => $row)
{
$name[$key] = $row['name'];
}
//Put images in order:
array_multisort($name, SORT_ASC, $files);
//set the GET variable name
$pic = $imagefolder;
//Thumbnails
//Recursively go trough the array of images and add thmubnails to the page:
foreach ($files as $file)
{
$addy = $_GET[$pic];
$string = $file['name'];
// Print the currently viewed thumbnail
if( $addy == $file['name'] AND $lightbox == "lb-off")
{
$name = $file['name'];
$splitname = explode (".", $name);
$pictitle = str_replace("_"," ",$splitname[0]);
echo("<img class=\"thumb_active\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"> \n");
}
// Print thumbnails with link
else
{
// Check if thumbnail already created
$name = $file['name'];
$splitname = explode (".", $name);
$pictitle = str_replace("_"," ",$splitname[0]);
if( $lightbox == "lb-on")
{
$link = "<a rel=\"lightbox[" . $images . "]\" title=\"$splitname[0]\" href=\"" . $images . "/" . $name . "\">";
}
else
{
$link = "<a href=\"?" . $pic . "=" . $file['name'] . "\">";
}
if (file_exists("$thumbnails/$splitname[0]_thumb.jpg"))
{
// Load the thumbnail image
echo($link);
echo("<img class=\"thumb\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"></a> \n");
}
else
{
// Create a thumbnail image
echo($link);
echo("<img class=\"thumb\" src=\"thumbnail.php?imagefolder=" . $images . "&thumbfolder=" . $thumbnails . "&name=" . $file['name'] . "&im=" . $images . "/" . $file['name'] . "\" alt=\"$pictitle\"></a> \n");
}
}
}
reset($files);
}
?>