Hey guys,
Well, the script below works 100% fine, but after it starts to load 100+ images (or however many are in the folder) it takes forever to load the whole page and eventually times out. This is not good.
Is there any way that the code below could be made so that only 20 images are displayed per page?
NP$ will be rewarded to any individual that can help get this 'paginating' (or whatever the correct term be).
Thanks guys,
Andy
Well, the script below works 100% fine, but after it starts to load 100+ images (or however many are in the folder) it takes forever to load the whole page and eventually times out. This is not good.
Is there any way that the code below could be made so that only 20 images are displayed per page?
Code:
<?
//get directory handle
$hook = opendir("animals");
//start the table
echo "<table>\n";
echo "<tr>\n";
$counter = 0;
//read directory and echo list
while (($file = readdir($hook)) !== false)
{
if (($file !== ".")&&($file !== "..")) {
// start a new row
if ($counter == 5)
{
echo "</tr>\n<tr>\n";
$counter = 0;
}
echo "<td>\n<a href=\"aim:BuddyIcon?src=http://www.iming.org/imstuff/buddyicons/animals/$file\">\n<img src=\"http://www.iming.org/imsite/buddyicons/animals/$file\" border=0></a></td>\n";
// add 1 to counter, or go back to 1
$counter = $counter + 1;
}
}
// need to fill up last row with empty columns
while ($counter < 5)
{
echo "<td></td>\n";
++$counter;
}
// close row and table
echo "</tr>\n";
echo "</table>\n";
//set up full path
$path = $location."/".$file;
//check for directory
if (is_dir($path))
//close directory
closedir($hook);
?>
NP$ will be rewarded to any individual that can help get this 'paginating' (or whatever the correct term be).
Thanks guys,
Andy






