PDA

View Full Version : Photo Album script driving Cmotion Script



Wildfire563
10-26-2006, 04:40 PM
1) Script Title:
PHP Photo Album Script
CMotion Image Gallery
Image Thumbnail Viewer II

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

3) Describe problem:
Well, I'm not exactly having a problem. I'm more wondering if what I'd like to do is possible.

I have several galleries I'd like to display on a single small page without having the images popup in a separate window (unless the user requests it by clicking on the image). The way I'm thinking of doing it is this:

Using the PHP Photo Album script, at the top of the page will be six thumbnails, each with a caption for the gallery it points to. Underneath that will be left and right arrows or a list of pages which page through however many pages of these six thumbnails I will have, where each image in the PHP photo album represents a whole gallery of images.

Underneath that will be a CMotion Gallery strip showing all the thumbs from the currently selected (from one of the above 6 thumbnails) gallery.

Underneath that will be the enlarged image currently selected from the CMotion gallery strip of thumbs (using thumbnail viewer II).

1. My problem is understanding how to fill the CMotion Gallery Strip dynamically from the thumbnail selected in the PHP Photo Album script section. Is this possilble? The solution would have to deal with the fact that each gallery may have a different number of pictures, and the thumbnails may be of different sizes (though it may be that they all have the same height). It would be nice if the Cmotion strip did not show blank spaces in those strips that had fewer images than others.

2. As an added but not necessary feature, from that, I'd like to add a link from the large Thumbnail Viewer II script image which would pop up the current image in a new browser window, with right and left arrows underneath that would allow the user to page through the images in the selected gallery inside the new browser window (the assumption here is that the images in the gallery are even larger than the image as displayed on the initial page). Is there a script for that?

3. Is there any way to have the Thumbnail Viewer II script have the first image in the current strip already loaded when the page is first opened?

4. Is there any way to "cookie-ize" this so the last selected gallery page, gallery, and image are rembered?

I'm still working on implementing the concept here:

http://www.flyingscool.com, and select About/Galleries from the top menu bar (I can't link directly to the page because the gallery is displayed in a DHTML window, so it won't look right otherwise).

Thanks!

Wildfire563
10-26-2006, 05:10 PM
BTW, I'd like the list of pages underneath the gallery thumbs to be dynamic, so that its length is limited to a single line, kind of like the

< 1 2 3 4 ... 10 > kind of list, so when you select 4, it looks like

< 3 4 5 6 ... 10 > kind of thing

Wildfire563
10-27-2006, 02:32 AM
Ok, this is what I am thinking for an implementation.

I have a top level directory, let's call it galleries.

Inside of this directory, each gallery has its own directory, and there is a directory called thumbs. Inside the thumbs directory is a thumbnail image for each gallery to be presented, and let's say the name of each gallery thumbnail is the same as the name of the directory for each gallery. The name of the thumbnail could be unimportant, but if it is the same as the gallery directory, this could possibly help with some automation.

Inside each gallery directory are all the images and a directory called thumbs. Inside each of these gallery "thumbs" directories are the thumbnail images to be used by the CMotion script for each gallery. The names of the thumbnail images should match the names of the images themselves.

Within the Photo album script, it uses the list of files in the galleries/thumbs directory. It could use them from an array filled with each of the file names, or the array could be filled automatically by reading all the files in the galleries/thumbs directory (except for Thumbs.db). An option of each cell for each thumbnail in the array would be the index range of the images for the associated gallery for that array index cell (see below).

The CMotion script would have a listing of all the images from all of the galleries/xxx/thumbs directories. It would probably be easiest to keep them in order so each gallery is a contiguous section of the array, but this is not necessarily necessary.

The Thumbnail Viewer II script would have a listing from all the images from the galleries/xxx directories (not including any of the thumbs directories).

By default, the Cmotion script shows only the thumbnails from the first gallery in the list. When the user selects an image from the Photo Album array, a script is run to change what is displayed in the CMotion script to the thumbnails from the selected gallery. IOW, the CMotion script has an option to only show a certain range of images from its list, and this range can be changed dynamically. The same is true of the Thumbnail Viewer II script.

I think you can see that, if the thumbnails from the galleries/thumbs directory have the same name as the name of the directory containing its associated gallery images, and the names of the files in the galleries/xxx/thumbs directories are the same as their associated image files it would be pretty easy to automate the process of developing all these lists automatically.

So I think the only changes I have to make to the scripts are to add a way to run a script from the Photo Album script when an image is selected, and to change the CMotion script so it only shows a limited range of images from the total list of images available to it, and a script for it so that range can be changed dynamically.

Wildfire563
10-27-2006, 02:15 PM
BTW, you don't necessarily need the galleries/thumbs directory. Instead, the script could just choose to use the first file it finds in any of the galleries/xxx/thumbs directories. But I suppose that is obvious.