Re: images again

From: Date: Fri, 11 Apr 2003 17:24:00 +0000
Subject: Re: images again
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143541@lists.php.net to get a copy of this message
print "<table>"; while (($files=readdir($fp))&&($files2=readdir($fp2))) { if (!isset($i)) print "<tr><td>"; if (isset($i)) print "<td>"; if (preg_match("/.jpg/",$files)) { $thumbnail = $thumbnail_dir.trim($files); $thumb_image_size = getimagesize($thumbnail); $image = $picture_dir.trim($files2); $image_size = getimagesize($image); print("<a href=\"javascript:photo_open('".$picture_dir.trim($files2)."','".$image_size [0]."','".$image_size[1]."');\"><img src=\"".$thumbnail."\" ".$thumb_image_size[3]."></a>\n"); } $i++; if ($i<5) print "</td>"; if ($i==5) { unset($i); print "</td></tr>"; } print "</table>"; ----- Original Message ----- From: "Tyler Durdin" <linuxgeek23@hotmail.com> To: <php-general@lists.php.net> Sent: Friday, April 11, 2003 5:48 AM Subject: [PHP] images again > I have this code (see below) and you guys (the list) have helped me create > it, but I am stuck one more time. I am trying to figure out how to display > the images with only 5 images per row for as many rows as it takes for all > of the images. Can someone give me an idea where to go from here to > accomplish this? Here is the code: > > <script language="javascript" type="text/javascript"> > <!-- > function photo_open(link, width, height) > { > if(!width){width = 640;} > if(!height){height = 480;} > var photoWindow = > window.open(link,"photo",'toolbar=0,location=0,directories=0,status=0,menuba r=0,scrollbars=2,resizable=0,width='+width+',height='+height); > } > //--> > </script> > > <? > $thumbnail_dir="pictures/thumbs/"; > $picture_dir="pictures/pictures/"; > $fp=opendir("$thumbnail_dir"); > $fp2=opendir("$picture_dir"); > while (($files=readdir($fp))&&($files2=readdir($fp2))) > { > if (preg_match("/.jpg/",$files)) > { > $thumbnail = $thumbnail_dir.trim($files); > $thumb_image_size = getimagesize($thumbnail); > $image = $picture_dir.trim($files2); > $image_size = getimagesize($image); > print("<a > href=\"javascript:photo_open('".$picture_dir.trim($files2)."','".$image_size [0]."','".$image_size[1]."');\"><img > src=\"".$thumbnail."\" > ".$thumb_image_size[3]."></a>\n"); > } > } > closedir($fp); > closedir($fp2); > ?> > > This code displays all of the images with proper links, but it has no form. > > > > > > _________________________________________________________________ > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#143541) next »