Avatars Plugin

New Version (v11.1), released August 2012

WordPress (from version 2.5) includes native support for global avatars. Great! 🙂 But, what about adding local (private) avatars for your users? Maybe your users don’t want a global avatar, aren’t IT savvy enough to set a Gravatar up, simply want a private avatar for your blog, or any other reason too…

Please note, from v9.0 Avatars requires PHP version 5.1.3 or greater.

This plug-in does exactly that – users may add the ability to have a global (Gravatar), Twitter, or local avatar on your WordPress site. I’m quite pleased with it. 😳 So, I think it is worth shouting about, and sharing…

All I ask is that you credit the widget (i.e. include a link to this blog, enable the author credit option, or maybe add a link on your blogroll). Of course donations are an awesome way to recognise any value you get from using the plugin or encourage continuing development…

Plus there is also a sidebar widget extension to the plug-in that provides a feature allowing users to manage their avatar from the sidebar without having to use WordPress’ profile administration page. It provides the same capability as the profile page. This feature provides yet more support for users who may not, for example, be savvy enough to use the WordPress administration interface. I’m asking for a super-small fee (just £3.50) for this extension.

Local Avatars Widget

[SKU23484] £3.50 (Shipping £0.00)

Approximately one hour after payment your plugin will be emailed as a compressed ZIP to you PayPal payment address.

This small fee does not allow for any customisation of the widget, extra features, resolution of clashes with other WordPress plug-ins or themes, etc. So, please let me know if you want those and we can talk about options – who knows it might be such a killer idea that I’ll add it to the widget anyhow! However, the fee does include bona fide bug fixes; find something wrong with the plug-in, and I’ll fix it as quickly as possible.

Instructions to get the optional extension:

Click on the Buy Now button above and buy the extension securely via PayPal.

Then please be patient, PayPal will e-mail me and I will get straight back to you via e-mail with the extension and simple installation instructions.

The Avatars plug-in delivers the much requested feature of allowing users to upload their own local avatar. And, the latest feature allows your users to use their Twitter avatar. The order of precedence is; Local, Twitter, then Global. In other words, if you define a Local avatar for a user, that will be used, if there is no Local avatar defined and a Twitter ID is given for a user, the plugin will try to use that avatar. Lastly, where no Local avatar is defined and no Twitter ID is given (or Twitter doesn’t return a match), a unique Global avatar (Gravatar) will be generated.

Both of these features can be turned on and off by Administrators.

Features:

Have global or local avatars for your users.

Use Twitter avatars for your users.

Allow avatars to be included, securely, in your posts.

Detailed control over the default avatar to use for those users who have no global or local avatar. Allows a choice of a custom image, ‘mystery’ blank image, blank, Wavatar, Monster ID, or Identicon.

Wraps avatars in code to support SnapShots (www.snap.com), should your site use these.

Permits users to upload their own local avatars.

Example Screens

Avatars:Fig 1. An example of the main avatars page. Manage users global and local avatars etc.

Fig 2. The avatars options configuration section of the main avatars page.Fig 3. From the WordPress profile page, the new section allows users to upload their own local avatar.Fig 4. Popup used to manage Avatar images.

Optional Widget:Fig 5. Widget control options.

Fig 6. Optional widget.

Instructions:

Just put the plug-in into your plug-in directory on your WordPress hosting account (if this doesn’t make sense it probably isn’t something you should be trying 🙂 ) and activate it.

Use the form, Users » Avatars, to define any local avatars for your users. Specify the URI for an avatar image, something like http://your.domain/avatars/image.jpg, where avatars is a directory containing your local images.

