Switch to full style
Off topic, but don't go too far overboard - after all, we are watching...heh.
Post a reply

Random avatar

Sun Dec 07, 2003 9:42 am

someone know how to make it happen, where you have a website and lets say you got 20 avatars. So when somelooks at your post the avatar changes each time he returns to your post?

Or it cycles like every 15 mins or so?

Sun Dec 07, 2003 2:08 pm

Only way to do that is to have a PHP script on a remote website that cycles images.

Don't ask me how to write the script, as I really dont know.

Sun Dec 07, 2003 2:12 pm

thats what i'm looking for

Sun Dec 07, 2003 2:13 pm

Bingo :)

<?php
/*
In the forum you visit where it asks for the url
of your avatar just give the file name and address
of this script and you will have a random avatar!
Enjoy! :)
*/

$avatars = array (1 => "avatar1.gif", "avatar2.gif", "avatar3.gif"); //Your Avatar filenames
$url = 'http://www.yourwebaddress.com/images/avatars/'; //Your or the site/dir they are located
$avatar_number = rand(1,3); //Change 3 with the number of Avatars you have
$rand_avatar = "$avatars[$avatar_number]";
header("Location: $url" . "$rand_avatar");
?>

Sun Dec 07, 2003 2:38 pm

thanks now just need to figure out how to use it.

Do i put that whole script in the avatar section or somewhere else.

Sun Dec 07, 2003 3:03 pm

Nope, you have to have some web space that supports php. You put the script in a file on the web server and point the avatar link to the script.
Post a reply