bpat1434 wrote:I think (correct me if I'm wrong) that random.php will load a SWF file at random. So zoobie needs to echo the contents of the include at a certain point in the file.
~Brett
Exactly...It's picking at random a swf clock for placement at a certain part of the page.
I think I already tried
file_get_content('random.php');
but it just printed that out on the screen
Any clues how do?
below is random.php
<?
//***************EDIT FROM HERE*********************
//Any directory name should end by the trailing "/"
$your_dirname="clocks/";//replace the "images/" by the name
// of the directory where you image files are placed, note that the trailing "/" is mandatory
//You can change this if you want but it is not mendatory
$your_alt_tag="Performing Arts Film and Video";// You may change this line
function displayaaphprandomimage($dirname, $alt){
$dirhandle = opendir($dirname);
while (false !== ($file = readdir($dirhandle))) {
if ($file != "." && $file != ".." && !@is_dir($file) ) {
$filelist[] = $file;
}
}
closedir($dirhandle);
if(sizeof($filelist) ==0) {
echo "No file was found in the directory!";
exit;
}
srand((double)microtime()*1000000);
$picnum = @mt_rand(0, sizeof($filelist) - 1);
$imageName=$dirname.$filelist[$picnum];
$imageSize = getimagesize($imageName);
if($imageSize[2]==4 || eregi(".swf$", $imageName) ) {
$result="\n<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"400\" height=\"400\">";
$result .="\n<param name=\"movie\" value=\"".$imageName ."\">";
$result .="\n<param name=\"quality\" value=\"high\">";
$result .="\n<param name=\"bgcolor\" value=\"#000000\">";
$result .="\n<param name=\"wmode\" value=\"transparent\">";
$result .="\n<embed src=\"".$imageName ."\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"400\" height=\"400\" wmode=\"transparent\"></embed></object>";
} else $result="\n<img src=\"".$imageName ."\" width=\"400\" height=\"400\" alt=\"". $alt. "\">";
return $result;
}
?>
<?=displayaaphprandomimage($your_dirname, $your_alt_tag)?>
Thanks