If statment for image upload width

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 2, 2012   (RSS)

Re: [zick] If statment for image upload width

By aev - February 2, 2012

Hi,

add the red line to your code and see if that does what you want. The "continue" tells the "foreach" to skip the current cycle continue with the next.


<?php foreach ($photoRecord['photos'] as $upload): ?>
<?php if ($upload['height'] > 160) continue; // Skip image if height is greater than 160 ?>
<div class="PhotoContainer">
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" border="0" class="Photo" />
<?php endif ?>
</div>
<?php endforeach ?>



-aev-

Re: [aev] If statment for image upload width

By Mikey - February 2, 2012

Thanks aev

It works like a charm.
I really appreciate the help!

Zick

Re: [zick] If statment for image upload width

By aev - February 2, 2012

Good!


Maybe this could be of interest as well:
http://www.interactivetools.com/iforum/gforum.cgi?post=86562;search_string=print_r;t=search_engine#86562

Remember to adjust the array names ($selectedRecord/$categoryRecords) to reflect your array names.


-aev-