Download Randvatars
Random Avatars - Gravatars - MyBlogLog Pic - Local Avatars
Here is a WordPress plugin which enables gravatars, MyBlogLog avatars, local avatar images as you wish, and defaults to showing a random avatar pic from your local set.
Just unzip it into \wp-content\plugins\randvatars (so the avatar images are all in plugins\randvatars\avatar\).

Note that you already have a \wp-content\plugins\ folder, but will not have a randvatars\ folder unless you have instlled this plugin before.
Next, activate Randvatars (via the dashboard plugins page).
That’s all you need to do for Gravatar and MyBlogLog avatars (or a random US Senator’s picture for commentors without either).
If you want more, fewer, or differently formatted pics in your avatar folder, you must also modify \randvatars\avatar\randy.php
$imgnum = mt_rand(1,100);
The above line is where it selects a random file name, from ‘rnd1.png’ through ‘rnd100.png’.
For more images, increase 100. For fewer, decrease it.
Obviously, your images should be named ‘rnd#.png’ sequentially.
For example, if you are using ten images of your own, name them from ‘rnd1.png’ for the first through ‘rnd10.png’ for the last.
Your images should be in png format, and 48×48 is recommended by all the best people even though few human heads are as wide as they are tall, so there must be a very good reason for it.
A note: ‘.png’ in the following line is not the only change necessary should you wish to use images in some other format.
$img = LoadPNG(’rnd’. $imgnum . ‘.png’ );
Don’t try to go .jpg or .gif unless you know what you are doing.
Or, ok, you could contact me with flattery and I’d probably make the changes for you, depending on the ratio of the scope of the flattery to the size of your ambition.
Custom avatars
Last but not least, you can give your regular posters an avatar without requiring them to register anywhere.
To give “Joe Poster” a specific local avatar, name a .png file “joe_poster.png” and drop it in the \randvatars\avatar\ folder.
That’s all lower-case, underscores for spaces or hyphens, plus whatever sanitize_file_name() does to the name.
Typically, that would be nothing else, unless you have some commentators using some odd-ball characters.
Again, if you get stuck there, drop me a line and I’ll help figure it out.
Changelog
2/16/2008 - Version 1.0: Randvatars! 3/12/2008 - Version 1.1: Fixed a bug with MyBlogLog avatars.
One Comment
Changelog
2/16/2008 - Version 1.0: Randvatars!
3/12/2008 - Version 1.1: Fixed a bug with MyBlogLog avatars.