Gravatar

What is a gravatar?

A gravatar, or globally recognized avatar, is quite simply an avatar image that follows you from weblog to weblog (or wiki) appearing beside your name when you comment on gravatar enabled sites. Avatars help identify your posts on web forums, so why not on weblogs and wikis?

How do I get a gravatar?

Signing up for a gravatar.com account is FREE, and all that's required is your email address. Once you've signed up you can upload your avatar image and soon after you'll start seeing it on gravatar enabled weblogs and wikis!

Sign up now!

Installation

Follow these steps to install this script on your wiki.

  1. Go to Service managmenent inside the Control Panel.
  2. Under Add Service, click Local and select type Extension.
  3. Enter a descriptive name and the SID: sid://mindtouch.com/2007/12/dekiscript
  4. Add "manifest" to the config section with value set to http://scripts.mindtouch.com/gravatar.xml
  5. Add extra configuration values as listed below under Configuration (If Configuration is not listed below, ignore this step.)
  6. Click on add service.

Related Links: DekiScript service, Extension Overview, DekiScript Overview, Extension Demos.


Overview

This extension allows embedding of Gravatar images. This script requires MindTouch Deki 8.05.2 or later.

Functions:

  1. gravatar

gravatar(emailhash, size, rating, default) : xml

Embed a Gravatar image.

Parameters:

NameTypeDescription
emailhashstr(optional) Plain email address, or hash of email address. (default: current user email)
sizenum(optional) Image size. (default: 80)
ratingstr(optional) Image rating. (one of "g", "pg", "r", or "x"; default: "g")
defaultstr(optional) Default image. (one of "identicon", "wavatar", "monsterid", or custom image uri; default: gravatar logo)


Source Code

<extension>
	<title>MindTouch Gravatar Extension</title>
	<label>Gravatar</label>
	<copyright>Copyright (c) 2008 MindTouch, Inc.</copyright>
	<description>This extension allows embedding of Gravatar images.</description>
	<uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/Gravatar</uri.help>
  <uri.logo>http://scripts.mindtouch.com/logos/gravatar-logo.png</uri.logo>

  <requires host="MindTouch Deki 8.05.2" />

  <function>
		<name>gravatar</name>
		<description>Embed a Gravatar image.</description>
    <param name="emailhash" type="str" optional="true">Plain email address, or hash of email address. (default: current user email)</param>
    <param name="size" type="num" optional="true">Image size. (default: 80)</param>
    <param name="rating" type="str" optional="true">Image rating. (one of "g", "pg", "r", or "x"; default: "g")</param>
    <param name="default" type="str" optional="true">Default image. (one of "identicon", "wavatar", "monsterid", or custom image uri; default: gravatar logo)</param>
    <return>
			<html xmlns:eval="http://mindtouch.com/2007/dekiscript">
				<body>
          <eval:let var="hash" value="$emailhash ?? user.emailhash">
            <img eval:src="uri.appendquery(uri.appendpath('http://www.gravatar.com/avatar', string.contains(hash, '@') ? string.hash(hash) : hash), { s: $size, r: $rating, d: $default })" />
          </eval:let>
				</body>
			</html>
		</return>
	</function>
</extension>


Samples


Output

To show the current user's gravatar:

{{ gravatar(user.emailhash) }} 


 

Tag page
Viewing 1 of 1 comments: view all
I added this extension and I can use it manually, but it does not appear in the Extensions dialog box with all of the other extensions which I have successfully added.
Posted 21:10, 31 Jul 2008
Viewing 1 of 1 comments: view all
You must login to post a comment.
Powered by MindTouch Deki v.8.08