jarv
08-20-2012, 05:04 PM
hi,
my code below shows up to 6 thumbnail images I want to only show the thumbnails if there are more than 1 *note this one is not in the range: <img src="'.escape($directory['items']['photo']).'" alt="" />
Please help
if (!empty($directory['items']['photo'])) {
$list = array();
foreach ( range( 1, 6 ) as $i ) {
if ( ! $image = escape($directory["items"]["photo_$i"]))
continue;
$list[] = "<li><img src='$image' alt='' /></li>";
}
echo ' <div id="image" class="photo"></div>';
echo '<ul class="gallery">';
echo '<li class="active"><img src="'.escape($directory['items']['photo']).'" alt="" /></li>';
if ( $list )
echo implode( "\n", $list );
echo '</ul>';
my code below shows up to 6 thumbnail images I want to only show the thumbnails if there are more than 1 *note this one is not in the range: <img src="'.escape($directory['items']['photo']).'" alt="" />
Please help
if (!empty($directory['items']['photo'])) {
$list = array();
foreach ( range( 1, 6 ) as $i ) {
if ( ! $image = escape($directory["items"]["photo_$i"]))
continue;
$list[] = "<li><img src='$image' alt='' /></li>";
}
echo ' <div id="image" class="photo"></div>';
echo '<ul class="gallery">';
echo '<li class="active"><img src="'.escape($directory['items']['photo']).'" alt="" /></li>';
if ( $list )
echo implode( "\n", $list );
echo '</ul>';