Login Register






Tutorial Making your own Sig Randomizer filter_list
Author
Message
Making your own Sig Randomizer #1
Making your Signature Randomizer

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.

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 "random.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.

Upload all of the images which you want to be in your rotator to the "random.jpg" directory.

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

.jpg
.jpeg
.png
.gif

Step 4: Make the index.php file

Open up notepad 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.

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

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

Step 5: Save your rotator

Create an [IMG] tag which links to your random.jpg directory. An example is below.

Code:
[img]http://yourhost.com/random.jpg[/img]

[Image: JchOGM.png]

Reply

RE: Making your own Sig Randomizer #2
This is a very nice and detailed guide. I am sure it will help alot of people.

Reply

RE: Making your own Sig Randomizer #3
Very cool guide maybe I would use it if I wasn't so in depth haha
[Image: ghost_loading_sig_by_exposedgraphics-d75fc5u.gif]

Reply

RE: Making your own Sig Randomizer #4
This is a pretty sick guide, interested in making this.

Reply

RE: Making your own Sig Randomizer #5
Thanks for the comments guys. It's an easy method indeed.
[Image: JchOGM.png]

Reply

RE: Making your own Sig Randomizer #6
Nice, I'll play around with it a little tomorrow.

Reply

RE: Making your own Sig Randomizer #7
Thanks for the tutorial Jimmy.
[Image: Shift+Signature.png]

Reply

RE: Making your own Sig Randomizer #8
I was actually looking at one today. They were about $8 per license.

Reply

RE: Making your own Sig Randomizer #9
I wish that some sites still used the actually avatar/signature randomizer plugin. I still see it on TTG all the time.

Reply

RE: Making your own Sig Randomizer #10
That's a really neat trick. You could make an awesome 50/50 (http://www.reddit.com/r/fiftyfifty) script with this.

Nice, I already setted everything up. Thanks mate.
[Image: image.jpg]

Reply