Skip to:
Content
Pages
Categories
Search
Top
Bottom

HACK: User avatar from WPMU Avatar Plugin

  • @nolageek

    Participant

    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • @suleiman

    Member

    thanks for the hack vincent, I’m glad to see you got it integrated into bbpress. I’m using your hack myself :)

    @nolageek

    Participant

    oh neat! :) You’re very welcome.

    @hempsworth

    Member

    Awesome, thanks for this!

    @bloggsbe

    Member

    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

    @liyucmh1314

    Member

    so cool, thanks a lot!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar