How to make a rotating sig
Apologies for being absent lately, but I've been very busy with other things (the libertarians among you may be amused to know that one of those things has been a boatload of regulatory red tape at work). ANd I'll be gone next week too, because I'll be in Las Vegas on vacation.
But anyway, a number of people have asked me how I made my rotating sig image, and I normally tell them to look at the post I made in the "Sig Service" thread. The problem is that the "Sig Service" thread is enormous, and to paraphrase Mr. T, I pity the fool who tries to wade through it looking for one particular post.
So here, once again, is the technique for making a rotating sig.
Step One: Make sure you have a real webhost. You normally need a webhost in order to host pictures on the Internet anyway, but not all webhosts are real webhosts, ie- offer a full suite of webhosting services. Hosts like "photobucket" will host your picture but not allow you to publish full websites. What you want is a webhost that will let you publish real websites. To be more specific, they have to support the PHP scripting language. Ask your webhost if you are unsure whether they support PHP. Webhosts supporting PHP are ridiculously cheap nowadays; I've seen hosting packages for as little as $4 per month. There may even be some free ones, but I don't know any off the top of my head.
Step Two: Create a directory called "rotate.jpg" somewhere in your webhost's http documents directory (this is usually public_html for Apache, and httpdocs for IIS). Yes, you can create directories with dot extensions in their names.
Step Three: Create a file called "index.php" in the rotate.jpg directory. The file should be a text file with the following contents, which you can copy and paste into Notepad and then save:
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);
}
}
?>
Step Four: Upload all of your sig images into the "rotate.jpg" directory.
Step Five: In your sig, create an image tag linking to http://www.yourdomain.com/rotate.jpg (assuming you made rotate.jpg in your web root directory, and obviously, replacing yourdomain.com with your actual webhost URL).
And there you have it: 5 steps to creating a rotating sig image. It will automatically identify and use any GIF, PNG, or JPG images in the rotate.jpg directory, and you can add new images whenever you want by simply uploading them.
By the way, my current sig image lineup looks like this:
http://www.stardestroyer.net/BoardPi...tionTheory.jpg
http://www.stardestroyer.net/BoardPi...Conspiracy.jpg
http://www.stardestroyer.net/BoardPi...heRepublic.jpg
http://www.stardestroyer.net/BoardPi...ourThyTool.jpg
http://www.stardestroyer.net/BoardPi...gentDesign.jpg
http://www.stardestroyer.net/BoardPi...nTheSith-1.jpg
http://www.stardestroyer.net/BoardPi...nTheSith-2.jpg
http://www.stardestroyer.net/BoardPi...nTheSith-3.jpg
http://www.stardestroyer.net/BoardPi...nTheSith-4.jpg
http://www.stardestroyer.net/BoardPi...tRobertson.jpg
http://www.stardestroyer.net/BoardPi...egalomania.jpg
http://www.stardestroyer.net/BoardPi...rnInfantry.jpg
http://www.stardestroyer.net/BoardPi.../Saxenfelt.jpg
http://www.stardestroyer.net/BoardPi...eTheMoment.jpg
http://www.stardestroyer.net/BoardPi...igs/Sodomy.jpg
http://www.stardestroyer.net/BoardPi...anuckistan.png
http://www.stardestroyer.net/BoardPi...troyer_Net.jpg
http://www.stardestroyer.net/BoardPi...sigs/WWRJD.jpg
As you can see, the number of images you can use is pretty much unlimited, for all practical intents and purposes.
Re: How to make a rotating sig
I think this website (http://www.randomimage.net/) does the same thing, or something similar? But it's FREE. :)
Re: How to make a rotating sig
Also, www.addyour.net is great also. Thanks to The Seleucid Empire for showing it to me.
Re: How to make a rotating sig
Quote:
Originally Posted by therussian
Also,
www.addnet.com is great also. Thanks to The Seleucid Empire for showing it to me.
Actually, it's http://www.addyour.net/ , but no problem. :thumbsup:
Re: How to make a rotating sig
very nice script but i was wondering if u could some how make a script that randomly selects a sig and the avatar to match it.. ive seen alot of people doing this on a different site. thx ^^
Re: How to make a rotating sig
Avatars are hosted by this site automatically, so im not sure if it can be done.
Re: How to make a rotating sig
You should be able to do the same thing, just put the address where the "Enter Avatar URL:" box is. It might want to save it locally, so it might not work.
As for matching the two up, it would be possible, but would require some more extensive coding. Maybe storing cookies of the number signature/avatar you are looking at, and matching it up? A switch structure? I'm not sure.
Re: How to make a rotating sig
it can be done ive seen people do it so there has to be some way. maybee darth would know but he hasnt been on
Re: How to make a rotating sig
for an avatar the easiest is maybe to use an animated gif?
Re: How to make a rotating sig
Considering the size (kb's) restriction on avatars an animates gif with any detail is somewhat unfeasible.
Re: How to make a rotating sig
Quote:
Originally Posted by Zuwxiv
You should be able to do the same thing, just put the address where the "Enter Avatar URL:" box is. It might want to save it locally, so it might not work.
As for matching the two up, it would be possible, but would require some more extensive coding. Maybe storing cookies of the number signature/avatar you are looking at, and matching it up? A switch structure? I'm not sure.
how good are u with PHP think ud be able to set this up..?
Re: How to make a rotating sig
Quote:
Originally Posted by Darth Wong
Step One: Make sure you have a real webhost. You normally need a webhost in order to host pictures on the Internet anyway, but not all webhosts are real webhosts, ie- offer a full suite of webhosting services. Hosts like "photobucket" will host your picture but not allow you to publish full websites. What you want is a webhost that will let you publish real websites. To be more specific, they have to support the PHP scripting language. Ask your webhost if you are unsure whether they support PHP. Webhosts supporting PHP are ridiculously cheap nowadays; I've seen hosting packages for as little as $4 per month. There may even be some free ones, but I don't know any off the top of my head.
Normally you get 40MB of web space free with you ISP when you sign up as a customer.