gravatar for b2

sorry, i removed my implemenation 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

  • No related posts

5 Comments Leave a Comment

Bubs [ Quote ]

Works just fine! :D

January 14th, 2005 at 12:12 am
Connie [ Quote ]

I LOVE YOU DODO!!!!!!!!!!!

I have tried all weekend to make it work for b2. :-( You are my saviour! :-D

January 14th, 2005 at 3:25 am
Connie [ Quote ]

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! :-D

January 14th, 2005 at 5:35 am
Connie [ Quote ]

Ok, done. :-) Adding the hack to b2functions really shouldnt be a problem for anyone, as it is EXACTLY the same as above. Works wonderfully!

January 14th, 2005 at 6:00 am
Kanu [ Quote ]

Wow this had to come as soon as I switched to wordpress lol! Awesome Dod =D Why did I not visit this site before x_x I am loving it!

January 15th, 2005 at 1:19 pm

Leave a Comment Name, email and comment are required.
Email will never be displayed.

Leave a Comment
  1. :biggrin: :blank: :blush: :bored: :confused: :cool: :down: :evil: :frown: :grin: :grr: :laidback: :left: :mad: :right: :sad: :secret: :shock: :smile: :stress: :tongue: :up: :wink: :yawn: :cute: :dead: :film: :floppy: :glasses: :grumpy: :headphones: :heart: :lightbulb: :ouch: :tv: :upsidedown: :vodka: :yell: :yuck: :yummy: