Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder olidenia's Avatar
    Join Date
    Oct 2009
    Location
    Sitting In Front Of A Screen
    Posts
    110
    Thanks
    16
    Thanked 4 Times in 4 Posts

    Display all images from folder, help with navigate next previous.

    Hi to all!

    It's the first time i'm doing a gallery, so my intentions are to display all images from a folder first as thumbnails in a 4 column order, I know how to do this adjusting the script below.
    PHP Code:
    <?php


    $files 
    glob("images/*.*");
    for (
    $i=0$i<count($files); $i++)
    {
        
    $num $files[$i];
        echo 
    '<img src="'.$num.'" alt="random image" />'."<br /><br />";
    }
    ?>
    I would like now if one of the thumbnails is selected to display the original image and be able to click next and previous buttons so I can go forwards or backwards thru all images in the folder, and when I get to the end of images in a folder stop displaying "Next" button or simply start at the beginning again.

    Any help?
    Last edited by olidenia; 02-16-2011 at 02:49 AM.
    It's easy once you know how...

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    I recommend you use LightBox or PrettyPhoto, or some other JQuery "slideshow".
    Using JQuery is way better than any single PHP method. PHP will create the dynamic
    HTML and Javascripting, JQuery will handle the actual slideshow GUI.

    Here's an example, click on any thumbnail:
    http://www.herndonheald.com/sightings.php

    That example uses PrettyPhoto, but there are several different JQuery scripts.
    You could also use a Flash method, but Flash is not supported very well with iphone,
    ipad, ipod ... at least not yet.

  • #3
    Regular Coder olidenia's Avatar
    Join Date
    Oct 2009
    Location
    Sitting In Front Of A Screen
    Posts
    110
    Thanks
    16
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by mlseim View Post
    I recommend you use LightBox or PrettyPhoto, or some other JQuery "slideshow".
    Using JQuery is way better than any single PHP method. PHP will create the dynamic
    HTML and Javascripting, JQuery will handle the actual slideshow GUI.
    Ok, I'll take a look, I have already a photo tagging script so users can tag themselves on the photos, maybe it wont be to difficult to pluggin to an existing slideshow.
    It's easy once you know how...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •