My favorites | Sign in
Project Home Wiki Issues Source
Search
for
GlxGravatar  
Implementation of gravatar for Textpattern
Updated Oct 11, 2010 by pkollitsch

ATTENTION: I am restructuring the documentation. Entries containing this message are not reviewed yet and can contain errors or links that end up in nirvana.

glx_gravatar

Outputs a gravatar in comments. Developed by Johan Nilsson and maintained by Patrick Kollitsch. More info about Gravatars at gravatar.com

Download

current version is v2009.3 updated on July 3rd, 2009

glx_gravatar

just use

<glx_gravatar>
</glx_gravatar>
where ever you need a gravatar to be displayed. If you put this tag into a comment (display) form the gravatar will be constructed using the email address given by the current comment. If you put this tag anywhere else (where glx_gravatar has no access to a comment email address) you can supply an email address by the attribute email.

Parameters to change the display of the gravatar:

  • size (default 80) 0 bis 512
  • rating (default g) g, pg, r, or x
  • default (default gravatar-logo) define which image(s) to display when no email address is available. If this attribute is missing gravatar.com's white G on blue ground will be displayed. If you supply the url of an image here it will be used. Further it is possible to use gravatar.com's integraton of "identicon", "monsterid" or "wavatar". All three of them are creating random images.

Parameters for the image tag:

  • class (default gravatar) content of the class-attribute of the image tag.
  • alt (default empty) content of the alt-attribute of the image tag.
  • id (default false) adds an id attribute to the image tag.

Parameters that change the behaviour of the Gravatar:

  • disable: disable the creation of the gravatar (returns nothing). If ommitted disable is set to false.
  • format (url, image) if set to url the tag will return only the url, not the whole image tag.
  • fileextension (if the image should have an file extension set this to true to add an .jpg at the end of the filename of the image)
  • email: if you use this tag outside of the comment forms this attribute is needed to give glx_gravatar the email address to be encoded.

gho_author_email

Returns the author of the current article.

Examples

{{{

<glx_gravatar>
</glx_gravatar>
<glx_gravatar size="60" default="http://www.example.com/images/gravatar.png" class="gravatar">
</glx_gravatar>
}}}

used in the form comments it will show the gravatar of the current commentator

<txp:glx_gravatar email="address@example.com" />

shows the gravatar for address@example.com.

<txp:glx_gravatar email='<txp:gho_author_email/>'/>

Shows the gravatar for the author of the current article.

History

2009-07-03 2009.3

  • B: lowercased email addresses as this is the way they are saved at gravatar.com

2009-04-27 2009.2

  • D: fixed the example for gho_author_email
  • B: created URL was not XHTML compliant (&amp; instead of & now)

2009-04-23 2009.1

  • F: included only current features of gravatar
  • D: extended documentation
  • C: code review

2008-06-15 v.2008.1

  • F: Attribut email for use outside of the comment-form

2007-06-22 v.2007.1

  • C: new release for textpattern 4.0.4 (without cache)

Legend:

  • B: Bugfix
  • C: Code
  • D: Documentation
  • F: Feature
  • I: Internationalization

Sign in to add a comment
Powered by Google Project Hosting