Hi,
I suppose you'd have to get the directory content listing into an array, and use that to display your files:
You need to replace:
while($entry=$d2->read()) {
if ( $entry != "." && $entry != ".." && $entry != ".total" ) {
$linecount++;
}
with
while($entry=$d2->read()) {
if ( $entry != "." && $entry != ".." && $entry != ".total" ) {
$linecount++;
$entries[$linecount] = $entry;
}
Then you need to work
$currcount=1;
$d2 = dir($incldir);
while($entry=$d2->read()) {
if ( $entry != "." && $entry != ".." ) {
if ( $currcount < $endcount && $currcount >= $pagecount )
{
echo "<a href=\"".$directory."${entry}\"><img src=\"".$incldir."${entry}\" width=\"100\"border=0></a> ";
}
$currcount++;
to
for($currcount=1; $currcount < $endcount; $currcount >= $pagecount )
{
echo "<a href=\"".$entries[$currcount]."\"><img src=\"".$incldir.".$entries[$currcount]."\" width=\"100\"border=0></a> ";
}
$currcount++;
and tweak this a little.
J.