if else with images uploaded using code generator

5 posts by 2 authors in: Forums > CMS Builder
Last Post: October 23, 2015   (RSS)

By Twocans - October 22, 2015

hello,
I have been playing with the CMS code generator, and I am hugely impressed. I have a problem thought. When the user uploads an image I also have a check-box for them to click so as to show hide the big images were they in need to do so. The values are either 1, or 0

Check to Show Big Image (value): <?php echo $record['check_to_show_big_image'] ?><br/>
Check to Show Big Image (text): <?php echo $record['check_to_show_big_image:text'] ?><br/>

The code above the code generator creates but I have been trying to do an if else for that but get errors all the time.

anyway I have tried using an if statement with the following.

<?php if ($record['check_to_show_big_image']) > 0 ?>image shown here

<?php else: ?>No image shown

<?php endif ?>

It does not work.

I would be very grateful for any input on this to get it working.

regards and cheers

kenny

By Twocans - October 22, 2015

wow sorry,

<?php if ($home_page_big_imagesRecord['check_to_show_big_image'] == '1'): ?> ...my pics...
<?php endif ?>

the above works for me but hehe if its wrong let me know..

cheers

Kenny

By Daryl - October 22, 2015

Hi Kenny,

That's correct. Or you can do it this way too:

<?php if ($home_page_big_imagesRecord['check_to_show_big_image']): ?>
...my pics...
<?php endif ?>

Cheers,

Daryl Maximo
PHP Programmer - interactivetools.com

By Twocans - October 23, 2015

Thanks another quick question on the upload.

I have use the code generator twice on the same page, aka for 2 different sets and both of these recordsets have images. 

My problem is Calling these variables on my page as both are called "<?php echo htmlencode($upload['urlPath']) ?>

how can I get both to show as one is on the top of my page and the others are placed on the bottom of the page. But only can get the top ones to show due to <?php echo htmlencode($upload['urlPath']) ?> is the same for both ?

regards

kenny