Skip to:

Avatars of member not showing in all blogs

Viewing 12 replies - 1 through 12 (of 12 total)
  • Profile photo of Toby


    really? No one has a solution?

    Profile photo of Paul Gibbs
    Paul Gibbs


    What version of BuddyPress and WordPress are you using?

    Profile photo of Christian Liem
    Christian Liem


    We had this same issue with our installation. The problem is in bp_core_avatar_upload_path and bp_core_avatar_url functions located in bp-core/bp-core-avatars.php.

    For bp_core_avatar_upload_path I changed this line:
    ` $upload_dir = WP_CONTENT_DIR . ‘/blogs.dir/’ . BP_ROOT_BLOG . ‘/files/’;`

    `$upload_dir = WP_CONTENT_DIR . ‘/uploads’;`

    For bp_core_avatar_url I changed this line:
    `$upload_dir = str_replace( get_blog_option( $current_blog->blog_id, ‘home’ ) , get_blog_option( BP_ROOT_BLOG, ‘home’ ), $upload_dir );`

    `$upload_dir = get_blog_option( BP_ROOT_BLOG, ‘home’ ) . ‘/wp-content/uploads/’;`

    This is probably not the best way to fix this but it works.

    Profile photo of Toby


    Christian Liem,

    Worked thanks

    Profile photo of chestnut_jp


    SInce BP 1.2.6 has the same problem, I would like to open my idea, which is based on @liemcc.

    As $upload_dir in bp-core-avatars.php seems to be correct, I changed $upload_dir only.

    At line 571 or so,

    `[ Original ]
    $upload_dir = str_replace( get_blog_option( $current_blog->blog_id, ‘home’ ) , get_blog_option( BP_ROOT_BLOG, ‘home’ ), $upload_dir );

    [ Changed ]
    $upload_dir = get_home_url( BP_ROOT_BLOG, ‘/’ ) . get_blog_option( BP_ROOT_BLOG, ‘upload_path’);`

    Note: There are some other way of correction, and I selected the above becuase I do not want to write the direct path like “/wp-content/” in case upload path changes in the future again.
    The reason why we have to change the original script is that WP 3.0.1 has changed upload path for the Blog ID 1 from blogs.dir to “wp^content/uploads” unless we change the default upload path, where “BP_ROOT_BLOG” means Blog ID 1.

    I hope this will be helpful for everyone and the next-version BP.

    Profile photo of Toby


    It’s happening again any suggestions?

    If you guys have fixed a reproducible bug in 1.2.6, please please make a ticket on so we can look at it and/or fix it in core. We can’t read every single thread all of the time on this forum due to time constraints :)

    Profile photo of Alberto


    Hi! I’m having same issue. No avatars on blogs.

    On main buddypress blog, avatars works great and their url’s are like this:

    On the other blogs, avatars aren’t displaying. Their url’s are like this:

    My installation info:
    WP: 3.0.3 (updated from a WP3.0)
    BP: 1.2.6
    Multisite & subdomains.

    My .htaccess:
    `# BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ – [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule . index.php [L]
    # END WordPress`

    Is it fixed for next release of buddypress? or is there a patch that I could apply?

    Thanks at all

    Profile photo of Andrea Rennick
    Andrea Rennick


    Look at the posts above yours: some DID post a patch up above. Did you try it?

    did you look at trac to see if a ticket was filed? If not, can you file a ticket?

    Profile photo of Alberto


    Yes, I found a ticket filled so I think It will be corrected on next version:

    For the moment, Is there any way to replace by_core_avatar_url() function without hacking de core directly?
    Maybe replacing an action or applying a filter?

    Profile photo of Dancort


    @overdrive I don’t if it may help you, but helped me:

    function bp_core_avatar_url_fix() {
    global $current_blog;

    // Get upload directory information from current site
    $upload_dir = wp_upload_dir();

    // If multisite, and current blog does not match root blog, make adjustments
    if ( bp_core_is_multisite() && BP_ROOT_BLOG != $current_blog->blog_id )
    $upload_dir = ‘/wp-content/uploads’;

    return $upload_dir;
    add_action( ‘bp_core_avatar_url’, ‘bp_core_avatar_url_fix’);

    Thanks @dancort
    This works for me

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Avatars of member not showing in all blogs’ is closed to new replies.
Skip to toolbar