avatar plugin

avatar plugin by Gina Häußge, Michael Klier
Insert a gravatar into a wiki page, also needed by the discussion plugin. (previous authors: Esther Brunner)

Last updated on 2009-02-10. Provides Syntax, Helper.
Compatible with DokuWiki >rc2009-02-06.

Tagged with avatar, gravatar.

:!: Only upgrade the plugin if you're running the latest DokuWiki version! :!:

Download plugin-avatar.tgz

Syntax

{{avatar>[user|mail]?[size]|[title]}}
{{gravatar>[user|mail]?[size]|[title]}}
[user] the registered user for which you want to display an avatar required
[mail] the e-mail address for which you want to display an avatar image required
[size] either s(mall) = 20×20 pixel, m(edium) = 40×40 pixel, l(arge) = 80×80 pixel, xl (extra large) = 120×120 pixel optional; default is medium
[title] the name of the person the mail address belongs to or some other title text optional; default is the obfuscated e-mail address

By padding the e-mail address with spaces you can define the alignment like with images.

The {{gravatar>...}} syntax is still supported, but not recommended.

Local Avatars

If you don't want to use the monsterid script or the gravatars from http://gravatar.com, you can upload your own avatars into the user namespace. For a user named foo this would be an image user:foo.jpg for example and the syntax:

{{gravatar>foo}}

The username has to be lowercase and follow the pagename naming rules. If unsure, you get your username for example the recent changes log etc.. Supported image types are jpg/png/gif.

Demo

Bugs / Feature Requests

Please report bugs or feature requests at the Bug tracker.

Further Resources

Changes

Discussion

FIXME: When used with the Discussion plugin, username.jpg is not found, because _getAvatarURL($user, …) (and getXHTML) receives the user's EMAIL instead of its login name. :( Most likely the Discussion plugin is to be fixed.

Fixed in the discussion plugin as of 2008-08-08. — Michael Klier 2008/08/08 19:44

It gave me the error “Fatal error: Call to undefined function isvalidemail() in /lib/plugins/avatar/helper.php on line 94” when I tried to use it. Searching the net I found a fix at this site (translated). You change the function call from isvalidemail to mail_isvalid in /lib/plugins/avatar/helper.php, line 94. It should look like:

// do not pass invalid or empty emails to gravatar site... 
       // if (isvalidemail($mail) && ($size <= 80)){                 //old line
       if ( mail_isvalid ( $mail )  && ( $size  <= 80 ) ) {          //fixed line
         $src  = ml ( 'http://www.gravatar.com/avatar.php?' . 
           'gravatar_id=' . $seed . 
           '&default=' . urlencode ( $default ) . 
           '&size=' . $size . 
           '&rating=' . $this -> getConf ( 'rating' ) . 
           '&.jpg' , 'cache=recache' ) ;
       ...

I was using it with the Discussion plugin, but I don't think that had anything to do with it. - Matt 2009/02/11

This has been fixed in the devel version as of 2008-10-13 already (when DokuWiki changed the isvalidmail() function), we had to wait until the new release to release an update of the plugin because it wouldn't have been compatible with the old DokuWiki version. We've just released a new version of the plugin which contains the changes. — Michael Klier 2009/02/12 10:16
I was having this same problem, and tried to update the avatar plugin to solve it, but it did not worked. I manually did the modification proposed by Matt and it is working now. — Uderman 2009/03/19 08:31
 
plugin/avatar.txt · Last modified: 2009/05/20 20:01 by foosel
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsDarcsXRefTranslate