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

OK, so I'm building a multi-menu layout for a photo gallery to include 5 columns, as I've done before with WYSIWYG styles, but never UPLOAD stlyes.

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

Hi Misery -

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

Didn't this statement close it?

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

Which is right before the

<?php endforeach ?>

Statement?

Re: [Perchpole] Multi-Type Error in Gallery Layout

By misery217 - April 14, 2009

That was exactly the issue. Thank you ever so much!