Hi there,
I'm trying to create a fully automatic image gallery. I already have
the page
that automatically creates the index of thumbnails.
What i want now, is to create a page which indexes which galleries
there are;
each gallery is in a folder, so it has to check for folders, and if it
excists
automatically grab the first thumbnail, and put it in a table, and it
puts the
name of the gallery/folder beneath it.
I already got this far, but what i want, is that you get 4 thumbnails
next to
each other, and then automatically the next row.
What i have is the next code:
<?php
$the_array = Array();
$handle = opendir('.');
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != "index.php") { /* as
descripted below: these "files" will not be added to the array */
$the_array[] = $file;
}
}
closedir($handle);
foreach ($the_array as $element) {
echo "<table width=104 height=104 border=0 cellpadding=0
cellspacing=0 class=pictable>
<tr>
<td align=center valign=middle><a href=./$element target=_self
onFocus=this.blur()><img src=./$element/tmb/01.gif alt=$element
width=90 height=90 border=0></a></td>
</tr>
</table>";} ?>
So every gallery has the same structure: index.php, and 2 folders; pix
& tmb
What i want is:
_________________________________
| | | | | | | |
| | | | | | | |
| img | | img | | img | | img |
| | | | | | | |
_________________________________
_________________________________
| | | | | | | |
| | | | | | | |
| img | | img | | img | | img |
| | | | | | | |
_________________________________
Hope this is clear:
I only want a table, if there is a folder.
Between every table, i want a column, so the 4
images are equally spread.
Sorry for the long question...
Greetz Krunkelgarten