This should do it - paste the PHP in green and blue in place of the JS array on your page;
Code:
var ShowPics=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [400, 300], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
<?php
$dir = '/home/www/website.com/Graphics/ShowPics/'; // root path to images
$path = 'Graphics/ShowPics/'; // path to echo in to page
$patterns = '\.(jpg|jpeg|png)$'; // only these file types
if($hd = opendir($dir)){
while(false !== ($fname = readdir($hd))){
if(ereg('^\.{1,2}$',$fname)) continue; // exclude current directory, parent directory
if(! ereg($patterns,$fname)) continue; // exclude file types not in $patterns
$files_array[] = $fname;
}
}
sort($files_array); // sort files a-z
for ($i = 0; $i < count($files_array); $i++) {
$comma = ($i != count($files_array) - 1) ? ',' : ''; // if next item exists in array set $comma as ',' else '' (nothing)
echo "[\"$path$files_array[$i]\"]$comma<br/>";
}
closedir($hd);
?>
],
displaymode: {type:'auto', pause:2000, cycles:1, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "none",
togglerid: ""
})
Should output this;
Code:
var ShowPics=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [400, 300], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["Graphics/ShowPics/100_0466-A.jpg"],
["Graphics/ShowPics/100_0467-A.jpg"],
["Graphics/ShowPics/100_0469-A.jpg"],
["Graphics/ShowPics/100_0470-A.jpg"],
["Graphics/ShowPics/100_0471-A.jpg"],
["Graphics/ShowPics/100_0472-A.jpg"]
],
displaymode: {type:'auto', pause:2000, cycles:1, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "none",
togglerid: ""
})
Remember to change the variables in blue. This should also be placed inside the web page rather than in an external file.
Bookmarks