[thelist] Pop up images

Justin Zachan justin at jazzmanagement.com.au
Mon Mar 27 06:06:42 CST 2006

What I would ideally like to do... is not use a DB if possible... But might
be a better idea than I am doing...

Something like this

In the html I have a list of thumbs currently - once the thumb is clicked up
pops a small window with the larger image embedded
<a href="javascript:popUp('025.php')"><img src="images/025_t.jpg" alt=""
width="156" height="119"></a>
<a href="javascript:popUp('024.php')"><img src="images/024_t.jpg" alt=""
width="156" height="119"></a>

i.e. 025.php has the html with the large image called 025_l.jpg (this all
works fine)

What I would ideally like to do is...

<a href="javascript:popUp('large_image.php')"><img src="images/025_t.jpg"
alt="" width="156" height="119"></a>
(set some variable that will tell the large_image.php to select the large
image that matches the thumb.)

Does that make sense???

-----Original Message-----
From: Ian Anderson [mailto:ian at zstudio.co.uk] 
Sent: Monday, 27 March 2006 8:53 PM
To: justin at jazzmanagement.com.au; thelist at lists.evolt.org
Subject: Re: [thelist] Pop up images

Justin Zachan wrote:

> Since there are 100s of images, I was after a simple php method of 
> having just one php page for the larger images i.e. large_image.php 
> and this page would be populated with the correct image based on which 
> thumbnail was selected.

One thing I think is important in these situations is having a consistent
and meaningful naming convention for your images.

For instance, all large images can be called whatever.jpg and all thumbs can
be called whatever_thumb.jpg.

In the database, don't store the actual filenames of the images, just the
base name (e.g. "whatever"). Then, when you're iterating through the
thumbnails, your code for each one looks like:

<a href="large_image.php?id=<?php echo($imgID) ?>">
   <img src="<?php echo($imgName) ?>_thumb.jpg"> </a>

This sort of thing is good when you're using server side tools to automate
the thumbnail generation.

Does this help? Maybe you can offer a more specific question or guidance on
which bits you're uncertain of?



More information about the thelist mailing list