Random avatar

Off topic, but don't go too far overboard - after all, we are watching...heh.
Turok

Random avatar

Postby Turok » 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?

User avatar
Posts: 1427
Joined: Fri Feb 28, 2003 12:00 pm
Location: Dayton, Ohio

Postby Ryan » 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.

Turok

Postby Turok » Sun Dec 07, 2003 2:12 pm

thats what i'm looking for

User avatar
Posts: 1427
Joined: Fri Feb 28, 2003 12:00 pm
Location: Dayton, Ohio

Postby Ryan » 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");
?>

Turok

Postby Turok » 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.

User avatar
Posts: 1391
Joined: Sun Dec 01, 2002 10:20 pm
Location: Dallas, Texas

Postby Mugzy » 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.
Mugzy
Senior Admin
Admin tool developer


Image

Return to The Smokin' Room

Who is online

Users browsing this forum: No registered users and 13 guests