Results 1 to 15 of 15

Thread: How to make a rotating sig

  1. #1
    Darth Wong's Avatar Pit Bull
    Join Date
    Nov 2005
    Location
    Toronto, Ontario
    Posts
    4,020

    Default 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:





































    As you can see, the number of images you can use is pretty much unlimited, for all practical intents and purposes.

    Yes, I have a life outside the Internet and Rome Total War
    "Oedipus ruined a great sex life by asking too many questions" - Stephen Colbert
    Under the kind patronage of Seleukos

  2. #2
    Captain Hastings's Avatar Tribunus Augusticlavii
    Join Date
    Apr 2004
    Location
    Sydney
    Posts
    12,999

    Default

    Thank you for that informative post DW, I shall have to try that one day.

    Sith sucks though.

  3. #3
    Saint-Germain's Avatar Comte
    Join Date
    Jul 2005
    Location
    The Emerald City
    Posts
    1,987

    Default

    Oops, shoulda stickied this ages ago.

    Stickied
    né Menander
    Under the covetous wing of Ozymandias
    Patronizing my favourite (not so) little guy, Turbo

    "With this weather, it might as well be Thursday..."

  4. #4
    Siblesz's Avatar I say it's coming......
    Join Date
    Apr 2003
    Location
    Beijing, China
    Posts
    11,174

    Default

    Thanks for the tips... always wondered how to go about and do it.

    I love your sigs. :laughing:

    Especially:

    and
    Hypocrisy is the foundation of sin.

    Proud patron of: The Magnanimous Household of Siblesz
    "My grandfather rode a camel. My father rode in a car. I fly a jet airplane. My grandson will ride a camel." -Saudi Saying
    Timendi causa est nescire.
    Member of S.I.N.

  5. #5
    Reidy's Avatar Let ε<0...
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,282

    Default 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.

    Under the rather spiffing patronage of Justinian.
    Grandson of some fellow named the Black Prince.


  6. #6
    therussian's Avatar Use your imagination
    Join Date
    Sep 2004
    Location
    Charlotte, NC USA
    Posts
    11,745

    Default Re: How to make a rotating sig

    Also, www.addyour.net is great also. Thanks to The Seleucid Empire for showing it to me.

    House of the Caesars | Under the Patronage of Comrade Trance Crusader. Proud Patron of Comrades Shadow_Imperator, Zenith Darksea, Final Frontier and Plutarch | Second Generation| ex-Eagle Standard Editor| Consilium de Civitate | Album Reviews

  7. #7
    Final Frontier's Avatar Just roaming around
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1,399

    Default 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.

    Happiness is a warm gun... | "Only a life lived for others is worthwhile." -Albert Einstein
    Bang bang, shoot shoot...19| Under the patronage of therussian
    | "I couldn't resist."

  8. #8
    Murakawa
    Join Date
    Jul 2006
    Posts
    3

    Default 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 ^^

  9. #9
    HMMcKamikaze's Avatar Taihō no heishi
    Join Date
    May 2006
    Location
    United States
    Posts
    449

    Default Re: How to make a rotating sig

    Avatars are hosted by this site automatically, so im not sure if it can be done.

  10. #10
    Zuwxiv's Avatar Bear Claus
    Join Date
    Jun 2004
    Location
    California
    Posts
    4,361

    Default 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.

    Currently worshipping Necrobrit *********** Thought is Quick
    I'm back for the TWCrack

  11. #11
    Murakawa
    Join Date
    Jul 2006
    Posts
    3

    Default 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

  12. #12
    King Edward I's Avatar Pietsch
    Join Date
    Dec 2005
    Posts
    541

    Default Re: How to make a rotating sig

    for an avatar the easiest is maybe to use an animated gif?

    [i][b]Working for the downfall of the Dark Tosser(s) for 5 years!
    Contact me to find out about CustomPCs for the UK!
    Like My Post? - Use the Button!
    MedievalTW - Feat. The TW Wiki
    Would you like your mod hosted for free? PM Me!

  13. #13
    Civitate
    Join Date
    Jan 2005
    Posts
    3,111

    Default Re: How to make a rotating sig

    Considering the size (kb's) restriction on avatars an animates gif with any detail is somewhat unfeasible.

  14. #14
    Murakawa
    Join Date
    Jul 2006
    Posts
    3

    Default 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..?

  15. #15
    Freddie's Avatar The Voice of Reason
    Join Date
    Oct 2004
    Location
    UK
    Posts
    9,529

    Default 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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •