About Gravatar
Globally recognized avatars
Information
Released
January 21, 2011
Supported Database
MySQL
License
Public Domain
Supported Versions
2.0 - Current
Downloads
3,082
Instructions
Snippet: Gravatar Description: Globally recognized avatars
Version: 2 Author: Oleg Pryadko <[email protected]> Since: Jan 16, 2011 License: Public domain (except possibly class file, which is based on http://www.talkphp.com/script-giveaway/1905-gravatar-wrapper-class.html) Changelog 2.1: fixed SSL url, added profile support 2.0: added SSL, class files History: Version 1 Since: May 22th, 2010 Author: lossendae <[email protected]> License: Public domain
Usage:
To load Gravatar image URL with a snippet call use:
[[!Gravatar? &email=youremail
&size=yoursize
&rating=yourrating
&default=defaultavatar
]]
To load a profile URL with a snippet call use:
[[!Gravatar? &profile=1
]]
The options available are:
&email: the email adress of the user.
&size: the size of the returned image (between 0 & 512).
&rating: the rating of the image. Most of the time users only have the default one. Can be: g, G, pg, PG, r, R, x, or X
&default: The defaut avatar - can be an url or one the following choices: identicon, monster, wavatar, retro, mystery (monsterid and mm also ok)
&secure: Whether to use HTTPS or not. Set to 0
or false
to use HTTP, or set to true to use HTTPS. Otherwise, the snippet will automatically use HTTPS if the page that the snippet is on is accessed under HTTPS.
&extraParams: [NEW] JSON array of options to append to the URL. Please see the gravatar docs at http://en.gravatar.com/site/implement/ for the currently available options. Example: {"s":120,"option":"value"}
&profile [NEW]: [NEW] Instead of generating a URL to an image, generates a URL to the profile. See gravatar docs for examples on the different formats. Possible values:
0 or empty (default - link to profile image.)
1 or true (default profile URL/ VCF/ VCard)
json (JSON format)
xml (XML format)
php (PHP format)
qr (QR format)
Gravatar is output filter ready for email and size or filetype parameters.
For example, with Quip you can do it like that:
[[!Gravatar? &email=[[+email]]
]]
or with a specified size :
[[!Gravatar? &email=[[+email]]
&size=40
]]
or by using output filter directly on the placeholder:
[[+email:Gravatar]]
or with a specified size :
[[+email:Gravatar=40
]]
[NEW] You can also use a non-numeric output filter value to generate the profile (same as specifying &profile parameter):
[[+email:Gravatar=true
]] or [[+email:Gravatar=json
]]