On 27/11/2007, Andrew Peterson <gretschdrummer@xxxxxxxxx> wrote: > I'm assuming that everytime you page refreshes, it pulls in ALL the contents > of the directory? > > If you are, you could dynamically create the Prev/Next buttons. When you > create the link for each individual pictures, you could add the prev and > next files to the link: > > > $pictureLink = "<a > href="picture.php?picture=pic2.jpeg&prev=pic1.jpeg&next=pid3.jpeg">Picture > 2</a> > > Make sense? > > -Andrew > > > PS - You could also google "PHP Photo Gallery", there are TON of scripts out > there. > > > > > On Nov 27, 2007 7:20 AM, Tom Chubb <tomchubb@xxxxxxxxx> wrote: > > > > > > > > On 27/11/2007, Colin Guthrie <gmane@xxxxxxxxxxxxxx> wrote: > > > Tom Chubb wrote: > > > > Hi all, > > > > I have a working gallery script which reads a directory then shows all > > > > thumbnails, each linking to the full size image. > > > > I'm trying to change it so that the page shows an image (fullsize) > > > > then links to the previous/next images in the sequence & then all the > > > > thumbnails below (the bit that's working fine at the moment). The > > > > filenames are straight from the camera (eg DSC102834.jpg or something) > > > > so I know that I need to get all the filenames into an array then use > > > > the key indexing or something, but I'm not sure how to do it? > > > > Also I'm not sure if I should be using readdir or glob? > > > > > > > > I've modified the code below so that it just displays the text of the > > > > filename rather than the actual image to speed up testing/reduce > > > > bandwidth. > > > > > > > > If anyone could point me in the right direction I'd really appreciate > it > > > > > > If you don't mind relying on javascript then take a look at lightbox or > > > thickbox and similar soltuions. > > > > > > These are solutions where you only need to generate a gallery page with > > > the thumbnails and it will do the rest for you complete with > > > previous/next links and even thumbnails... > > > > > > Col > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > I'm not against using Javascript, but I'd like to learn more about how > > to do it in PHP. (Admittedly it would probably be better in > > Javascript!) > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- Tom Chubb tomchubb@xxxxxxxxx 07912 202846 Thanks Andrew, It's the link for the first image I'm having problems with. I can create a table with all the images, but I can't work out how to specify a single image to use as the main (larger image) Let's say that I've got 4 images called img1, img2, img3, img4. The script gets the filenames using readdir() but how do I associate the results with one image, eg img3? I thought it would be something like $files[2] then the prev/next would be $files[1] & $files[2] The section of code is: if ($file !="thumbs.db" && $file !="_notes" && !is_dir($file)) { echo "<td><a href=\"" . $file . "\">" . $file . "</a></td>\r\n"; $count++; if (($count % 4) == 0) { echo "</tr>\r\n"; echo "<tr>\r\n"; } } } Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php