PDA

View Full Version : PHP Photo Album script v2.11 & Fancybox



M.M.
08-12-2010, 10:07 PM
1) Script Title:
PHP Photo Album script v2.11

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

3) Describe problem:
Hello everybody,

First of all let me tell you that I am more of a designer than a programer and DD has help me a lot with the websites I do. Thanks to all for posting the scripts. without you I will be lost :)

Here is my dilemma:

-I hope this question is not posted somewhere else. I looked and I could not find it. If it is, could you please post a link to it?-

I am already using fancybox in some pages of a website I am building and I would like to keep the same look troughout the site. Is there anyway to use fancybox in the PHP Photo album instead of the built in lightbox viewer. I read the additional page for the onphotoclick event handler, but because I know almost nothing about php, javascript or JQuery I couldn't do much. I need to use it to show the same image in its original size. Could someone help me with directions?

ohh here is my test page:
http://sprocketproductions.com/wonderland/events-gallery.html

Thanks a lot!

jscheuer1
08-13-2010, 08:54 AM
Here's one way (addition/change highlighted):


<script type="text/javascript">

new phpimagealbum({
albumvar: posters, //ID of photo album to display (based on getpics.php?id=xxx)
dimensions: [5,2],
sortby: ["date", "desc"], //["file" or "date", "asc" or "desc"]
autodesc: "", //Auto add a description beneath each picture? (use keyword %i for image position, %d for image date)
showsourceorder: false, //Show source order of each picture? (helpful during set up stage)
onphotoclick:function(thumbref, thumbindex, thumbfilename){
$.fancybox('<img src="' + thumbref.src + '" alt="">');
}
})

</script>


Or possibly (for a title from the filename):


<script type="text/javascript">

new phpimagealbum({
albumvar: posters, //ID of photo album to display (based on getpics.php?id=xxx)
dimensions: [5,2],
sortby: ["date", "desc"], //["file" or "date", "asc" or "desc"]
autodesc: "", //Auto add a description beneath each picture? (use keyword %i for image position, %d for image date)
showsourceorder: false, //Show source order of each picture? (helpful during set up stage)
onphotoclick:function(thumbref, thumbindex, thumbfilename){
$.fancybox('<img src="' + thumbref.src + '" alt="">', {title: thumbfilename});
}
})

</script>

M.M.
08-13-2010, 03:58 PM
thanks John!

That was perfect... and quick too! :)

elio.d
12-07-2010, 01:58 PM
I'm trying to make php photoalbum working with fancybox, there is a way to manage multiple images ??? I mean it is possible to have the next and prev button into the fancybox popup?

jscheuer1
12-07-2010, 03:34 PM
I'm trying to make php photoalbum working with fancybox, there is a way to manage multiple images ??? I mean it is possible to have the next and prev button into the fancybox popup?

Please start a new thread for what is essentially a new question, or at least will have a different approach. Include a link to the demo pages of the versions of the scripts that you are using, as well as one to the page where you are attempting this.