Yes. But it may take a little back and forth to get it working for you, it depends upon how much PHP knowledge you have, and how lucky we are with your server, and if I can lay this all out correctly and clearly the first time or not.
Make a file in a text only editor like NotePad:
PHP Code:
<?php
Header("content-type: application/x-javascript");
function returnimages($dirname=".") {
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
echo 'galleryarray[' . $curimage .']=["' . $file . '"];' . "\n";
$curimage++;
}
}
closedir($handle);
}
return($files);
}
echo "var galleryarray=new Array();" . "\n";
returnimages();
?>
Save it as gallerypics.php and put it in the folder that has the images in it (for now I will assume that's img/pics/ and that this is the valid path to it from your page)
Then on the page, before the Conveyor script, put:
HTML Code:
<script type="text/javascript" src="img/pics/gallerypics.php"></script>
Then, in the beginning of the Conveyor script put (addition red):
Code:
<script type="text/javascript">
/***********************************************
* Conveyor belt slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
galleryarray.sort(function() {return 0.5 - Math.random();});
var ccounter = 0;
//Specify the slider's width (in pixels)
var sliderwidth="300px"
//Specify the slider's height
var sliderheight="150px"
//Specify the slider's slide spe . . .
Once we have all that, the entries in the leftrightslide array can look like so:
Code:
leftrightslide[1]='<a href="#"><img src="img/pics/' + galleryarray[ccounter++] + '" border=0></a>'
Bookmarks