If you want to setup random sigs or an avatar there are two ways you can go about it. The first way is easier so I'm sure you'll all do it.
EDIT: ** in the code means ] with shift held down (its disabled in here for some reason).
First Method
Go to www.cutandpastescripts.com and signup for an account, then when you've gotten your email from them and logged into the member area go to Random Images under Choose a Script. You have to have your images uploaded somewhere first and you paste the URLs to them on the site. Then they give you a code that looks like this:
Pasting that into your sig on here won't work because its HTML no BBcode, so what you have to do is erase everything up to and including <img src=" and everything after and including " alt so you should have something like this now:Code:<!- Random Images Script, by Cut and Paste Scripts. Hosted CGI, with NO adverts and FREE. http://www.cutandpastescripts.com -!><img src="http://www.cutandpastescripts.com/cgi-bin/randomimages/randomimages.pl?username=iouser" alt="Random Images"><!- Copyright Cut and Paste Scripts -!>
Now just put the [img] tag before it and [/img] after and you're all set.Code:http://www.cutandpastescripts.com/cgi-bin/randomimages/randomimages.pl?username=iouser
Second Method
This method takes some more time but is worth it as it can do alot more. It envolves using a php script, this script takes an inventory of all the image files in a directory and displays one at random.
What you need to do is copy this script to notepad and save it as a .php file (index.php is recomended but not required) and upload it to a directory that has your images.
To put it in your signature here again just put the URL to the file (or if you named it index.php the folder) in [img] tags and you're done.
Modification were made to the code in response to a problem when using PHP version 4.2.2 when array_rand isn't working properly.Code:<?php if ($dir = opendir(\".\")) { $list = buildimagearray($dir); displayrandomimage($list); ** // This function reads all the files in the current directory and adds all image files to the array $list[] function buildimagearray($dir) { while (false !== ($file = readdir($dir))) { if (!is_dir($file) && getimagesize($file)) { $list[] = $file; ** ** return $list; ** // This function selects a random image, determines the mime type, opens the file for reading, // and then outputs the image function displayrandomimage($list) { srand ((double) microtime() * 10000000); $sig = array_rand ($list); $size = getimagesize ($list[$sig]); $fp = fopen($list[$sig], \"rb\"); if ($size && $fp) { header(\"Content-type: {$size[\'mime\']**\"); fpassthru($fp); exit; ** ** ?>
The original code (above) is recomended if you don't have this problem, if you do use this one:
Comparing Method One to Method TwoCode:<?php if ($dir = opendir(\".\")) { $list = buildimagearray($dir); displayrandomimage($list); ** // This function reads all the files in the current directory and adds all image files to the array $list[] function buildimagearray($dir) { while (false !== ($file = readdir($dir))) { if (!is_dir($file) && getimagesize($file)) { $list[] = $file; ** ** return $list; ** // This function selects a random image, determines the mime type, opens the file for reading, // and then outputs the image function displayrandomimage($list) { $maxrand = sizeof($list)-1; $sig = rand(0, $maxrand); $size = getimagesize ($list[$sig]); $fp = fopen($list[$sig], \"rb\"); if ($size && $fp) { header(\"Content-type: {$size[\'mime\']**\"); fpassthru($fp); exit; ** ** ?>
The first method though easy is not hosted by you so it can be shutdown, removed, etc. also adding new images in is more of a problem because you have to go through their website each time and upload the images to another site. The second method needs a server with php support (hard to find one without php these days) the advantages to it are that you can have as many random images as you want (different sets) with the first method it's one random image set per account, secondly with the php script you don't have to add files just upload them to your server which you can use an upload script with to make even easier. The php script is a lot more customizable in other ways, you could modify it to say how many times each image has been viewed, almost anything.






