Current File : /home/lifechur/legacy.lifechurchboston.org/scripts/getpics.php |
<?php
// PHP SCRIPT: getpics.php
header("Content-Type: text/javascript");
// Let them know who we are here!!!
//echo("document.write('<p>Running getpics</p>');\n");
// Declare the images array
echo("var fadeimages=new Array();\n");
$directory_r2scrpt = "../images_rotate_homepage"; // Directory in which the images are stored, relative to the location of this script. Must have the slash.
$directory_r2webrt = "/images_rotate_homepage"; // Directory in which the images are stored, relative to the web root.
$pattern = "(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)"; //valid image extensions
$dir = opendir($directory_r2scrpt);
for($i=0;$file = readdir($dir);$i++)
if(strpos($file, ".") === 0)
{
$i--;
continue;
} elseif(!eregi($pattern, $file)) // if this file is not a valid image
{
$i--;
continue;
} else // this file must be a valid image
{
echo("fadeimages[$i]=['$directory_r2webrt/$file', '', ''];\n");
// echo("document.write('<p>fadeimages[',$i,']=',fadeimages[$i],'</p>');\n");
}
?>