To reach more readers the following post is in english (Um mehr Leser zu erreichen, ist der folgende Beitrag in englisch).

What does this plugin do?

The Comvatars plugin shows avatar images on user comments for WordPress blogs to uniquely identify the author of a comment much like various bulletin board systems do.

Make it quick. Where can I download it?

Download Comvatars 2.4 here!

Download Comvatars Avatar Images 2.4 here!

How do I install the plugin?

As with the most WordPress plugins, installation is easy:

  • Dowload the Comvatars plugin and extract it to your WordPress installation directory.
  • Download the Comvatars Avatar Images and extract them to your WordPress installation directory.
  • Activate the Comvatars plugin in your WordPress admin panel.

Ready. It couldn’t be easier. The rest is self-explanatory. ;)

Why is there so much text below?

Because I hate cool plugins that are badly documented. Even the smallest piece of code needs some documentation. The following text is (hopefully) pretty exhaustive and structured as FAQ. Feel free to skip the questions you are not interested in.

I want to test it. What do I need?

You need the following software to be installed on your webserver:

The sequence of installation doesn’t matter. Feel free to only install some but not all of the optional software. For the Gravatars and Favatars plugins, follow the installation notes on their homepages. The Comvatars plugin may also work fine with other versions of the other two plugins or at least WordPress, but wasn’t tested.

What is the difference to other similar plugins?

I am not reinventing the wheel. The Comvatars plugin combines the functionality of the Gravatars plugin by Skippy selecting avatar images from a central service on the internet and the Favatars plugin by Jeff Minard & Co taking favicons of URLs as avatar images. Additionally unlike the Gravatars and Favatars plugin, the Comvatars plugin is doing its job right after activation in the WordPress admin panel without any additional changes to your WordPress templates.

How does the plugin apply avatars to comments?

The Comvatars plugin not only combines the features of the above mentioned plugins, it also needs the Gravatars and Favatars plugins to be installed and activated to achieve the full functionality. You are free to run the Comvatars plugin without either one of them. In this case you only get parts of the functionality. Avatars will be applied by the following steps:

  • If a comment author has registered a local avatar via the Comvatars Manager (later more on this topic), this one will be taken.
  • Otherwise the Comvatars plugin choose a default avatar for the author. If the author comments on any other post the next time and provides the same name and email address as before, the same default avatar will be taken and so will clearly identify him.
  • If the Favatars plugin is activated, it will be used to find out the authors avatar by loading the favicon of the URL the author may have provided in his comment. This is the so called favatar. If a favatar is found, it replaces the default avatar of the Comvatars plugin.
  • Finally if the Gravatars plugin is activated it will be used to load the authors avatar from the Gravatar registration service. In case this fails the aquired default avatar of the previous steps will be displayed. If you don’t know what the Gravatar service is, just hurry and take a look at it. It’s free and besides this… it’s cool ;)

Note, that this describes how the plugin works internally. Logically the following precedence of avatars arises from the above:

  1. Registered Comvatar
  2. Gravatar
  3. Favatar
  4. Default Comvatar

This precedence can not be changed but influenced by not activating the Favatars or Gravatars plugin at all and so skipping their avatar assignment.

What else can I do with your plugin?

The plugin provides the following additional features:

  • Comvatars WordPress admin panel for easy configuration of the plugin
  • Providing avatars to your comments applied in the way described above without any additional configuration
  • A set of different pools of avatars where the Comvatars plugin can chose from
  • Extension or replacement of the avatar images in th pools by your own artwork
  • Authors can register their own avatars out of one of the avatar pools, if they are recognized as frequent comment authors
  • Managing of avatar registration is done by an easy to use management page
  • Management page comes styled like the WordPress admin pages but can easly be adopted to your own site style
  • Support of template tags to easily add avatars to your WordPress theme template at any place you want
  • Avatars can be styled with CSS by refering to a set of comvatar classes
  • Inclusion of pseudo XHTML tag <!--comvatar --> in your posts to force the printing of an avatar

What are the Comvatars Avatar Pools and what are they good for?

The avatar pools are containing the artwork the Comvatars plugin can chose from. The Comvatars plugin choses avatars to display for a user from one of the different avatar pools. The location of the pools can be modified in the Comvatars admin panel. If a user does not supply an email address in his comment he posts "anonymous" in terms of the Comvatars plugin. Otherwise he is an identified user. For both types of users there is a different pool, the Comvatars plugin selects the avatar from. You also can point both pools to the same directory. In this case anonymous and identified users will take their avatars from the same pool. The default settings of the Comvatars plugin automatically point to the directories of the provided avatar pools you can download from this site.

