
HDLLC
User
Jan 31, 2012, 7:42 AM
Post #1 of 3
(148 views)
Shortcut
|
|
Building table for uploads (photos)....
|
Can't Post
|
|
I've been able to build a table (ie: four across images, then start new row, repeat) using upload fields for images - but trying a different way where the field allows multiple images, and I want them to show in a nice table 4 across per row. Here's what I did have -
<table width="133" border="0" align="center" cellpadding="3" cellspacing="3"> <tr> <?php foreach ($live_buckeye_deer_camsRecords as $record): ?> <td align="center" valign="top"><?php foreach ($record['photos'] as $upload): ?> <?php if ($upload['hasThumbnail']): ?> <a href="<?php echo $record['_link'] ?>"> <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" border="0" /></a><br/> <?php elseif ($upload['isImage']): ?> <a href="<?php echo $record['_link'] ?>"><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" border="0" /></a><br/> <?php else: ?> <a href="<?php echo $upload['urlPath'] ?>">No Thumbnail Available</a><br/> <?php endif ?> <?php endforeach ?> </td> <?php $maxCols=4; if (@++$count % $maxCols == 0): ?> </tr> <tr> <?php endif; ?> <?php endforeach; ?> </tr> </table> <div align="center"><br /> <br /> <?php if ($live_buckeye_deer_camsMetaData['invalidPageNum']): ?> Results page '<?php echo $live_buckeye_deer_camsMetaData['page']?>' not found, <a href="<?php echo $live_buckeye_deer_camsMetaData['firstPageLink'] ?>">start over >></a>.<br/> <br/> <?php elseif (!$live_buckeye_deer_camsRecords): ?> No records were found!<br/> Doesn't work with an upload field where I have 20 images per record. That code above works for multiple records. How can I do this type of table building when I have an upload field, in one record, that has multiple images per upload ? Hope I'm explaining this right... Thanks much in advance! ---Jeff
|