Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to change avatar image size from bpthump to bpfull when viewing a topic


  • zofar143x
    Member

    @zofar143x

    Is it possible to change the image source for the avatars to the 150px version (bpfull) that is also being made by buddypress? The problem I’m having right now is that bbpress takes the 50px thumb image while my bbpress avatar size is 100px resulting in a fuzzy looking image.

Viewing 10 replies - 1 through 10 (of 10 total)

  • zofar143x
    Member

    @zofar143x

    Does anyone know how to do this?


    Laughing Cat
    Participant

    @laughing-cat

    To change BuddyPress avatars use_

    define ( 'BP_AVATAR_THUMB_WIDTH', 50 );
    define ( 'BP_AVATAR_THUMB_HEIGHT', 50 );
    define ( 'BP_AVATAR_FULL_WIDTH', 150 );
    define ( 'BP_AVATAR_FULL_HEIGHT', 150 );

    you can define custom sizes for your BP avatar, replace 50 or 150 with the size in pixel you want

    I’m trying to replace the size of the default bbPress forums avatar from 80 to 150px to match my BP_AVATAR_FULL size… bbPress 2.1 plugin is using 80by80px avatars by default apparently, do you know where to change that value to match 150px?


    zofar143x
    Member

    @zofar143x

    You can change the size of the avatar in bbpress in bp-reply-template.php on line 953. However, you will run into the same problem as I have. Even if you make it 150px it will still pull the thumb image which is 50px resulting in a fuzzy avatar. If you change the size of the thumb image to 150px your avatars in Buddypress will not look good. Solution? Make bbpress pull the BP_AVATAR_FULL instead of BP_AVATAR_THUMB. But how?


    Laughing Cat
    Participant

    @laughing-cat

    I’ve made some progress here:

    http://bbpress.org/forums/topic/bbpress-2-plugin-how-to-change-default-avatar-size-to-match-buddypress

    but I haven’t come with the right solution yet so far…

    ps – avoid hacking bbp core template files, you should use filters


    zofar143x
    Member

    @zofar143x

    Still haven’t found a solution either. I can’t imagine no one has run into this before, especially considering the number of people who use Bbpress and Buddypress together. Even if you use the standard setup it won’t look good as it will scale a 50px image to a 80px image.


    Laughing Cat
    Participant

    @laughing-cat

    Any news? I’m still stuck with this


    craftcore
    Member

    @craftcore

    Oh my goodness, this was driving me CRAZY! I figured out a solution that I hope will help you budddypress + bbress users out too!

    Go to loop-single-reply.php in the bbpress theme files.

    Find the line:

    <?php bbp_reply_author_link( array( 'sep' => '<br />' ) ); ?>

    This seems to be what is generating the avatar by default, so I commented it out and used the following code instead:

    <?php // bbp_reply_author_link( array( 'sep' => '<br />' ) ); ?>

    <?php

    $replyauthor = bbp_get_reply_author_id();

    if ( function_exists( 'bp_core_fetch_avatar' ) ) :
    echo bp_core_fetch_avatar( array(
    'item_id' => $replyauthor,
    'type' => 'full',
    'width' => 100,
    'height' => 100
    ));
    endif;

    ?>

    My forums are happy and unfuzzy now. Hope it works for you too!

    :3


    Aadhaar Card
    Member

    @psrb4u

    not working for me guys. anyone please…


    nchiari
    Participant

    @nchiari

    craftcore, your way works partially because the name and role are removed. I’m looking for this like forever, and I never found a way to fix it…


    venom_
    Participant

    @venom_

    Hi! I have solution of this problem.
    Open file `/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php` and find there this lines of code:
    `
    function bp_core_set_avatar_constants() {
    global $bp;

    if ( !defined( ‘BP_AVATAR_THUMB_WIDTH’ ) )
    define( ‘BP_AVATAR_THUMB_WIDTH’, 50 );

    if ( !defined( ‘BP_AVATAR_THUMB_HEIGHT’ ) )
    define( ‘BP_AVATAR_THUMB_HEIGHT’, 50 );
    `
    Just replace 50 to required size.

    P.S. Sorry for my English…

Viewing 10 replies - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.