Results 1 to 5 of 5

Thread: photo album link to html file instead of image

  1. #1
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default photo album link to html file instead of image

    1) Script Title: PHP Photo Album script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem:
    Really helpful site!

    Instead of having the thumnails link to a larger version of themselves, I would like to have it link to an html file with the same name.

    Can someone please help and tell me how to do that?

    Thank you

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Find this function and add the red part:

    Code:
    function popuplinkfunc(imgsrc){
    if (popupsetting[0]==1){
    var popwin=open(imgsrc.href.replace(/\.[^\.]*$/,'.htm'), "popwin", popupsetting[1])
    popwin.focus()
    return false
    }
    else
    return true
    }
    This will change .gif, .jpg, in fact - .whatever - to .htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do I do it with no popup windows

    THanks a bunch John.

    But how do I get it to work when I have the pop up window feature disabled. I tried a few different things but couldn't get it to work.

    This is my code to the popup setting:
    var dimension="2x2" //Specify dimension of gallery (number of images shown), such as 4x2, 3x1 etc
    var imagepath="http://mlebreton.com/coconutislandcoral/test/coral/" //Absolute path to image directory. Include trailing slash (/)
    var href_target="" //Enter target attribute of links, if applicable

    //Toggle popup link setting: popupsetting[0 or 1, "pop up window attributes" (if 1)]
    var popupsetting=[0, "width=500px, height=400px, scrollbars, resizable"]


    I set popupsetting to 0 and blank quotes for href_target.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    function popuplinkfunc(imgsrc){
    if (popupsetting[0]==1){
    var popwin=open(imgsrc.href.replace(/\.[^\.]*$/,'.htm'), "_self", popupsetting[1])
    popwin.focus()
    return false
    }
    else
    return true
    }
    It would be easier not to disable the popupsetting feature and to just change the target specification in it to _self as I have in the above version of this handy function. With this change, both the href_target and the info after the comma in popupsetting (as long as it is valid, use the demo default) become meaningless. In other words, just use:

    Code:
    //Toggle popup link setting: popupsetting[0 or 1, "pop up window attributes" (if 1)]
    var popupsetting=[1, "width=500px, height=400px, scrollbars, resizable"]
    for that part.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank You

    Thank you so much

Bookmarks

Posting Permissions

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