From: Brendan F. <drs...@gm...> - 2008-11-14 13:46:19
|
> > Hi, > > I added a small piece of PHP to the font pages on > openfontlibrary.fontly.org and I'm a poor programmer so I thought I'd > post this and see if anyone had suggestions to improve it, or can spot > any bugs :-) > > <? > if (empty($imageUrls[0])) { > print "<!-- No sample images yet -->"; > } else { > print "<div class=\"sample_images\">"; > if (empty($imageUrls[1])) { > print "<h3>Sample Image</h3>"; > } else { > print "<h3>Sample Images</h3>"; > } > foreach(@$imageUrls as $imageUrl) { > print "<div class=\"centered sample_image\"><img > src=\"${imageUrl}\" alt=\"An image showing the typeface in use, > contributed by a user\" /></div>"; > } > print "</div>"; > } > ?> How many sample images might there be? Is there a limit? Will $imageUrls[0] always be full when images are present, might you have $imageUrls[1] full while $imageUrls[0] is null? If for example the first image is deleted? |