geeky

gravatar for b2

sorry, i removed my implementation because it slows down my comments form loading time too much.

if you wish to implement gravatar for b2, here’s how to do it. since i no longer have a copy of b2, i looked at Lissy‘s code.

open either b2comments.php or b2commentspopup.php depend on which one you are using

and find the line:

$commentdata = get_commentdata($rowc->comment_ID);

add below:

// just leave it blank if you don't want to use a default avatar image 
$default = "http://yourdomain/default_avatar_image.gif"; // the size of your avatar. in this case, it is 40x40. 
$size = 40; 
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=". md5($commentdata['comment_author_email']). "&default=".urlencode($default)."&size=".$size;

add the line below whereever you want your avatar to show up in your comment:

<a href="http://gravatar.com/" title="Get your gravatar at gravatar.com"><img src="<?php echo $grav_url; ?>" alt="Get your gravatar at gravatar.com" /></a>

if you use my threaded comments hack, you need to do similar things for my dodos_thread function in b2functions.php

6 thoughts on “gravatar for b2

    1. Works really well Dodo, here, I will try to add it to your threaded comment hack now. I will be back if I find something out of course. 🙂 By the way, I knew where I have seen Misty before, at the Osbournes! Your little one is famous! 😀

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s