Dashboard > blojsom 3.0 > ... > Plugins > Gravatar Plugin
  blojsom 3.0 Log In   View a printable version of the current page.  
  Gravatar Plugin
Added by Cliffano Subagio, last edited by Cliffano Subagio on Dec 23, 2007  (view change)
Labels: 

Availability

Gravatar Plugin v0.2 is available at Blojsom3 Plugins download page.

Description

Gravatar Plugin attaches a Gravatar ID to each blog entry comment, which can then be used to display Gravatar (Globally Recognized Avatar) image available from http://gravatar.com .

Installation and Setup

Place gravatarplugin-x.y.jar in /WEB-INF/lib/ directory.

Add the following to /WEB-INF/classes/blojsom-plugins.xml file.

<bean id="gravatar" class="com.mbledug.blojsom.plugin.gravatar.GravatarPlugin" init-method="init" destroy-method="destroy">
    <property name="eventBroadcaster">
        <ref bean="eventBroadcaster"/>
    </property>
</bean>

Modify HTML plugin chain from Blojsom administration menu plugins->mappings
Add "gravatar" to one of the flavor-based plugin chains. You can place it anywhere within the chain, for example:

html ..., gravatar, ...

Usage

Display gravatar image by using "gravatar-id" comment meta data.
E.g. for asual theme, search for the foreach and if-comment code in asual-entry.vm template, then add the code in between.

#foreach ($response in $approvedResponses)
    ...
    #if ($response.getType().equals("comment"))
        ...
        ######## START GRAVATAR PLUGIN

        #set ($gravatarId = $response.getMetaData().get("gravatar-id"))
        <img src="http://www.gravatar.com/avatar.php?gravatar_id=$gravatarId&size=40"/>

        ######## END GRAVATAR PLUGIN
        ... 
    #end
    ...
#end

Demo

Melbourne Photoblog

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators