Mar 08 01
avatar

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. :oops: So, I think it is worth shouting about, and sharing…

The plug-in is available as a free download here.

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 (P&P £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.
  • This extension requires the Avatars plug-in, download it free (link above).
  • Please note, the widget is called User Avatar in the WordPress Widgets interface.

:star: Why not check out my other WordPress plug-ins too! :star:

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_avatars($comment); inside the comments loop of your comments.php template file to show the comment author’s avatar.
    • 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!
  • 10.6 – Avatar settings link.
  • 10.5 – Small change to hack for new (WP 3.3) Admin Bar style.
  • 10.4 – Add ‘retro’ dynamic automatic Avatar type.
  • 10.3 – Compress the paging header for Avatar tables, plus tidy up of table output code.
  • 10.2 – alt tag for avatar img.
  • 10.1 – Update for networked WP. Thanks to Michael D Tran.
  • 10.0 – New option to upsize local avatar images that are smaller than the set size. Thanks to Nicholas Craig.
  • 9.2 – Fix for local avatar upload to cope with the ever changing WP!
  • 9.1 – Update for Admin Bar in WordPress v3.1
  • 9.0 – WPMU/Network re-work. Thanks to Michael D. Tran for his efforts!
  • 8.3 – Allow Twitter ID for optional widget.
  • 8.2 – Control anchor wrapping of Avatars.
  • 8.1 – Simplified Twitter image URL logic.
  • 8.0 – Added option to try to use a Twitter avatar.
  • 7.6 – Check for required core WP upload functions, only required for themes that expose the user profile pages.
  • 7.5 – Use DOCUMENT_ROOT option for legacy users.
  • 7.4 – Root directory no longer DOCUMENT_ROOT.
  • 7.3 – Fix for user avatar upload that doesn’t need re-sizing and a Russian translation thanks to “Fatcow”
  • 7.2 – Class added to help with styling widget.
  • 7.1 – Update for Marc Adrian to provide support for option for showing text in the optional widget.
  • 7.0 – Support for user profile widget plug-in.
  • 6.8 – Option for nickname / first name & surname.
  • 6.7 – Fix for uppercase extensions.
  • 6.6 – Fix to scaling when upgrading from old version of plug-in without scaling option.
  • 6.5 – Upload file type check (thanks to SumoSulsi) and internationalisation preparation.
  • 6.4 – Error in file naming fixed, with some help from “noyz319″.
  • 6.3 – Oops, a bug (mistake) with the scaling size fixed.
  • 6.2 – Improved unique file name creation, optional avatar upload resizing/cropping, and PHP 4 fix. Thanks to Gioele Agostinelli.
  • 6.1 – Explanation of directory structure and ‘chmod’ fix, thanks to Tobias Schwarz.
  • 6.0 – Added feature to allow users to upload their own avatar.
  • 5.2 – Cope with WP 2.6 avatar default.
  • 5.1 – Minor fix to repetition of show avatars WordPress setting.
  • 5.0 – Avatar options should only be managed by Administrators.
  • 4.2 – Fix for credit option un-setting.
  • 4.1 – Author credit.
  • 4.0 – Wavatar, Monster ID and Identicon can be used.
  • 3.3 – Spelling fixes!
  • 3.2 – Added check for administration pages to stop user URL wrapping breaking comment editing.
  • 3.1 – Minor tweaks to usage text and options.
  • 3.0 – Added ability to place avatars in written post content (plus other tweaks).
  • 2.1 – Added example formatting information.
  • 2.0 – Added pagination of the commenters list too.
  • 1.0 – Added pagination of users list.
  • 0.1 – Initial release.

Series - WordPress Plug-ins

  1. Image Link WordPress Plug-in
  2. Last Year WordPress Sidebar Widget Plugin
  3. Simple Archive Plugin
  4. Avatars Plugin
  5. WordPress Post Country Plugin
    (with premium Google Mapping)
  6. Notices Ticker Plugin
  7. Comments with Avatars
  8. Simple WordPress Twitter Plugin
  9. WordPress Post Grouping Plugin
  10. WordPress Mapping Plugin
slideshow
Start slideshow with these images

62 Responses to “Avatars Plugin”

Comments are closed.
Please use the feedback link to send any comments to the adminstrator.