Old code with $maxCols problem
2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 30, 2014 (RSS)
By Mohaukla - May 30, 2014
I am just trying to add a "maxCols" code to some very old code and it's not working correctly.
<tr>
<?php foreach ($pastor_listRecord['pictures'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<td colspan="7" valign="top" style="background-color:#D3D3D3; padding-left:5px; padding-top:5px"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
<?php else: ?>
No Gallery Images Available Yet<br/>
<?php endif ?></td>
<?php $maxCols=4; if (@++$count % $maxCols == 0): ?>
</tr>
<tr>
<?php endif ?>
<?php endforeach ?>
</tr>
You can see what its doing here: http://www.rbwmissions.com/pastors_full.php?Pastor-Juan-Diego-Lop-z-V-47
Im sure I am missing something simple but for whatever reason I can not see it.
Thanks for your help,
Michael
Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.
"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"
By Damon - May 30, 2014
Hi Michael,
Try this code:
<tr>
<?php foreach ($pastor_listRecord['pictures'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<td valign="top" style="background-color:#D3D3D3; padding-left:5px; padding-top:5px"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
<?php else: ?>
No Gallery Images Available Yet<br/>
<?php endif ?></td>
<?php $maxCols=4; if (@++$count % $maxCols == 0): ?>
</tr>
<tr>
<?php endif ?>
<?php endforeach ?>
</tr>
I removed the colspan="7".
Let me know if that works for you.
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/