Photos to appear in differnet colums

13 posts by 2 authors in: Forums > CMS Builder
Last Post: September 17, 2008   (RSS)

By Dave - September 17, 2008

It looks good. Try switching this:
<?php foreach ($record['mainphoto'] as $upload): ?>

Back to this:
<?php foreach ($malesRecords['mainphoto'] as $upload): ?>

You always need to use the variable names you set at the top of the file. You can see them set here:

list($malesRecords, $malesMetaData) = getRecords(array(
'tableName' => 'males',
));

Let me know if that gets you any further.
Dave Edis - Senior Developer
interactivetools.com

By Dave - September 17, 2008

Oh I see. You need two loops. One to display each record, and one to display each upload within the record:

<?php foreach ($malesRecords as $record): ?>
<table border="1" cellspacing="0" cellpadding="0"><tr>
<?php foreach ($record['mainphoto'] as $upload): ?>
<td> <a href="<?php echo $upload['urlPath'] ?>" target="_blank"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" border="0" /></a><br><br> </td>

<?php $maxCols=3; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>

<?php endforeach ?>
</tr></table>
<?php endforeach ?>


If it still doesn't work feel free to send me FTP (by email to dave@interactivetools.com, don't post FTP to forum) and I'll take a look.
Dave Edis - Senior Developer
interactivetools.com