PDA

View Full Version : can I have 2 photo albums independently on same page



rytis
08-12-2011, 03:32 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:
Not a problem, a question: I have this thing working, but I was wondering if I could have more of this independently on the right side of the page: http://www.vytasornamental.net/vceiling.htm you can see a space on right side I would like to fill also with a row of thumbs and a little bit smaller 150pixel wide that would work just like the ones on the left. is that possible and if so, how?

jscheuer1
08-12-2011, 05:03 PM
Sure, the same images or different ones?

If it's the same images, you just make a copy of:


<div id="second_album">
<script type="text/javascript">

new phpimagealbum({
albumvar: ceilingdesigns, //ID of photo album to display (based on getpics.php?id=xxx)
dimensions: [1,6],
sortby: ["file", "asc"], //["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){
thumbnailviewer.loadimage("http://www.vytasornamental.net/images/large/" + thumbfilename, "fit2screen")

}
})

</script>
</div>

Place it where you want it to show up. Put it in a container division with a unique id as highlighted above then use an additional child selector in ddphpalbum.css to change the size of its thumbnails:


#second_album .photodiv img{ /*CSS for each image tag*/
width: 100px;
}

If you want different images put a getalbumpics.php file in the folder with those images. Make another:


<script type="text/javascript" src="http://www.vytasornamental.net/images/ceiling2/getalbumpics.php?id=ceilingdesigns2"></script>

tag for example that points to it and use a different ?id= name. Use that in your second call to new phpimagealbum():


<script type="text/javascript">

new phpimagealbum({
albumvar: ceilingdesigns2, //ID of photo album to display (based on getpics.php?id=xxx)
dimensions: [1,6],
sortby: ["file", "asc"], //["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){
thumbnailviewer.loadimage("http://www.vytasornamental.net/images/large/" + thumbfilename, "fit2screen")

}
})

</script>

If the thumbnail images are already the size you want, you can forget about the unique container and styles. But it can still be used to get a different look for anything inside the second album.

rytis
08-14-2011, 09:20 PM
Thanx a lot! how about where it says on the bottom in yellow background "page1" is there a way to remove that notification "page1"?

jscheuer1
08-15-2011, 02:55 AM
In the ddphpalbum.css file add the highlighted:


/* ######### CSS for PHP Photo Album itself ######### */

.photodiv{ /*CSS for DIV containing each image*/
float: left;
margin-right: 10px;
margin-bottom: 10px;
}

.photodiv img{ /*CSS for each image tag*/
border: 0;
width: 200px;
height: 106px;
cursor: hand;
cursor: pointer;
}

.albumnavlinks{ /*CSS for DIV containing the navigational links*/
display: none;
}

.albumnavlinks a{ /*CSS for each navigational link*/
margin-right: 5px;
padding: 1px 5px;
border: 1px solid #9aafe5;
text-decoration: none;
color: #2e6ab1;
font-weight: bold;
}

That will get rid of it for all albums on a page. Or if you just want to get rid of it for one of the albums use instead:


#phpphotoalbum2_paginate {
display: none;
}

See the red 2? That's for the second album. For the first it would be a 1.