bbPress

Simple, Fast, Elegant

bbPress support forums » Requests and Feedback

Avatars

(15 posts)

Tags:

  1. Anybody working on or know of an avatars plugin? One of my users is already asking about it...

    Posted 2 years ago #
  2. LordCoder
    Member

    Hello ,

    try http://gravatar.com/ .

    Posted 2 years ago #
  3. That's pretty cool, but the plugin is only available for WordPress. That means you'd have to call the wordpress tag within bbPress, and I dont load wordpress with my forum (way too complicated for what i need)

    However, somebody could take the wordpress code and customize it for bbPress :)

    Posted 2 years ago #
  4. LordCoder
    Member

    No , there's a very simple way , simply use this url as the image url :
    http://www.gravatar.com/avatar.php?gravatar_id=MD5

    MD5 should be replaced by the md5 hash of the poster's email address .

    Look at the "How the URL is constructed" section on http://gravatar.com/implement.php if you need more options like the size , rating ...

    Posted 2 years ago #
  5. Well u can try this. Donno if it gonna work or not .. right now 12:54am so i dont have the time to test it :) Try at ur own risk. Got problem dont blame me XD. Well if this was wrong feel free to fix it.

    function get_post_author_avatar() {
    global $bbdb;
    $id = get_post_author_id();
    $user = bb_get_user( $id );
    $usermail = $user->user_email;
    $default = "http://www.somewhere.com/homestar.jpg"; // Put your default avatar link
    $size = 40;
    $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&default=".urlencode($default)."&size=".$size;
    echo "<img src=\"$grav_url\" alt=\"Gravatar\" />";
    }

    Posted 2 years ago #
  6. LordCoder
    Member

    Thanks Atsutane , $user->user_email is what i searched for !

    Posted 2 years ago #
  7. Hi, because I am a bbpress baby, where does one make that change ?

    Posted 2 years ago #
  8. Shuldn't have to change anything. That's all bbpress code.

    Posted 1 year ago #
  9. It works for me, just had to change your variable name $usermail because it's supposed to be $email - so the code looks like this:


    function get_avatar() {
    global $bbdb;
    $id = get_post_author_id();
    $user = bb_get_user( $id );
    $email = $user->user_email;
    $default = "http://eastcoastwahines.com/images/gravatar.gif"; // Put your default avatar link
    $size = 40;
    $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&default=".urlencode($default)."&size=".$size;
    echo "<img src=\"$grav_url\" alt=\"Gravatar\" width=\"$size\" height=\"$size\" />";
    }

    Posted 1 year ago #
  10. TheGunMan
    Member

    You say this is bbpress code but after searching through every file I couldn't find any reference to avatar in any of the code. Where exactly is this block of code placed?

    Posted 1 year ago #
  11. TheGunMan
    Member

    Does anyone know?

    Posted 1 year ago #
  12. U can put that code as a plugin.

    Posted 1 year ago #
  13. Or you can use either of the avatar plugins available.

    Posted 1 year ago #
  14. TheGunMan
    Member

    Well thats a no go it screwed the whole forum up and I had to re-install. Has anyone acually got this thing working? If so can you post the exact instruction here please!!!!

    Posted 1 year ago #
  15. I use this plugin for MyBlogLog avatars, but looking at the code it seems to be already setup for Gravatars as well! Maybe take a look at it!

    http://bbpress.org/plugins/topic/36?replies=6

    Trent

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.