NewsFeaturesDownloadsDevelopmentSupportAbout Us
Plugin gravatar

Plugin gravatar

From LifeType Wiki


Name: gravatar

Latest version: 20070302

Download link: http://prdownloads.sourceforge.net/lifetype/1.2_gravatar.zip?download

License: GPL

Author: Original by Dani Armengol, improved by Mark Wu

[edit] Description

Returns the URL of an (gr)avatar for every comment. The image is loaded from Gravatar.com but you need to sign up for the servirce and upload a valid gravatar before this plugin can be used.

You can also specify a custom image that will be shown whenever the given email address has no gravatar assigned.

[edit] Configuration

The plugin configuration page can be found under Control Center->Appearance Management.

In order to use, simply include the following:

  1. You can use {$gravatar->isEnabled()} to check the plugin is enabled or not from your templates.
  2. Use {$gravatar->gravatar($comment,$rating,$default,$size)} to get the Avatar image from Gravatar.com

Where:

  1. $rating is the allowed rating of avatar. Default is "G"
  2. $default is the URL of the default image that will be shown in case there is no gravatar available or if the user did not give an email address. You also can choose your default avatar from configuration panel. Default is "default.jpg"
  3. $size is the desired size in pixels of the gravatar. Default is 40.

This plugin requires some changes to be made to the templates. You should add the following code to postandcomments.template:

{if $gravatar->isEnabled()}
<img src="{$gravatar->gravatar($comment)}" width="{$gravatar->getSize()}" height="{$gravatar->getSize()}" align="left" />
{/if}

[edit] Notes

You can also add your own default avatar image to /plugin/gravatar/avatars. This plugin only support GIF and JPG format currently.