Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress Facebook Connect – Avatar problem.

  • @stef78

    Participant

    When logged in with Facebook connect, I’m getting this error message.
    Warning: constant() [function.constant]: Couldn’t find constant BP_AVATAR_THUMB_HEIGHT in /home/stefnitert/domains/regionofinterest.com/public_html/wp-content/plugins/bp-fbconnect/bp-fbconnect.php on line 83
    On this page: http://regionofinterest.com/members/stefnitert2/

    The avatar is also displayed to big in the recent active member avatars widget.

    This is the code on line 83 of /bp-fbconnect.php.
    function bp_fbconnect_replace_avatar( $img, $args ) {
    extract( $args );

    if ( $object != ‘user’ )
    return $img;

    if ( !$fbuid = fbc_get_fbuid( $item_id ) )
    return $img;

    $user = new stdClass;
    $user->user_id = $item_id;

    if ( !$height ) {
    if ( ‘thumb’ == $type )
    $height = constant( ‘BP_AVATAR_THUMB_HEIGHT’ );
    else
    $height = constant( ‘BP_AVATAR_FULL_HEIGHT’ );
    }

    if ( ‘thumb’ == $type || $height < 50 )
    $size = ‘square’;
    else
    $size = ‘normal’;

    return fbc_get_avatar( $img, $user, $height, $size, false );
    }

    Anybody have an idea how to solve this?
    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • @helpme1

    Participant

    there’s a problem I can’t even go into it help!!!

    @lufc1919

    Participant

    Having the exact same problem as @stef78 – Someone help, please! :(

    @linnarsson

    Participant

    I have this problem too!

    @linnarsson

    Participant

    I made a “solution” until someone have a better suggestion!

    With file “bp-fbconnect.php” explained above:
    if ( !$height ) {
    if ( ‘thumb’ == $type )
    $height = constant( ‘BP_AVATAR_THUMB_HEIGHT’ );
    else
    $height = constant( ‘BP_AVATAR_FULL_HEIGHT’ );
    }

    I just “removed” it completely by adding /* */ like this:

    /*
    if ( !$height ) {
    if ( ‘thumb’ == $type )
    $height = constant( ‘BP_AVATAR_THUMB_HEIGHT’ );
    else
    $height = constant( ‘BP_AVATAR_FULL_HEIGHT’ );
    }
    */

    In the “common.php” file found in the “wp-facebookconnect” folder go to line -66 and add “$dims2” like this:
    function render_fb_profile_pic($user, $dims = 32, $dims2 = 10, $size = ‘square’ ) {

    And change width=”{$dims}px” on line -68 to:
    width=”{$dims2}px”

    This was my quick “solution” using the standard bp-theme! Not the best but better than having the error message.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Buddypress Facebook Connect – Avatar problem.’ is closed to new replies.
Skip to toolbar