Comvatars Manager Screenshot

How can I extend the Comvatars avatar pools?

To extend the amount of avatar images in the Comvatars avatar pools just drop some new images in the pool directories. The file names do not need to follow any special naming schema. The plugin will recognize the new images the next time it will execute. Please note that changing the amount of images or even their names may also change the displayed avatars for previous comment authors of your blog unless they haven’t registerd an avatar.

What languages are supported and how do I install the language packs?

If you are a user of a language other than English, you may want to show Comvatars pages in your favorite language. With a little luck, it’s listed here and ready for download. Otherwise you may provide a translation on your own and drop a line so I can add a link to the list of translations. To install the Comvatars translation files just extract the desired language archive into your WordPress installation directory. The following languages are supported by the current version:

How does registration of avatars work?

Frequent comment authors of your blog can be rewarded to select their own avatar from a third pool of registered user avatars. In the Comvatars WordPress admin panel you can set an amount of comments a user at least needs to select his own avatar. If this threshold is passed, the Comvatars plugin will automatically add a link to the registration manager at the foot of the comment form for this user. By using the appropriate template tag, you gain more control over the position the link will be included in your theme template.

The user will have to confirm his avatar selection by answering a special confirmation email the blog will send after the avatar selection. A registered avatar will not be taken for any other user of your blog. Vice versa a user can only register unregistered avatars. To not use up all available avatars for registration, you can set a minimum limit for the amount of unregistered avatars in the Comvatars admin panel.

Comvatars Manager Screenshot

How to configure avatar registration?

The registration manager normally displays the avatar settings for a selected user. WordPress blog users with a configurable level can also access a search mask on the registration manager page, requesting the avatar status of any user. This also includes selection of avatars for this user. Nevertheless the user still has to confirm the confirmation email.

What do I have to consider when previously only using the Favatars plugin?

If you want to use the Comvatars default implementation, just delete the Favatars comment_favicon() template tags from your templates. If you still prefer using template tags instead of the Comvatars default implementation replace the Favatars comment_favicon() template tags to the Comvatars comvatar_image() template tag and turn the default implementation off in the Comvatars WordPress admin panel. Please note that both template tags aren’t interface compatible in case you have used parameters with the comment_favicon() tag. Nevertheless with comvatar_image() you can achieve the same functionality as with comment_favicon() by arranging the parameters differently.

What do I have to consider when previously only using the Gravatars plugin?

If you want to use the Comvatars default implementation, just delete the Gravatars gravatar() template tags from your templates. If you still prefer using template tags instead of the Comvatars default implementation replace the Gravatars gravatar() template tags to the Comvatars comvatar_url() template tag and turn the default implementation off in the Comvatars WordPress admin panel. Both template tags are interface compatible but comvatar_url() takes some additional optional parameters.

How does the Gravatars plugin options affect the Comvatars plugin?

If the Gravatars plugin is activated, then the Comvatars plugin will interoperate with its settings in the following way

  • The default gravatar rating will still apply
  • The default gravatar size will only be applied to the gravatar images
  • The Gravatars cache will be turned off
  • The local gravatars option will be turned off
  • The border color option will be ignored
  • The default gravatar image path will be ignored

Why should I use the Comvatars default implementation instead of template tags?

In short, it’s easier. The Comvatars default implementation may not be as flexible as template tags but it doesn’t need any further configuration to the involved plugins or your templates. It’s working right out of the box after activating the Comvatars plugin. This works great with the default WordPress 1.5 theme (also known as Kubrick), but may be a little tiny. If you wish to have more control over the layout, you should deactivate the default implementation in the Comvatars WordPress admin panel.

What do I have to do to use Comvatars template tags?

You can use template tags in your template right after installation but in that case you may want to turn off Comvatars default implementation in the Comvatars WordPress admin panel which is active by default.

Which functions can I use inside my theme?

