PDA

View Full Version : photo album link to html file instead of image



mfmlb
01-19-2007, 08:50 PM
1) Script Title: PHP Photo Album script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/php-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

jscheuer1
01-19-2007, 10:45 PM
Find this function and add the red part:


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

mfmlb
01-20-2007, 01:06 AM
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.

jscheuer1
01-20-2007, 04:41 AM
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:


//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.

mfmlb
01-20-2007, 04:59 AM
Thank you so much