This is what I ended up with, found some other tips at Kirupa.com:
Function right($rightstring, $rightlength) {
return(substr($rightstring, -$rightlength));
}
$filename="images.xml";
$imgdirname = "../../homepageslides/";
$gallerypath=$imgdirname."/";
$file=fopen($filename, "w") or die("Could not open $filename!");
fwrite($file, "<images path=\"".$gallerypath."\">");
$q=0;
$imgdir = opendir($imgdirname);
//echo "Reading directory $imgdirname ...\n";
While (False != ($imgfile = ReadDir($imgdir) ) )
{
If( ($imgfile != ".") And ($imgfile != "..") )
{
If (Right($imgfile, 4) == ".jpg")
{
$imgfilename[$q] = $imgfile;
fwrite($file, "<pic><image>[url]http://www.url.com/homepageslides/[/url]$imgfile</image><caption></caption></pic>");
//echo "Wrote $imgfile \r";
$q++;
}
}
}
CloseDir($imgdir);
fwrite($file, "</gallery>");
fclose($file);
echo "Slideshow Update Complete"
Thanks for your help!
~Max