comvatar_url(
  $name = '',
  $default_avatar_url = '',
  $icon_size = '',
  $display = true
); 
  • Returns an URL to an avatar image in all cases, either to a default one, favatar or gravatar.
  • name: (mixed) If empty, it will try to take the user information from the current comment. If no comment is processed at this time, the user name will be set to the localized text of Anonymous, the user email and user URL will be left blank. If name is set as string and is validated as, URL the address will be taken to receive the favatar from this URL. If name is set as string and is validated as email address, the address will be taken to receive the gravatar from the Gravatar service. If name is an array, it is expected to contain the user name in element 0, the users email address in element 1 and the users URL in element 2. Otherwise the name will be used to select a Comvatar.
  • default_avatar_url: (string) If set and no user name or user email is found valid or the script runs into an error this avatar will be displayed. The URL must be complete including ‘http://’. This is not checked. If it is empty, the plugin chooses an default avatar from one of the pools image from the plugin folder.
  • icon_size: (integer) If set and the Gravatars plugin is activated, it will override the Gravatars setting for this image and requests the image in the specified size from the gravatar service.
  • display: (boolean) If true, the resulting output will be printed at the position in the template where the tag is used and no value will be returned. If display is false, no output will be printed but the resulting string will be given back to the caller.
comvatar_image(
  $name = '',
  $default_avatar_url = '',
  $icon_size = '',
  $class_name = COMVATAR_DEFAULT_HTML_CLASS,
  $display = true
); 
  • Returns an HTML <img /> tag of an avatar image in all cases, either of a default one, favatar or gravatar. XHTML compliant.
  • The function parameter for the comvatar_image template tag are the same as the parameter for comvatar_url template tag. See the above function comvatar_url for an explanation of the parameter. Additionally the following parameter are defined:
  • class_name: (string) If set the default CSS class for th <img /> tag will overridden to the one defined in this parameter.
comvatar_image_link(
  $name = '',
  $default_avatar_url = '',
  $icon_size = '',
  $class_name = COMVATAR_DEFAULT_HTML_CLASS,
  $display = true
); 
  • Returns an HTML <a> tag with a link to the users homepage and an embedded avatar image if a user url could be found in all cases, either of a default one, favatar or gravatar. XHTML compliant.
  • The function parameter for the comvatar_image_link template tag are the same as the parameter for comvatar_image template tag. See the above function comvatar_url for an explanation of the parameter.
show_registration_manager_link();
  • Shows a link to registration manager for the current user
comvatar_registration_manager();
  • Displays the Registration Manager. Included inside a page, you are able to use your own style instead of the admin interface style

How can I print an avatar inside a post?

To print an avatar inside your blog posts, you don’t use template tags but HTML comment tags, these are replaced by the Comvatars plugin. Just type <!--comvatar ATTRIBUTES--> in your posts and this will be replaced by the avatar image. The ATTRIBUTES are of the same nature as in the template tags described above. The same behaviour applies here. Attributes are defined in the same way as (X)HTML attributes: NAME="VALUE". The syntax is as follows:

<!--comvatar
  [ name='' | user='' | email='' | url='' ]
  size=''
  default=''
  class=''
-->
  • name: If empty, or not defined and no user, email or url attribute is set, it will try to take the user information from the current comment. If no comment is processed at this time, the user name will be set to the localized text of Anonymous, the user email and user URL will be left blank. If name is set as string and is validated as, URL the address will be taken to receive the favatar from this URL. If name is set as string and is validated as email address, the address will be taken to receive the gravatar from the Gravatar service. Otherwise the name will be used to select a Comvatar. This attribute is mutual exclusive to the attributes user, email, url.
  • user: The name of the user. This will be used for Comvatars base functionality. This attribute is mutual exclusive to the attributes name.
  • email: The email of a user. This will be used for Gravatars functionality. This attribute is mutual exclusive to the attributes name.
  • url: The url of a user. This will be used for Favatars functionality. This attribute is mutual exclusive to the attributes name.
  • size: The size of the returned Gravatar(!) image. This overrides the settings in the Gravatar admin panel. Because favicons, comvatars and gravatars can all be of different size no width or height attribute will be given to the <img /> tag.
  • default: The default url to the avatar that should be displayed if all else fails. If set, the Comvatars functionality of selecting an avatar is overridden.
  • class: (string) If set the default CSS class for the <img /> tag will overridden to the one defined in this parameter.

How can I modify the appearance of the avatars?

Best practice is to modify the style.css file of your active theme and add a new entry:

img.comvatar {
  /* just an example configuration */
  border: 1px solid #000;
  background: #fff;
}

The Gravatars setting size can be overridden by a CSS style. Also use CSS to achieve a border. Remember when displaying a Favatars image, the original resolution is almost every time 16×16 pixel due to the .ico format of the image. So streching it to a size of e.g. 80×80 pixel with CSS may make it look coarse.

