Simple Gravatar avatars for Textpattern.
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
compiler
plugins/jcp_simple_gravatar
README.textile

README.textile

jcp_simple_gravatar

Simple Gravatarjcp_simple_gravatar — is a Textpattern plugin that simplifies the use of Gravatar avatars on your Textpattern site.

Documentation:

  1. Installation
  2. How to use
  3. Example use
  4. Information
  5. Source
  6. Bugs, issues or any other problems?

Documentation:

Installation

How to install Simple Gravatar.

How to use

Use <txp:jcp_simple_gravatar /> in your templates. It will return the gravatar URL.

There are four attributes, and all are optional;

email — custom email address for gravatar (if not specified, the plugin uses the comment author’s email)
user — get user’s gravatar (input: the user’s username)
default — default avatar, if no gravatar was found
default_local — default avatar. A local file, like images/9.png, that becomes http://yoursite.com/images/9.png (good for development)
size — the image size, in pixels (default: 80)
format — the file format, like .jpg or .png, without the dot (default: jpg)
where — is the gravatar in an article or in a comment? This is completely optional, Simple Gravatar can pick the right one for you.

Example use

In the comments form:

<img src="<txp:jcp_simple_gravatar default="http://thesite.net/images/avatar.jpg" size="50" format="png" />" width="50" height="50" />

May return:

<img src="http://gravatar.com/avatar/4fdce145bab6d27d69e34403f99fd11c.png?s=50&d=http%3A%2F%2Fthesite.net%2Fimages%2Favatar.jpg" width="50" height="50" />

In an article:

Author: <txp:author /><br />
<img src="<txp:jcp_simple_gravatar default_local="/images/6.png" size="60" />" />

May return:

Author: Andrew Dorsey<br />
<img src="http://gravatar.com/avatar/e0a2988a7d97b4def8426cbead7b1a9b.png?s=60&d=http%3A%2F%2Fmysite.com%2Fimages%2F6t.png" width="60" height="60" />

Get user’s avatar:

About Andrew:<br />
<img src="<txp:jcp_simple_gravatar user="andrew" />" />

May return:

About Andrew:<br />
<img src="http://gravatar.com/avatar/e0a2988a7d97b4def8426cbead7b1a9b.png?s=80" />

Information

Simple Gravatar for Textpattern is based on the glx_gravatar plugin by Patrick Kollitsch, and is licensed under the GNU General Public License v2.

Source

Source.

Bugs, issues or any other problems?

Please email me at jocapriconne at gmail.com.