Picture Uploads

6 posts by 4 authors in: Forums > CMS Builder
Last Post: June 13, 2013   (RSS)

By knight_oWL19 - June 12, 2013

Hi all,

I can't for the life of me get my pictures to display.  I've tried (what seems like) everything and still nothing.  There are no errors showing up in the code and still they do not display.  Below is the code I used for one picture on the about.php page: 

<?php foreach ($aboutRecord['images'] as $index => $upload): ?>
                    <img src="<?php echo $upload['urlPath'] ?>" width="390" height="243" alt="" />
                                        <?php endforeach ?>

I've also tried:

<?php if ($upload = @$aboutRecord['about_picture'][0]):?>
                    <img src="<?php echo $upload['urlPath'] ?>" width="390" height="243" alt="" />
                                        <?php endif?>

Neither of these work.  Can someone please shed some light on the subject? 

Thankyou,

ko19

By gregThomas - June 13, 2013

Hi,

If moh3's suggestion doesn't work, could you give us a bit more information on the error. Does the page stop loading part way through? Or is the page loading but the picture's aren't displaying.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By knight_oWL19 - June 13, 2013

The page is fully loading (looks fine), however where a pic should be, there is a blank frame with x in top right.  you can view here:  http://enlightenthesoul.com/index.php   from here click on 'About'

By gregThomas - June 13, 2013

Hi,

I've had a look at the page in Chromes developer tools. When the About page loads you can see that it's trying to load the image from the URL:

http://uploads/place_image.jpg  

This is because the img tag src is:

src="//uploads/place_image.jpg"

To fix this you could try using moh3's suggestion and add the full URL to the beginning of the src tag, or if there is an extra forward slash at the beginning of the src tag you could remove it. Finally, check in your CMS Admin General Settings tab that the uploads URL doesn't start with two slashes.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Damon - June 13, 2013

Hi,

The images are now displaying. Just needed to set the full directory paths and relative URLs in the admin.

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/