PDA

View Full Version : slide show that picks up new images automaticly


MaartenM
08-29-2003, 02:49 PM
Hey everybody,

I'm looking for a slide show, that switches a number of images (at least 10) at any given time.
The (java)script must pick up new images that are uploaded to a specific folder (using FTP). This is nessecary, so that my costumers are able to add their new photos without having to edit any kind of code.

I think this is a long shot, but I also think it is possible. If there's anybody who can help me......

Thank you in advance!
MaartenM

fredmv
08-29-2003, 03:31 PM
I have a solution for this, but it can't be done by only using JavaScript.

You need a server-side technology, such as PHP, or Perl. And use them to loop through the images directory and add all of the filenames into an array. The general idea behind it would end up being something like this:


var theImages = new Array(
<?
/*
Some PHP code here which loops through the directory of images and prints filenames.
It should also create quotes around them, and if it isn't the last file in the directory, have a comma (,) after it.
*/
?>
);


You can get scripts which do something like that at places like hotscripts.com (http://www.hotscripts.com).

Good luck.

Vincent Puglia
08-29-2003, 03:44 PM
Hi,

I agree with Fred; this should be done server-side.
The only way I can see this occurring client-side is if (and very, very iffily) you get the user to rename the images before uploading (presupposing each user has his/her own directory) to something like "picX.gif" where 'X' is equal to the array's length. You might then be able to set up the slideshow so that it automatically looks in the user's folder and execute a simple random or sequential slideshow script.

Vinny

MaartenM
08-30-2003, 11:28 AM
Thanks!

I'm gonna try this first thing monday morning.
If it works, I'll post back.

Maarten