| 
//this function is used to resize and display images
 /*
 imagefile - the file name of the image
 alt - the tooltip text that appears when you hover over the image
 limiter - which value you want to limit - 0 for width, 1 for height
 limitervalue - the maximum value that the limiter value can be
 isthumbnail - whether or not to make the image into a thumbnail (if yes, then acts as link to itself) - 0 for no, 1 for yes
 caption - caption you want to appear under the text ("" for no caption)
 align - the div class to use ("" for no div tag)
 class - the class you would like the image to be ("" for none)
 
 styles that should be in the page's stylesheet...
 imageLink (needed if the isthumbnail parameter is 1) - recomended property - background-color: transparent;
 caption (needed if the caption parameter is set)
 */
 
 function resizeimage ($imagefile, $alt, $limiter, $limitervalue, $isthumbnail, $caption, $align, $class){
 $picsize=getimagesize($imagefile);
 if($picsize[$limiter]>$limitervalue){
 $timestoobig=$picsize[$limiter]/$limitervalue;
 $picwidth=floor($picsize[0]/$timestoobig);
 $picheight=floor($picsize[1]/$timestoobig);
 }else{
 $picwidth=$picsize[0];
 $picheight=$picsize[1];
 }
 $outString = "";
 if($align != ""){ $outString .= "<div class=\"".$align."\">"; }
 if($isthumbnail==1){ $outString .= "<a href=\"".$imagefile."\" target=\"_blank\" class=\"imageLink\">"; }
 $outString .= "<img src=\"".$imagefile."\" alt=\"".$alt."\" width=\"".$picwidth."\" height=\"".$picheight."\"";
 if($class != ""){ $outString .= " class=\"".$class."\""; }
 $outString .= " />";
 if($caption != ""){ $outString .= "<br /><span class=\"caption\">".$caption."</span>"; }
 if($isthumbnail==1){ $outString .= "</a>"; }
 if($align != ""){ $outString .= "</div>\n"; }
 print($outString);
 }
 
 |