bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

HACK: User avatar from WPMU Avatar Plugin

(5 posts)
  • Started 1 year ago by nolageek
  • Latest reply from bloggsbe
  • This topic is not resolved
  1. nolageek
    Member

    If anyone is using ' Avatar pluginsuleiman, here's a hack I use to show the WPMU's avatar in BBPress:

    In post.php, after the <small><?php post_author_title(); ?></small> bit I use the following:

    <?php
    $userid = get_post_author_id();
    $wp_avatar = '/full/path/to/public_html/wp-content/avatars/' .$userid. '.jpg';
    $wp_avatarURL = '/wp-content/avatars/' .$userid. '.jpg';
    
    if (file_exists($wp_avatar)) {
    echo '<img class="avatar" src="'. $wp_avatarURL.'" />';
    }
    ?>

    Probably not the most elegant, but it works:

    http://blognola.org/forums

    Vincent

    Posted 1 year ago #
  2. thanks for the hack vincent, I'm glad to see you got it integrated into bbpress. I'm using your hack myself :)

    Posted 1 year ago #
  3. nolageek
    Member

    oh neat! :) You're very welcome.

    Posted 1 year ago #
  4. hempsworth
    Member

    Awesome, thanks for this!

    Posted 1 year ago #
  5. Hi!

    I've made a plugin to do the same. Makes it easy to show the avatar in posts and profile. It's just to drop one line in e.g. post.php, and the avatars shows up.

    You can check it out -> download.
    --
    Rune

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.