1
   

Random avatar script

 
 
Reply Tue 14 Oct, 2003 11:57 pm
Code:<?php
/*
1. Setup the names of the avatar images.
2. Upload the images to a directory on a website.
3. Input the correct URL for the directory where the avatars are located.
4. Upload this script somewhere.
5. In the forum you visit specify the address of this script as your remote avatar.
*/

$avatars[0] = "stewie.realworld1.jpg";
$avatars[1] = "baby.gif";
$avatars[2] = "look.gif";
$avatars[3] = "stewey1.gif";
$avatars[4] = "clippy_non.gif";
$avatars[5] = "inhead.gif";
$avatars[6] = "cubicles.gif";
$avatars[7] = "scream.jpg";
$avatars[8] = "geek.gif";
$avatars[9] = "fatcat.gif";
$avatars[10] = "devil.gif";
$avatars[11] = "teddy.gif";
$avatars[12] = "ai.gif";
$avatars[13] = "blah.gif";
$avatars[14] = "cloud.gif";
$avatars[15] = "island.gif";
$avatars[16] = "falling.gif";
$avatars[17] = "bubble.gif";
$avatars[18] = "saddog.gif";
$avatars[19] = "crazycat.gif";
$avatars[20] = "yoda.jpg";
$avatars[21] = "bugeye.gif";
$avatars[22] = "me.gif";
$avatars[23] = "clown.gif";
$avatars[24] = "bunny.gif";
$avatars[25] = "sesidanca.gif";
$avatars[26] = "avatar_suspiria.jpg";
$avatars[27] = "static.gif";
$avatars[28] = "screamingeyes.gif";
$avatars[29] = "pb_cat.jpg";
$avatars[30] = "lilk.jpg";

$url = 'http://www.able2know.com/avatars/'; //The site/dir they are located
$avatar_number = rand(0,37); //Replace 30 with the number of Avatars you have
$rand_avatar = "$avatars[$avatar_number]";
header("Location: $url" . "$rand_avatar");
?>
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 4,741 • Replies: 7
No top replies

 
jespah
 
  1  
Reply Sat 18 Oct, 2003 06:37 am
I take it that this will only upload the avatars in the folder on the server, and people can't use their own collection of pictures?
0 Replies
 
Wilso
 
  1  
Reply Sat 18 Oct, 2003 06:40 am
bookmark
0 Replies
 
Craven de Kere
 
  1  
Reply Sat 18 Oct, 2003 07:06 am
Well first of all I need to say that this script will not work here. Allowing people to execure remote code is a small security hole. Allowing them to upload it is PLEADING for a hacked site.

I uploaded one for me because I trust me. I uploaded Monger's cause he's way cool and helps A2K a lot and with no recognition for it.

I then realized that it might be popular and had to draw the line because it's tedious to do (I have to upload images, then upload the script and check it for errors or even write it if the person doesn't know how, then I have to enter the database and change it to point to the user's script).

So it's really posted for people to use on other boards with less security.

The pictures defined can be changed, they just need to correspond with the images in the specified folder.
0 Replies
 
calicoguy
 
  1  
Reply Tue 17 Aug, 2004 03:02 pm
First off...sorry to bring up such an old thread.

I've used the script to have my own randomization of avatars for my forum. However, when I go into my profile and try to link to my script (using the link to remote avatar) it doesn't work. The script does work outside of the forums though. I noticed that you said something about making a change in the database. Would that solve this problem? I'm using version 2.0.10 if that helps.
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 17 Aug, 2004 04:00 pm
Most forum systems do not allow you to upload php files (and if they don't prohibit them they should).

I won't tell you how to disable that (as it would be a very bad idea, allowing people to run arbitrary code on your site) but what you can do is edit your account record manually in the database.

Either that, or you can just use the remote avatar area (it doesn't actually ahve to be on a remote site).

Regards
0 Replies
 
calicoguy
 
  1  
Reply Wed 18 Aug, 2004 10:16 pm
I did the manual edit in the database, and it works great. I still could never get it to work in the remote avatar area...but that's probably for the best.

BTW..thanks for your help!!!
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 18 Aug, 2004 10:33 pm
My pleasure
0 Replies
 
 

Related Topics

YouTube Is Doomed - Discussion by Shapeless
So I just joined Facebook.... - Discussion by DrewDad
Internet disinformation overload - Discussion by rosborne979
Participatory Democracy Online - Discussion by wandeljw
OpenDNS and net neutrality - Question by Butrflynet
Internet Explorer 8? - Question by Pitter
 
  1. Forums
  2. » Random avatar script
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 01/11/2025 at 02:59:00