serendipity_plugin_comments and Gravatar / Favatar?

Creating and modifying plugins.
Post Reply
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

serendipity_plugin_comments and Gravatar / Favatar?

Post by blog.brockha.us »

Hi.

I recently added the gravatar plugin to my blog. Nice, I like it.
I configured it, that it first tries Favatar. The result is, that the comments directly below my articles use Favatars first and only if not found, try to get a Gravatar. This is, what was intended.

But the sitebar plugin serendipity_plugin_comments uses Gravatars only! The sidebar plugin definitly is affected by the Gravatar plugin, as it doesn't display any Avatar w/o the Gravatar Plugin. But it seems, that the Gravatar Plugin only hands Gravatars to the Sidebar.

On this page of my blog you can reproduce this problem.

P.S.: And Gravatar is not working at all at the moment at my site. I have a Gravatar, but the sidebar only displays the default Gravatar. But this seems to be a problem in the Gravatar service, as the image URL looks okay.
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Post by blog.brockha.us »

Aaah! I found the reason! :-)

The serendipity_plugin_comments plugin only hands the email of the commenter and not the url. Gravatar needs an email, Favatar needs an URL. Without the URL information, Favatar is not working, so the Gravatar Plugin directly falls back to Gravatar.

So serendipity_plugin_comments.php has to be patched at line 190:

Code: Select all

                $entry = array('comment' => $comment,
                               'email'	 => $row['comment_email'],
                               'url'	 => $row['comment_url'],
                               );
After this, Favatars are shown at the sidebar, too.
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Post by blog.brockha.us »

I've added some missing German translation to the serendipity_event_gravatar language file:

Code: Select all


@define('PLUGIN_EVENT_GRAVATAR_CACHING', 'Gravatare zwischenspeichern?');
@define('PLUGIN_EVENT_GRAVATAR_CACHING_DESC', 'Wenn Gravatar Bilder zwischengespeichert werden sollen, muss hier die Anzahl an Stunden eingetragen werden, die Bilder vom eigenen Server anstatt vom Gravatar Service abgeholt werden sollen. Dies wird mehr Traffic auf diesem Blog Server verursachen, dafür macht es die Avatar Darstellung unabhängiger vom Gravatar Service. "0" stellt das zwischenspeichern ab.');

@define('PLUGIN_EVENT_GRAVATAR_METHOD', 'Bitte den bevorzugten Avatar Typ wählen');
@define('PLUGIN_EVENT_GRAVATAR_METHOD_DESC', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat.');
Feel free, to add this to the CVS.
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Awesome. Keep cool stuff like this coming :-)

Committed and best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Post by blog.brockha.us »

I rechecked both of the repositories, everything looks fine.
Thanks for comitting!

The NEWS file in the SVN only lists changes in the core code, right? Else the comment_plugin fix is missing. :-)
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
The NEWS file in the SVN only lists changes in the core code, right? Else the comment_plugin fix is missing. :-)
True, NEWS is only for internal code. For plugins, we only sporadically have a ChangeLog. :-/

For the NEWS file, I often only list things there that readers of the NEWS file can make sense of. For things like the patch for a new variable, I usually don't list it in the NEWS file because of the small relevance. But if you think it's better to list it, you can now add it for yourself, if you like? :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Post by blog.brockha.us »

Well, the reader could be interested, that the comments sidebar plugin now supports favatars, too. :-)
(I wouldn'd mention the change of variable handling, as this realy makes no sense to the normal user.)
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
Post Reply