Sig / Image rotator
save this file to your computer.
create a directory on your webserver named "rotator.jpg" ( with the .jpg extension ) and upload the index.php to it. Also add any images you want to be in the rotator.
then use BBcode or HTML to link to http://yoursite.com/rotator.jpg
[*IMG]http://yoursite.com/rotator.jpg[/IMG*] (no *)
<*IMG src=http://yoursite.com/rotator.jpg>
index.php code :
[PHP]
// This script randomly selects and displays images from the current directory
// It is a stripped-down version of the Automatic Image Rotator script by Dan P. Benjamin.
// Set image filename extensions
$extList = array();
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';
// Get contents of current directory
$fileList = array();
$handle = opendir("./");
while ( false !== ( $file = readdir($handle) ) ) {
$file_info = pathinfo($file);
if (
isset( $extList[ strtolower( $file_info['extension'] ) ] )
) {
$fileList[] = $file;
}
}
closedir($handle);
if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $fileList[$imageNumber];
}
if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);
} else {
if ( function_exists('imagecreate') ) {
header ("Content-type: image/png");
$im = @imagecreate (100, 100)
or die ("Cannot initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0,0,0);
imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color);
imagepng ($im);
imagedestroy($im);
}
}
?>
[/PHP]








Wonder if it would work on magelo backgrounds...

and yes you can have multiples.
i have a tacsig.jpg and a rotator.jpg folders


I tried it with Magelo backgrounds but it didnt seem to work.

save this file to your computer.
create a directory on your webserver named "rotator.jpg" ( with the .jpg extension ) and upload the index.php to it. Also add any images you want to be in the rotator.
then use BBcode or HTML to link to http://yoursite.com/rotator.jpg
[*IMG]http://yoursite.com/rotator.jpg[/IMG*] (no *)
<*IMG src=http://yoursite.com/rotator.jpg>
I made a directory named "rotator.jpg" and loaded images into it, but it doesn't appear to be working. It may have something to do with the fact that I don't know what "upload the index.php to it" means. Is that important? What does it mean? Is it hard to do whatever it is?


