bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

avatars in wordpress and bbpress

(7 posts)
  • Started 6 months ago by affacat
  • Latest reply from BloggerDesign
  • This topic is not resolved
  1. affacat
    Member

    Hey all,

    So I've searched both this forum and the WP forum. And there are a ton of avatar related threads, and I've read through most of them. It looks like there have been a few various implementations.

    But most of those threads are almost a year old, and now we're in 2.5 and .9.0.1 land... and so I'd love a definitive uptodate answer as to which plugin(s) to use to best integrate avatars into both sites.

    Gravatars are cool and all (I do have an integrated user base) but pretty much the first question people asked is how they can upload an avatar without using gravatars (I think some people don't want their image suddenly showing up all over the web wherever they've commented in the passt)

    Posted 6 months ago #
  2. The Avatar Upload plugin is fairly well developed and I believe there is a hack to show them on the WordPress side as well. It does take a little bit of time to setup though.

    Posted 6 months ago #
  3. affacat
    Member

    OK, so it looks like the plugin version 0.8.3 still works in bbPress 0.9.1 - though I have not yet put it through heavy testing. I found the install directions left a little to be desired so I added more detailed directions below.

    However... I still have a question. Some of my users have adopted Gravatars since WP 2.5 was released. The plugin currently does not seem to check for gravatar existence, let alone provide some sort of control over precedence of different sourced avatars.

    The installation instructions DO provide you with the function to call to see if a plug-in uploaded/created avatar exists. However, in order to get the precedence working the way I'd like, I need to know how to test for a Gravatar existence as well. Any ideas? Thanks in advance.

    Any ideas?

    Install instructions:
    1. Download Plugin here:
    http://bbpress.org/plugins/topic/avatar-upload/
    Version 0.8.3 is current at time of this writing.

    2. Create the following two folders in your bbpress install:
    /my-plugins
    /avatars

    3. follow instructions (specifically, step 5) in the readme file which tells you where to copy files. Some files in the zip aren't mentioned (such as indenticon.php). I put those into my-plugins and so far, so good.

    4. Activate plugin.

    Posted 6 months ago #
  4. affacat
    Member

    to better illustrate my issue, my current code for the profile page is:

    if ( avatarupload_get_avatar(ID) ) {
    avatarupload_display($user->ID);
    } else {
    echo bb_get_avatar( $user->ID );
    }

    which means if uploaded avatar exists then display it, else get gravatar.

    but what i really want is:

    if uploaded avatar exists then display it, else if gravatar exists then display that, but if neither exists then display the avatar upload default avatar.

    Right now it displays gravatar default instead. which isn't my first choice since avatar upload would give me control over the default image which is better for obvious reasons.

    Posted 6 months ago #
  5. monstr
    Member

    affact, your code is just what i was searching for. unfortunately it just doesn't work :/

    Posted 5 months ago #
  6. affacat
    Member

    Not sure what you mean - the code I had above should do what I say it did, it just didn't do what I wanted.

    That said? I now have it working the way I wanted.

    This code:

    Gets the bbPress avatar, if it exists.
    Checks to see if it's an Identicon...
    No? Display it.
    Yes? Display Gravatar... but with the URL of the Identicon set as the default in case none exists.

    Problem solved.
    Note: I believe Gravatar recently integrated Identicons as a default setting, so you can probably do this now without Identicons setup in bbPress by modifying the code some. But this works.

    PROFILE.PHP:

    $ava = avatarupload_get_avatar($user->ID,1,1,0);
    if ( avatarupload_get_avatar($user->ID) && !(usingidenticon($user->ID) )) {
    avatarupload_display($user->ID);
    }
    else {
    echo bb_get_avatar($user->ID,48,$ava[0]);
    }

    POST.PHP:
    $ava = avatarupload_get_avatar(get_post_author_id(),1,1,0);

    if ( avatarupload_get_avatar(get_post_author_id()) && !(usingidenticon(get_post_author_id()) )) {
    avatarupload_display(get_post_author_id());
    }
    else {
    post_author_avatar(48,$ava[0]);
    }

    Posted 5 months ago #
  7. This code works fantastic! Thanks

    Posted 5 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.