Jump to content

• Rotating Things Tut •


Recommended Posts

1. Copy this f*cking text in note pad and save it as rotate.php

<?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);
}
}

?>

 

2. make a ripway account at www.ripway.com

 

3. make a folder in your ripway account named "anything.png" (I meant "ANYTHING!")

 

4. upload the rotate.php to da the "anything.png" folder. (I meant "ANYTHING!")

 

5. upload the avis/sigs to the "anything.png" folder. (I meant "ANYTHING!")

 

6. Copy the URL of the rotate.php

 

7. paste it in your avi/sig(include the .php and if it is a sig, dont furget the tag)

 

8. Viola, rotating stuff and sh*t

Link to comment
Share on other sites

Good. This'll put Max C's Shop out of business though :(.

 

Good. This'll put Max C's Shop out of business though :(.

 

Some won't get how to do it' date=' so Max C. still have a chance =/

[/quote']

 

Thanks guys ^_^ My script is much cleaner though :P I just have to make a folder a link to it xD

Link to comment
Share on other sites

You pretty much copied this script:

http://www.alistapart.com/d/randomizer/rotate.txt

You should've put credits...

 

Note: For anyone who wants it easier' date=' make an account using a web host that has FTP and just do it there. You can easily manage, edit, etc. images & the script from there.

[/quote']

Own'd. But I'll stick with Max, I've too lazy to have a place where I can FTP.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...