Hi there Red010Knight,
That sounds great :) - I think a non-database version would be preferable for this page of mine. Is there a way to do it so that all I have to do is have a folder on ther server and just add the images to that and then drop the PHP file in the folder also and call it like this:
<img src="http://www.domain.com
or is that too simplisic a view? :)
Thanks
Myraa
Main Topics
Browse All Topics





by: red010knightPosted on 2003-10-31 at 06:49:29ID: 9657873
The code is rather straightforward. And made even easier through the use of a database. .jpg"; pg";
_array($re sult_Pics) { "]."/">"; "]."/" alt=/"".$images["alt"]."/" >";
"_Alt"; orm.jpg/"> "; umb.jpg/" alt=/"".$altRef."/">";
You just need to set up a table of data, whether it is in your php code like:
pic1_thumb="filename_thrmb
pic1_Norm="filename_Norm.j
....
or in your database with fields picID, thumbFile, normFile;
Optional fields are: displayOrder and altText(recommended)
Then in your php,
you would either use a database call to get the data, then echo it back with:
$loopCount=0;
$displayPics="<tr>";
while($images=$mysql_fetch
$loopCount=$loopCount+1;
if($loopCount%6=0){ //You may want to change the number to be based on img sizes.
$displayPics="</tr><tr>";
}
$displayPics.="<td><a href=/"".$images["normFile
$displayPics.="<img src=/"".$images["thumbfile
$displayPics.="</a></td>"
}
$displayPics.="</tr>";
if you did it declaring everything in file, you would need to ensure a naming convention and keep all files in the same place. So the loop would be basically the same
$altRef="$pic".$loopCount.
$displayPics.="<td><a href=/"pic".$loopCount."_N
$displayPics.="<img src=/"pic".$loopCount."_Th
$displayPics.="</a></td>"
That should do the trick,
Hope it helps and happy coding!
Red010Knight