View Single Post
Old 10-05-2008, 09:13 PM  
jimbona
Confirmed User
 
Join Date: Jan 2007
Posts: 190
Heres a simple way to do it

PHP Code:
<?php
$i
=1;
$mid=3;
foreach (
glob("{*.jpg,*.JPG,*.gif,*.GIF}",GLOB_BRACE) as $file
{
   echo 
'<a href="./'.$file.'"><img src="./thumbs/'.$file.'" border="0" width="100" hspace="5" vspace="5"></a>';
   if(
$i == $mid)
   {
        echo 
"<br />";
       
$i=0;
   }
   
$i++;
}
?>
Drop the file into the same dir as you images in the structure of

/index.php
/thumbs/

for example.

All your images and thumbs need to have the same name.
Change $mid to the number of images you want per row.
__________________
Thanks
Paul
Thunder-Ball.net - Member
jimbona is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote