Topic: Auto XML Gallery - automatically load all images in a folder

So you prefer the xml flash gallery look and feel, but want it to work like the Auto Flash Gallery?  Well, there is a solution for you!  I put together a simple php script that will allow you to point the xml gallery to a folder and pull all the images from it automatically. 

Step 1
You will need to download this file: auto.zip

Step 2
Unzip the file and open auto.php.  At the very top set $file_dir to the directory you want the gallery to read from.  There are a couple of other options:

$show_titles - set to true to display image titles as captions (without .jpg)
$omit_chars - number of characters to be omited from beginning of image titles.  So, if you set this to 3, then "01_myimagetitle.jpg" will display as "myimagetitle"
$show_links - set to true to display links to individual images
$before_link - text to be added before image title in link
$after_link - text to be added after image title in link

Step 3
In your xmlGallery.html change the following line:

var so = new SWFObject("xmlGallery.swf", "gallery", "100%", "100%", "6", "#333333");

to

var so = new SWFObject("xmlGallery.swf?file_to_load=auto.php", "gallery", "100%", "100%", "6", "#333333");

Step 4
Now you will need to upload everything to a server that supports php (most do).  The gallery will not work on your local computer.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

This script has recently been updated to allow sorting.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

It works, but some of the pictures are shown twice - can

Re: Auto XML Gallery - automatically load all images in a folder

can you post a link?

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

It

Re: Auto XML Gallery - automatically load all images in a folder

You were right.  There was an error in the script.  Corrected now, so re-download.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

Thanks, perfect !

Re: Auto XML Gallery - automatically load all images in a folder

Do you have an ASP version of this script?

Re: Auto XML Gallery - automatically load all images in a folder

At this time I don't have an asp script.  I am not familiar with asp.  If anybody knows asp, and would like to write this simple script, I would love to post it here for everyone to use.

You will get a commercial copy of the xmlGallery component or any other product from this site for your troubles.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

Is it possible to use something else than a question mark:

xmlGallery.swf?file_to_load=auto.php

Since this doesn

Re: Auto XML Gallery - automatically load all images in a folder

You can do:

var so = new SWFObject("xmlGallery.swf", "xmlGallery", "100%", "100%", "6", "#FFFFFF");
so.addVariable("file_to_load", "auto.php");
so.write("flashcontent");
Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

I can't seem to get this to work...
I loaded all of the files from the XML Gallery I purchased months ago. I also added the auto.php after modfiying it as directed.

This is what I am getting:
http://www.scc-media.com/Photography/Elizabeth/Beach/

Re: Auto XML Gallery - automatically load all images in a folder

Seems to be a problem with your auto script:
http://www.scc-media.com/Photography/El … h/auto.php

It should output xml for the gallery, and all i see is a blank page.  Make sure that $file_dir is pointing to the right folder.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

what if your gallerySWF is not directly embedded in the html page but loaded inside another swf?.. Can I still somehow scan a folder and ad them to the xml?

Re: Auto XML Gallery - automatically load all images in a folder

Yes.  You would need to pass the variable file_to_load, with the location of the auto script to the swf file after it has fully loaded.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

I need to sort my images randomly, but also provide links to specific web pages as opposed to JPG files. Is there a way to do this?

Re: Auto XML Gallery - automatically load all images in a folder

You need to use xml and not the auto script.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

Hi all,

I wanted to put some information in case someone is searching for the same.
by attaching additinal parameters to the auto.php you have the possibility to influence this output.

in my case I used
var so = new SWFObject("xmlgalerie/xmlGallery.swf?file_to_load=xmlgalerie/auto.php?id=7", "gallery", "600", "450", "6", "")

in my content system the 7 is automatically replaced with the page ID which enables the galerie to finde the corresponding image folder

$file_dir="../images/galerien/bilder/".$HTTP_GET_VARS['id'];

...only in case someone thought about the same...

Re: Auto XML Gallery - automatically load all images in a folder

Is there an update to the auto.php to find thumbnails with the 2.0 release?

Here is what I'm looking for, load images from a folder randomly, thumbs are in a 'thumbnails' folder and named with a  'tn_' prefix.

Last edited by winklebleck (2008-01-29 13:02:56)

Re: Auto XML Gallery - automatically load all images in a folder

I got the script to find the thumbs, just added the

$tmp_str = '<pic image="'.$file_dir.'/'.$file.'" ';

replace with

$tmp_str = '<pic image="'.$file_dir.'/'.$file.'" thumb="'.$file_dir.'/thumbnails/tn_'.$file.'" ';

where /thumbnails/ is the folder and tn_ is the prefix. if you do not have a prefix, remove the tn_.

Last edited by winklebleck (2008-02-04 17:37:30)

Re: Auto XML Gallery - automatically load all images in a folder

Ok I have an odd question...

I am using the component to embed in a flash movie that I have already created.  I have had to use the component settings to size it and set it the way I want it to look.  I figure it would be best just using the XML...I digress

Is there a way to use the auto script to drag and drop images into the image folder while still using the component?

Re: Auto XML Gallery - automatically load all images in a folder

Sure.  Just set the data source in the component parameters to point to auto.php instead of your xml.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Auto XML Gallery - automatically load all images in a folder

I've been trying for about 4 hours to make the auto.php work...I suspect that it is not possible for my situation.  I took over the web designer job and trying to work with what the previous person created.  They used the XML Flash Gallery, but I see in the .fla file they have referenced 3 xml files for the gallery....I can't make the auto.php work.  It it because there is actionscripting telling the gallery what images to load??? 

I'm trying to make it as easy as possible for the client to update their gallery but I suspect the actionscript linking to external xml makes it so I can't use the auto.php???

Thanks in advance for your advice.

Re: Auto XML Gallery - automatically load all images in a folder

Is it possible to make something similar for reading a local folder on the HDD ?

Re: Auto XML Gallery - automatically load all images in a folder

jc_photo,
Yes, you will probably not be able to use auto.php in your case.  Since the flash is linking to 3 separate xml files, that is where the info for images is coming from, and your flashvar is being ignored.  You may consider setting up 3 separate galleries and have each read from a separate auto.php

mvveelen,
You can run auto.php on your local machine if you are running a localhost php server.  I do this on my local machine using XAMPP.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes