Hi
I found a spoono tutorial about opening image directories and thought I could have a script which opened a thumbnail directory and displayed the thumbnail and link to the main picture. The thumbnail directory is inside the main images folder.
It is not working for some reason.
<?
// define paths
$directory = "test";
$pathrelthumb = "/path/to/$directory/thumbnails";
$paththumb = "http://url/to/$directory/thumbnails";
$pathbig = "/path/to/$directory";
// big processing
$dir_handlebig = @opendir($pathbig) or die("Unable to open $pathbig");
while ($filebig = readdir($dir_handlebig))
{
$filebig = $filelink;
}
closedir($dir_handlebig);
// main processing
$dir_handlerelthumb = @opendir($pathrelthumb) or die("Unable to open $pathrelthumb");
while ($filethumb = readdir($dir_handlerelthumb))
{
if($filethumb!="." && $filethumb!=".." && $filethumb!="chart.jpg")
// I would like to exclude the file "chart.jpg"from the file listing
echo "<a href='$pathbig/$filelink'><img src=\"$paththumb/$filethumb\" /></a> ";
}
// close thumb directory
closedir($dir_handlerelthumb);
?>
I would have liked an automatic 25% aspect ratio thumbnailer but the tutorials I found were difficult to follow.
Thanks