4096) { $errormessage[]="the file size must be lower than 4Kb"; } $ext = strrchr($userfile_name, '.'); if($ext !== false) { $custom_name = substr($userfile_name, 0, -strlen($ext)); } else { $custom_name = $userfile_name; } $custom_name = strtolower($custom_name); if(strlen($custom_name) > 250) { $custom_name = substr($custom_name, 0, 250); } $custom_name .= '.gif'; if(!preg_match("/^[a-z0-9_-]*\.gif$/",$custom_name)) { $errormessage[]="please give a senseful filename devoid of dumb characters, kthx? (nothing but alphanumerics, dash and underscore is allowed)"; } if(file_exists("avatars/".$custom_name)) { $errormessage[]="this filename already exists on the server"; } // if everything is ok if(!$errormessage) $submitok=true; } if(!$submitok&&file_exists($userfile)){ unlink($userfile); } if($submitok) { copy($userfile,"avatars/".$custom_name); unlink($userfile); /* // reward the user $query ="INSERT INTO avatars SET "; $query.="avatar='".$userfile_name."',"; $query.="user=".$user["id"].","; $query.="added=NOW()"; mysql_query($query); */ } if($errormessage) { ?> \n"); } ?>
error:".$errormessage[$i]."

some of the currently available avatars
\n"); if(($i%$grid)==$grid-1) { print("\n"); } } /* while($entry=$d->read()) { $i++; print("\n"); if(!($i%8)) { print("\n"); } } $d->close(); while($i%8) { $i++; print("\n"); } */ ?>



upload a new avatar
in order to upload a new avatar, make sure to follow those rules:
  • it's a .gif file
  • it's 16 pixel width
  • it's 16 pixel height
  • it's 4Kb max.
  • the background color is set to transparent
if everything's ok, you can upload your file by using the browse button below.

then your avatar will be available with the others.