Gravatar in comments

Hi,
I've coded a (very) little plugin to add gravatars in comments. It's really really simple (a few lines of code) but it make theme code a bit more simple / readable, so I figure I might post it here.

Here is the page with explanation / download / example image : http://blog.pcitron.fr/zenphoto-gravatar/
Here is the direct download : http://blog.pcitron.fr/wp-content/uploads/2009/08/gravatar.0.1.zip

PS: at first, I wanted to make it a filter, but unfortunately, I didn't find a way to make it work for already posted comments ... so I just made this function which is simple to use in themes.

Comments

  • acrylian Administrator, Developer
    Thanks, will add an entry on our plugins page later.

    I think you should mention that the functions needs to be added to the comment_form of the comment_form plugin.
  • Ah, no, it's not added to the comment_form plugin, it's directly used in the theme image.php file, in the "while (next_comment())" loop !
  • acrylian Administrator, Developer
    Well, with 1.2.6 none of the standard themes has that loop in that form anymore...:-) That code is now in the comment_form plugin and print by `printCommentForm();`.
  • Oh, ok. I was using a customised version of stopdesign since ... I don't remember when, so I didn't notice that.
    Will this kind of loops get deprecated, or will it still be supported for a while ? Anyway, I will check this comment_form plugin and the associated function.

    Wouldn't it be possible to make the printCommentForm() function hookable / overridable (I mean, provide a way for developpers to add their own filter to modify the printCommentForm() behavior ?)
  • acrylian Administrator, Developer
    It is just that all comment handling code has been moved to the plugin to avoid having the same code in several places to maintain.
    The loop is still there and of course you can still use it directly on the theme files as you do, too. The actual comment form is a separate file in `plugins/comment_form/comment_form.php` that of course can be customized.
  • I have been playing about with this plugin, but I can't get it to work. Where about's in the image.php do the put the following line of code?? "echo get_gravatar(getCommentAuthorEmail(), 40);"
  • acrylian Administrator, Developer
    You have to look at `zp-core/zp-extensions/comment_form/comment_form.php`. That gravatar plugin is quite old and its doc has not been updated by the author to reflect changes made in Zenphoto.
Sign In or Register to comment.