Also you may set a default size (in pixels) for avatars and define a default image (e.g. http://your.domain/avatars/default.jpg) to use when no local or global avatar is available.

The code to include in your template files is documented on the Users » Avatars page too. To start with try:

Put get_avatar($post->post_author); in your single.php template file to show the post author’s avatar. You’ll need to declare global $post; in the file too.

Make use of this feature to generate a unqiue Wavatar (other options exist).

Internationalisation:
Avatars provides support for language translations. Ensure WPLANG is set in your wp-config file. To help with the available translations create a .po translation and compile a .mo file. If you would like this to be included in the general distribution please send these files back via the feedback link. I can’t accept any credit for these languages files, nor can I guarantee they are correct.

Available translations, from the English default, are:

Persian (WPLANG = fa_IR). Thanks to Mustafa Sufi.

Russian (WPLANG = ru_RU). Thanks to Fatcow.

French (WPLANG – fr_FR). Thanks to Adrien Schvalberg.

Spanish (WPLANG – es_ES). Thanks to Naceira.

Ukrainian (WPLANG – uk_UK). Thanks to Vadim Nekhai.

Portuguese Brazil (WPLANG – pt_BR). Thanks to Steff.

With regret I have closed comments on this post as I’m being deluged with queries that often boil down to “how to” requests, PHP coding advice, etc. and not issues with the Avatars plug-in or widget. So, if you want support, even advice, use the Feedback link and ask away… But please note I will ask for a donation before I’ll look at anything not related to Avatars bugs – I can’t teach PHP programming or WP configuration for free.

Version History:

11.1 – Sanitize upload filenames.

11.0 – Crop user upload image for use as avatar. Thanks to Barry Israel for the inspiration.

10.7 – Accidental removal of user editing avatar uploading section, now back where it should be!

The configuration options are under the Users menu on the Avatars item… Just like it says under the instructions above. 😉
You need to enter the path and filename of the local avatar – check the example above (3rd bullet of the instructions). Good luck.

Patung, there is no limit on the number returned and there is no pagination (just a simple list). So, are you sure you don’t have just the 50 users?correction, there is a limit set by WordPress! I will fix this and get an updated version out ASAP.

Update: Now fixed for user paging! Download from this page (link above) or wait till the WordPress.org hosting refreshes.

Dmitry, users cannot upload their own avatars. The admin must set them up; put the image files in a directory somewhere (e.g. /wp-content/avatars/) and then set them up under the Users >> Avatars menu…

I’m thrilled there’s something out there like this! I’ve always thought avatars/userpics/icons were a basic part of blogs… I was surprised to not see it part of the default WP package!

I’m wondering if there’s a way to allow an “Upload” system, even if only the Admin can set them up. E.g. some sort of “Upload” button that would take care of uploading the image and putting it in the proper directory. Would a future release maybe allow for the Admin to set users with the privileges to pick their own avatar?

Sorry Eh, I don’t think you are using the plug-in correctly. Are you using WordPress version 2.5? Just put the URI of a default image in as the default. If you put the same thing into your browser’s address bar it should show the image, if it doesn’t it’s wrong! So, there’s no way the plug-in can use it…

This is a goofy question, but what are the template files where I might put ? If I want the avatar to appear in the upper left of every post, or maybe in the footer of the post, next to the author name, what file would be appropriate for that?

I put get_avatars($comment); inside the comments loop of my comments.php template file to show the comment authors avatar, and get_avatar($post->post_author); in my single.php template file to show the post author’s avatar.

Are the comments.php and single.php pages you mentioned part of the default WP package? Where would I find them? (I’ve looked, but don’t see anything by those names, so I’m wondering if the names are different, or if I’m just looking in the wrong places.)

Just a note to thank you for your excellent Avatars plugin. I’m in the process of designing a blog for the Royal Society of Chemistry, and found your plugin very easy to use. I hope you don’t mind that in the version I’m using, I changed a value in the avatars.php to allow 90×90 avatars – the options list only went to 80. If this change is unacceptable please let me know and I’ll return to the original.

Been using your Avatar plugin for the past week and just installed the update. Wanted to drop by and say great job, simple, typical install, easy to configure and just works. Most pleased. Looking at your site I notice your “Rated Images” and “Recent Comments” and would like to know what plug these are. Be nice to add a rotating image such as yours and the avatar next to the recent comments is a nice touch. Appreciate it, keep up the good work.