Are there currently any known issues about this plugin?

Currently it is not known of any bug in the Comvatars plugin.

Which versions of the Comvatars plugin do exist and what are their features?

  • 2005-08-07 Version 1.0
    • Feature: Providing avatars to your comments without any additional configuration (in case you haven’t used Gravatars and/or Favatars exentsively before)
    • Feature: Support of template tags to easily add avatars to your WordPress theme template
    • Feature: If no avatar could be found, then the author hasn’t provided any name, email and URL and a default avatar for anonymous comments will be used
    • Feature: You are free to extend or replace the default avatar collection by your own images
    • Feature: If the Gravatars plugin is activated, its related settings will be used to configure the Comvatars plugin
    • Feature: Avatars can be styled with CSS by refering to the comvatar class
    • Feature: You can include <comvatar /> tags in your posts to force the printing of an avatar (that’s how the avatar in the first answer is printed)
  • 2005-08-08 Version 1.1
    • Bugfix: Fixing a typo in the “height” attribute of the produced <img> tag
    • Change: Changing the tags to use inside your posts to a HTML comment syntax of <!--comvatar --> to not mess up (X)HTML validation in case the plugin is turned off
  • 2005-08-10 Version 1.2
    • Bugfix: Fixing display of Gravatar in WordPress admin panel
  • 2005-08-11 Version 1.3
    • Feature: Retrieving favatars for new comments even if the URL is redirected. This will not work if you “favatise” your blog. This new way may slow down your blog if you extensivley use <!–comvatar–> tags with http addresses as parameter.
  • 2005-08-15 Version 1.4
    • Bugfix: Now the plugin runs with PHP4, too (thanks to Gunnar)
  • 2005-09-04 Version 1.5
    • Bugfix: Collection path settings of the Gravatars plugin wasn’t used
    • Bugfix: Now using WP path settings instead of detecting them by ourself (thanks to Jason Penney)
  • 2005-09-20 Version 2.0: PluginGerman translationAvatars
    • Feature: Admin panel
    • Feature: Registration Manager page
    • Feature: Avatar registration for frequent comment authors
    • Feature: Localization support
    • Bugfix: Using Favatar-Redirection not always retrieved the favicon location
    • Change: Interaction with Gravatars plugin loosened
    • Change: No width and height attributes anymore at the retrieved avatar <img /> tags
    • Change: Changing parameter of comvatar_image()
    • Change: Using (X)HTML attribute syntax on <–comvatar –> tag
    • Change: The CSS class “comvatar” now applies to the <img> tag as also to the <a> tag it is embedded in
    • Change: Note that since now the pool images must be downloaded separately
  • 2005-09-25 Version 2.1: PluginGerman translationAvatars
    • Feature: New pool for registered users
    • Feature: After changing the path for registered avatars, all already registered avatar pathes will be fixed
    • Bugfix: In PHP 4 the template tag show_registration_manager_link() could be used more than once
    • Bugfix: Typo caused anonymous avatars not to work properly
  • 2005-10-16 Version 2.2: Intermediate version, not official
    • Bugfix: Fixing problems with hardcoded URLs when using mod_rewrite
  • 2005-11-15 Version 2.3: PluginGerman translationAvatars
    • Feature: Adding new option to allow user to use the native size of an avatar when using default implementation
    • Feature: Admin now can see who has registered a specific avatar
  • 2005-12-06 Version 2.4: PluginGerman translationAvatars
    • Bugfix: Request of Gravatars now casesensitve as implemented by Tom Werner. Thanks to Tom and John V
    • Bugfix: Changing Avatars from the WP Admin panel now works. A big thanks to Morten
    • Note: The .po files of the previous version will still work

What else do I have to know?

There’s a lot! Did you know that in a group of 23 people, at least two have the same birthday with the probability greater than 50%? Most of the world’s opals are mined at Coober Pedy and Andamooka in South Australia? Or even that during the Phony War (September 1939-February 1940) in WWII all poisonous snakes were killed at the London Zoo, to prevent these snakes to escape during a bombing raid? I bet you didn’t ;)

For the curious: A complete list of plugins running this blog can be found here.

For the daring: A complete list of plugins I had written for WordPress can be found here.

About this Article

Author: Sören

Published: August 7th, 2005

Category: Bloggen

196 Comments: Jump to the comments

Reply: Jump to the reply form



Reply