Jump to content

How to make your own Signature Rotator


Jimmy-526

Recommended Posts

MAKE YOUR OWN ROTATING SIGNATURE!

Since the collapse of the rotating signature site Clintonio.com there have been a few bemused members asking how they can get their rotating signatures online. Well you could always use another host, but that would still be relying on other people. Your images will still be subject to various potential problems such as hacking attacks, site closedowns etc. So I thought that I'd compile an easy to follow guide, below are the 5 steps which you can follow to get your own rotating signature.

Step 1: Get your own web host

For this step you need an actual webhosting service that supports the use of the PHP language. If you already have your website set up then you can skip this step. Some free webhosts are available in the WD&P Mega Topic which is pinned at the top of this forum. However these sites need to have support for PHP. I'll post a few sites which definitely support PHP in the second post.

Once you've set up your site (it shouldn't take too long, you normally just have to provide a username, password, website name and a contact email address for yourself. Personal details are sometimes required, but you can sometimes skip that part.) you can move on to step number 2.

Step 2: Create your directory

Once your site is set up and is running, you can create a new directory (folder) on the root of your site and call it "rotate.jpg." Actually you can call it whatever you like but remember to change the referenced names at the end. And yes you can create directories which have dots in them followed by extensions.

Step 3: Upload your files

Upload all of the images which you want to be in your rotator to the "rotate.jpg" directory. Make sure that they all adhere to the signature size rules, you will have to make sure that they are all a maximum of 150x500 pixels in size, and that none of them exceed the filesize limit which stands at 80kb at the moment. If your signature is disabled, then that is why.

Also, make sure that the files which you upload are only files with the following extensions:

      • .jpg
      • .jpeg
      • .png
      • .gif

The script won't be able to read any other filetypes.

Now you can move on to the meaty part, the coding itself.

Step 4: Make the index.php file

Open up notepad, wordpad or an equivalent plain text editor, it doesn't really matter which. Then copy and paste the following code into your document. For easy copy and pasting, Ctrl + Click in the white box, then press Ctrl + C.

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

?>

Save this file as index.php and upload it into the "rotate.jpg" directory which you created in step 2.

Step 5: Get your rotator

Create an tag which links to your rotate.jpg directory. An example is below.

[img=http://goatse.110mb.com/rotate.jpg]

Add that to your sig to see a very boring rotator signature which I knocked up in my spare time a week or so ago. You will get a message which states that couldn't check the filesize of your images because you are using a rotator, but as long as you don't click the back button on your browser your sig will be saved and it will be updated.

ASSORTED LINKS

Free PHP webhosts:

Rotating signature hosts:

I only know of one, located at kzemo.com. The signup process is easy, just enter a username, and confirm a password. Then add the links to your images and make your own rotator. A direct link is provided and you have the option to edit or delete your rotators at a later date.

Image hosts:

If you want to use kzemo.com's option then you'll need an image hosting site.

ASSORTED LINKS

Free PHP webhosts:

Rotating signature hosts:

I only know of one, located at kzemo.com. The signup process is easy, just enter a username, and confirm a password. Then add the links to your images and make your own rotator. A direct link is provided and you have the option to edit or delete your rotators at a later date.

Image hosts:

If you want to use kzemo.com's option then you'll need an image hosting site.

Link to comment
Share on other sites

  • 5 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...