PDA

View Full Version : advice needed for dynamic drive gallery choice



student101
11-26-2009, 08:35 AM
I am in need of some advice to accomplish a task.

On one page are all of the albums with the main images of them, when clicking any one of the album images it opens a window
which has the gallery with a horizontal or vertical strip with the main image on the right or left.

What would the name of this type of gallery be if it exists?
If it exists, where could I find it? ...searching for days!

student101
11-27-2009, 07:19 PM
I've attached images of what I'm looking for..
Album page has the main image as the link
Gallery page has the gallery of images related to that album.

Hope that makes more sense?

Just found it!!!
Would have to PM the link, don't want to add their link in the forum.

jscheuer1
11-28-2009, 03:50 AM
From your images, it looks like this could be achieved via a combination of:

PHP Photo Album script v2.11 (http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm)

as the script for the 'first' page. Then using that script's customizable onphotoclick property, a function could be constructed to launch onclick for each image on the 'first' page (each said image would denote a gallery), a second page using:

Image Thumbnail Viewer II (http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm)

Perhaps PHP could be involved (obviously it can be for the 'first' page), but perhaps also for launching the second page(s) so that one .php page could handle all links from the 'first' page, based upon a query string passed to it by the 'first' page's onphotoclick property.

Do you get my drift? Does this seem like it could work for what you want?

student101
11-28-2009, 06:13 AM
Thank you,
That will work out just great!

student101
11-28-2009, 01:11 PM
Folder structure:

root...
images/
images/thumbs/ (all the thumbnails related to all galleries)
images/main/1 (all the images related to gallery1)
images/main/2 (all the images related to gallery2)

index.php (PHP Photo Album script v2.11)
gallery.php (Image Thumbnail Viewer II)


Clicking on any thumbnail on index.php should bring up gallery.php and show the relevant gallery images.

Which onphotoclick event handler (http://www.dynamicdrive.com/dynamicindex4/php-photoalbum_suppliment.htm) could I use, tried all of them like this;


<script type="text/javascript">
new phpimagealbum({
albumvar: myvacation, //ID of photo album to display (based on getpics.php?id=xxx)
dimensions: [3,2],
sortby: ["file", "asc"], //["file" or "date", "asc" or "desc"]
autodesc: "Photo %i", //Auto add a description beneath each picture? (use keyword %i for image position, %d for image date)
showsourceorder: true, //Show source order of each picture? (helpful during set up stage)

onphotoclick:function(thumbref, thumbindex, thumbfilename){
var largefilename=thumbfilename.split(".")[0] + ".jpg"
thumbnailviewer.loadimage("http://pathto->/images/main/" + largefilename, "fit2screen")
}

/*
***
Tried all the options on onphotoclick event handler (http://www.dynamicdrive.com/dynamicindex4/php-photoalbum_suppliment.htm)
***
*/

})
</script>

jscheuer1
11-28-2009, 04:34 PM
Well gallery.php must be setup to receive a query string. Your PHP is probably better than mine, but something like:


<?php
$ipath = './images/main/' . $_GET["dir"];
?>

The onphotoclick could be:


onphotoclick:function(thumbref, thumbindex, thumbfilename){
location = 'gallery.php?dir=' + (thumbindex + 1);
}

Now if all of the images in each images/main/1 numbered folder are named by a certain convention, or if you use PHP to retrieve the filenames, similar in some ways to the getalbumpics.php file from PHP Photo Album, the PHP code for which could go directly on gallery.php or, as is done in PHP Photo Album, in a separate file, this information could be used to write out the thumbnail links and thumbnail image tags on the gallery.php page, either continuing with PHP or switching to javascript.