PHP Classes

Thumbnails

Recommend this page to a friend!

      Thumbnails  >  All threads  >  Thumbnails  >  (Un) Subscribe thread alerts  
Subject:Thumbnails
Summary:little modification
Messages:2
Author:Kerroch
Date:2005-09-27 16:32:06
Update:2005-09-27 16:43:47
 

  1. Thumbnails   Reply   Report abuse  
Picture of Kerroch Kerroch - 2005-09-27 16:32:06
Hello,

I propose some little modifications for the class called class.image.php.

If there is an image which has not a good extension,the number of images displayed is not good.

I have added a variable named $invalid which decrease the number of invalid image from the total number of files in the folder.


class AffichImage
{
// show directory content
function showDir($dir, $i, $lar, $lon, $lin)
{
.......script .....

if($tmp[1] == 'jpg' OR $tmp[1] == 'bmp' OR $tmp[1] == 'gif' OR $tmp[1] == 'png' OR $tmp[1] == 'tga' OR $tmp[1] == 'tif' OR $tmp[1] == 'eps')

{
print("<td>") ;
print("<table class='box' bgcolor='#9ABBC1' cellspacing='0'

script ......script.....

print("</tr></table>\n") ;
print("</td>") ;
}
else
{$x-- ;
$invalid++; // modified}
}
print("</tr></table>\n") ;
print("<br><small>" . ($k-$invalid). " Images displayed<b></b></small>") ;
}
closedir($checkDir);
}
}

}



best regards
kerroch



  2. Re: Thumbnails   Reply   Report abuse  
Picture of Kerroch Kerroch - 2005-09-27 16:43:47 - In reply to message 1 from Kerroch
to be complete, a last change:

replace:
print("<td align='center'><small><b>" . ($k+1) . "</b></small></td></tr><tr>") ;


by

print("<td align='center'><small><b>" . ($k+1-$invalid) . "</b></small></td></tr><tr>") ;


bye
Kerroch