PDA

View Full Version : PHP Album - Changing pop up background colors/colours, tile bar, path etc



PhoenixGB
05-28-2007, 02:12 PM
1) Script Title: PHP Photo Album script

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

3) Describe problem: I want to be able to do several things and as i am a complete newbie with php i need some sage advice...

This is the site i'm testing it out on

http://elvisontour.co.uk/test/newgallery.htm (http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm)

1. I would like to control the background colour of the popup page.

2. I would like to remove the path and title bar if possible.

Managed to change the colors of the links without too much trouble but i am struggling with this. BTW, thats not me in the Elvis outfit!!

Cheers All

Kev

jscheuer1
05-28-2007, 03:12 PM
Although this script uses PHP to gather the images it displays from a directory, the rest of the script is coded in javascript. There is no pop up page, that is the image itself you are viewing. Virtually all modern browsers do not permit displaying a pop up without the title bar, and if the address bar is not displayed, the path is displayed either in the title bar (most browsers) or in a proprietary information bar (Opera, perhaps others).

Modifications can be made to the javascript to pop up something other than the image itself, even something other than a pop up window.

PhoenixGB
05-28-2007, 07:00 PM
Ok cheers, what about chaning the bacground colour and fixing margins?

Kev

jscheuer1
05-28-2007, 07:15 PM
The background color of what? The margins of what? An image displayed by itself in a browser pop up window has neither of these.

A popular modification to this script is to use it with lightbox 2.03:

http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

To do so, install the lightbox files as instructed on the demo page. Then add this to the PHP Photo Album script (additions red):


if (gsortorder=="asc" || gsortorder=="desc")
galleryarray.sort(sortbydate)

function buildbox(){
for (var i = 0; i < galleryarray.length; i++){
var imagecompletepath=(targetlinkdir!="")? targetlinkdir+galleryarray[i][0] : imagepath+galleryarray[i][0];
document.write('<a style="display:none;" title="Elvis Detail" href="'+imagecompletepath+'" rel="lightbox[joe]"><\/a>')
}
}
buildbox();

var totalslots=dimension.split("x")[0]*dimension.split("x")[1]

function buildimage(i){
var imagecompletepath=(targetlinkdir!="")? targetlinkdir+galleryarray[i][0] : imagepath+galleryarray[i][0]
var tempcontainer='<a href="'+imagecompletepath+'" target="'+href_target+'" rel="lightbox[joe]" onClick="return popuplinkfunc(this)">'
tempcontainer+='<img src="'+imagepath+galleryarray[i][0]+'" title="'+galleryarray[i][0]+' ['+galleryarray[i][1]+']" />'
tempcontainer+='</a><br />'
tempcontainer+=(descriptionprefix[0]==1)? descriptionprefix[1]+(i+1) : ""
return tempcontainer
}

and change this in the PHP Photo Album script:


function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var popwin=open(imgsrc.href, "popwin", popupsetting[1])
popwin.focus()
return false
}
else
return true
}

to:


function popuplinkfunc(imgsrc){
myLightbox.start(imgsrc); return false;
}