Multi-Type Error in Gallery Layout
5 posts by 2 authors in: Forums > CMS Builder
Last Post: April 14, 2009 (RSS)
By misery217 - April 12, 2009
So here's my existing code:
<tr><?php foreach ($galleryRecord['images'] as $upload): ?>
<td width="144" align="center" valign="top">
<?php if ($upload['hasThumbnail']): ?><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/></td>
<?php $maxCols=5; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif ?>
<?php endforeach ?>
</tr>
And with this I get the error:
"Parse error: syntax error, unexpected T_ENDFOREACH in /home/francesl/public_html/gallery/indexDetail.php on line 112"
But the syntax as I've used before is the same?
Any ideas as to what gives?
Thanks!
Re: [misery217] Multi-Type Error in Gallery Layout
By Perchpole - April 12, 2009
The error is due to the fact that you have not closed your first "if" argument...
<?php if ($upload['hasThumbnail']): ?>
You need to close this before the <?php endforeach ?> [/#ff0000]statement.
:0)
Perchpole[/#000000]
Re: [misery217] Multi-Type Error in Gallery Layout
By misery217 - April 13, 2009
<?php $maxCols=5; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif ?>
Which is right before the
<?php endforeach ?>
Statement?
Re: [misery217] Multi-Type Error in Gallery Layout
By Perchpole - April 13, 2009
No, because <?php $maxCols=5; if (@++$count % $maxCols == 0): ?>[/#ff0000] is also an "if" statement.
In other words, you need two closing "endif" statements.
:0)
Perch
Re: [Perchpole] Multi-Type Error in Gallery Layout
By misery217 - April 14, 2009