Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

How to make a rotating signature


Josh
 Share

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

 

So there you have it, your very own rotating signature! Assorted links which you may need are provided in the next post.

Link to comment
Share on other sites

 

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. Some excellent ones are linked to in the WD&P Mega Topic.

Link to comment
Share on other sites

It's probably widely accepted enough to not be a problem but the proper mime type for .jpg images is still image/jpeg, not image/jpg.

 

Also, if you're rotating it every second, it may as well be random. It might be worth slowing that down or trying cookie based rotation.

Link to comment
Share on other sites

Terrific script. I like the way how its automated, allowing the user to add or remove images to the rotator by simply adding/removing files.

 

It may not work well with free webhosts though - they may have directory reading disabled and the gd library not installed, apart from capping CPU and memory usage. In such cases it would be better to store the images with an image host and make a redirect to their locations.

 

$images = array('http://i43.tinypic.com/blah.png','http://i39.tinypic.com/sssfssf.gif','http://im2s.imageshack.us/fwljwy.jpg');$idx = rand(0, count($images)-1);header('Location: '.$images[$idx]);

 

This would mean a trade-off by manual editing of the file every time an image needs to be added or removed from the rotator.

 

 

 

Link to comment
Share on other sites

I didn't really consider that GTArv, thanks. There are some good PHP webhsts out there for very little money which don't limit all of the points which you mentioned. And if I were to make it like that then it wouldn't be as easy for the user to make their rotator work. However in cases of free webhosts that is almost certianly a more advantageous routeto go down.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.