<?php
function thumbList($folder, $thumb, $img)
{
$banned =
array(".",
"..",
"index.php",
"error_log");
//leave blank
$html = '<ul class="thumbNail">';
{
// List all the files
while ( false !==
( $file =
readdir($handle) ) ) {
$ok = false;
{
//if file contains _thumb, do not link to it
{
$ok=false;
} else {
$ok=true;
}
$file =
substr($file,
0,
$pos);
//if the item is the normal img, display corresponding thumb and link to large img
if($ok)
$html .= "<li><a href='$file$img' title='$file'><img src='$file$thumb' /></a></li>";
}
}
$html .= '</ul>';
}
}
//Set all your variables here and call the function for each folder
$folder = ".";
$thumb = "_thumb.jpg";
$img = ".jpg";
thumbList($folder, $thumb, $img);
?>
</ul>