Dynamic Photo gallery

2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 11, 2008   (RSS)

By Berkowitz - June 11, 2008

Hi,

I'm creating a photo galelry. I wanted to know if there's a possibility to know the width and height of a picture (entire picture not the thumb) in the upload field when you click a thumb (in my case a little number). The reason I need this is to make the iframe, where the pic loads, Dynamic.

Example url: http://www.ciedesmaisonsdecharme.be/pages/projectDetails.php?Een-Dorpswoning-in-Damme-10

When you click the link you'll see three numbers, when you click them a picture will load. When you click number one you'll see a picture and the rest of the iframe is white. But my client's site is in Black so that's a rather ugly view. so i want the iframe to dynamicly change to the widht and height of every picture so you don't see the white.
Do you understand what I mean? Would be cool if this was possible [:)]

Kind regards,
Berkowitz.

Re: [Berkowitz] Dynamic Photo gallery

By Dave - June 11, 2008

Hi Berkowitz,

Assuming your variable is named $upload (you can use any name you like) you should be able to get the dimensions of the thumbnail and fullsize image with these fields:

<?php echo $upload['thumbWidth'] ?>
<?php echo $upload['thumbHeight'] ?>
<?php echo $upload['width'] ?>
<?php echo $upload['height'] ?>

Dynamically changing the size of the iframe would probably take some javascript. But you should be able to use these values to know which size you want to change it to.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com