Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


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
Very Neat Tutorial, Thanks for this jimmy!

Reply

RE: Making your own Sig Randomizer #3
No problem. Glad you like it.
[Image: JchOGM.png]

Reply

RE: Making your own Sig Randomizer #4
Please keep coming out with more tutorials Jimmy !

Reply

RE: Making your own Sig Randomizer #5
This is a really nice tutorial!

Reply

RE: Making your own Sig Randomizer #6
Oh I love this, great tutorial!

I've used it for my avatar on some sites before.

Spoiler:
[Image: cycl.php]
How soon, unaccountable, I became tired and sick;
Till rising and gliding out, I wander’d off by myself,
In the mystical moist night-air, and from time to time,
Look’d up in perfect silence at the stars.

Reply

RE: Making your own Sig Randomizer #7
Thank-you, Jimmy! Smile

Reply

RE: Making your own Sig Randomizer #8
Very helpful tutorial, thanks Jimmy. Smile
[Image: U2JKI5T.png]

Reply

RE: Making your own Sig Randomizer #9
I already made a tutorial for this, but it's a cool trick regardless. >_<

[Image: rotate.jpeg]
[Image: rotate2.jpeg]

http://www.discussionzone.net/Thread-How...ting-Image
[Image: iOgmBiXM3rChO.gif]

Reply







Users browsing this thread: 1 Guest(s)