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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP code request--gallery/popup

    PHP code request:

    I am building a website that contains several different image galleries--reptiles, birds, and mammals etc. Being graphic heavy I am displaying thumbnails of each picture. I would like the viewer to be able to click on the thumbnail to view the larger image in a popup window. I would rather not have to type the name of every large photo for every new window.

    I got help with this using Javascript but cross browser issues are a pain. IE worked great -- Netscape humm

    I use the same naming convention for all my photos. Large image = "image.jpg" and thumbnails = "image_thumb.jpg"

    Example:
    dragonfly.jpg
    dragonfly_thumb.jpg

    What I would like is the user to be able to click on the thumbnails, "dragonfly_thumb.jpg" etc., and a have a popup window display the larger image, "dragonfly.jpg"

    Basically I need a PHP code that that I can place around my thumbnail html that will strip out the "_thumb" and opens a popup window.

    Desired Popup window characteristics:

    Fits to the size of the large image.
    Disabled right mouse click
    Disables IE 6 galleryimg
    Has "close window" underneath image to close window.


    My images directories that code would be pulling from

    Root: pictures/envior_pics/

    Different galleries folders found under envior_pics:
    birds, frogs, insects, lizards, mamals, plants, snakes


    I wish I could do this my self but I'm only a graphics guy.
    Thanks in advance for the help you might be able to give.

    Togo

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are a few image gallery systems available for PHP - try a
    search on google.

    I'm running one up myself - will not be at beta release for about
    another week though and uses GD libs to buildrender the thumbs.

    I've an old javascript popup version at this url

    If that does what you want (it's not NS4 compat), just yell and I'll
    let you know what to change to get it working for your thumbs.

    Note: the GD'n'PHP one is much better
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Couple of notes - that js version places a trans gif over the big
    image, making it harder to save properly - I partly wrote it to play
    with cutting strings in defined places (ie every 30 characters or
    prior space - it even truncates descriptions that are too long and
    adds a hyphen to any word that would take more than one line).
    The window sizes to the picture automatically - basically a div
    image is replaced by a small gif, the size of that is tested until it
    is under 80px high, then it's replaced by the big image, then the
    size of that is tested until properly returned - the window is then
    sized according to that.
    The table is rendered automatically - mainly all you need do is
    write the descriptions and make sure the max images is exactly
    divisible by the columsn.

    Notes on PHP: that nice language can easily scan a directory and
    build a page bsaed on the files found in it - ie, you could just put
    a script in the directory and it would sniff out the images and write
    a page based upon what it found. It can also read the dimensions
    of images quite easily - and can (well GD libs can) read the embe-
    dded thumbnail in any jpeg or tiff file as well as SOOOOOO much
    more
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #4
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Ökii

    Notes on PHP: that nice language can easily scan a directory and
    build a page bsaed on the files found in it - ie, you could just put
    a script in the directory and it would sniff out the images and write
    a page based upon what it found. It can also read the dimensions
    of images quite easily - and can (well GD libs can) read the embe-
    dded thumbnail in any jpeg or tiff file as well as SOOOOOO much
    more
    I understrand PHP can build a page from the files found in it. However the HTML pages with the thumbnails have already been built. My gallery is already in place. All I need is code that can be added to each thumbnail found on the HTML credited pages so a popup will open with the larger image.

    --
    Togo

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    183
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So why do you even need PHP?

    This should be in the JS forums
    Offtone.com - In the works...

  • #6
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im after the same thing basically only i need it for php.


  •  

    Posting Permissions

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