Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom avatars arent showed on single blogs in WPMU

  • @gigolme

    Participant

    The uploaded avatars are not showed on single blogs ! It shows the gravatars instead.

    P.S. The avatars are showed in buddypress Home. This happened after I upgraded to 1.2.4

    Any help ?

    Thank You :)

Viewing 25 replies - 1 through 25 (of 41 total)
  • @zebi

    Participant

    I’ve got the same problem…

    @miguael

    Participant

    Same with me after upgrade to 1.2.4.1
    WPMU 2.9.2.
    Please help ( @andy)?

    @richs0914

    Participant

    I, also, have this same problem (after upgrade to BP 1.2.4.1) running wpmu 2.9.2

    @richs0914

    Participant

    bump

    @lph2005

    Participant

    This same problem exists in WP 3.0 RC1 and BP 1.2.4.1

    @anmith88

    Participant

    Phew, I thought it was me… I am also having this issue. Running WP3.0 and BP 1.2.4.1

    @justbishop

    Member

    what @LPH2005 said.

    @nahummadrid

    Participant

    I was just about to create this topic. Also lost sitewide avatars after the switch to Multi 3.0+1.2.4.1.

    @smuda

    Participant

    same here :/

    @miguael

    Participant

    HELLO??? This is pretty bad! Does someone have a fix for this (even a temporary…)? @apeatling

    @foralien

    Participant

    If it’s still actual – I have a temporary solution

    This problem occurs because in 1.2.4 has been change the approach to how the avatars paths constract – now the BP rely on wp_upload_dir() function. That is pretty well on single-site installation or in the root blog of multisite installation (at least at wp 2.9.2) but in users blog (not root) it returns the wrong path. That’s why if you use bp-powered avatars in user-blogs (not main) you see the gravatar instead.

    For my installation I’ve written two filters to fix this (please grab the code below and put it into your bp-custom.php) – they are tested with WPMU 2.9.2 (subdirectories) and BP 1.2.4 with default upoad path (for example for member avatar it should be – path to wp-content/blogs.dir/1/files/avatars/user_id/avatar-file.jpg)


    function nfm_bp_avtar_upload_path_correct($path){
    if ( bp_core_is_multisite() ){
    $path = ABSPATH . get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    }
    return $path;
    }
    add_filter('bp_core_avatar_upload_path', 'nfm_bp_avtar_upload_path_correct', 1);

    function nfm_bp_avatar_upload_url_correct($url){
    if ( bp_core_is_multisite() ){
    $url = get_blog_option( BP_ROOT_BLOG, 'siteurl' ) . "/files";
    }
    return $url;
    }
    add_filter('bp_core_avatar_url', 'nfm_bp_avatar_upload_url_correct', 1);

    Hope, that would help :)

    @miguael

    Participant

    thanks alot!!! :-)

    @justbishop

    Member

    @foralien‘s fix did not work on my site. I use subdirectories for member sites…could that be the problem, and can the fix code be altered for use with subdirectory setups?

    @foralien

    Participant

    @justbishop I also use the subdirectories – so filters should be OK in this case
    but probably you have some custom avatar upload path or constant BP_ROOT_BLOG is not defined in your installation?
    another possible reason – the function that fetch avatars for members blogs does not use bp_core_fetch_avatar() but some other mechanism

    @justbishop

    Member

    thanks for the reply, @foralien! A lot of what you said has gone right over my head, though :/

    @foralien

    Participant

    @justbishop actually it’s difficult to say what exactly could be wrong (I’m not a coding expert unfortunately :) – but probably you can provide me with a link to your site
    I’ll try to check

    @justbishop

    Member

    http://www.clothunderground.com

    Thanks for the offer to help! I feel like I need a lot of it nowadays, unfortunately. I can’t wait until I’m familiar enough with BP to start helping others!

    @him666

    Participant

    i dont find the bp-custom.php file :(

    @justbishop

    Member

    @him666, you have to create one. It goes in the plugins folder ;)

    @nahummadrid

    Participant

    @foralien thanks, works like a charm….

    @kasper777ny

    Member

    Worked for me too, thank you very much.

    @anmith88

    Participant

    This worked on my Subdomain install, All I needed to do was edit the code so the correct file path was used. Thanks for the fix :)

    @poolie

    Participant

    great work @foralien!

    @foralien

    Participant

    @justbishop

    sorry for the delay with reply :))
    as far as I can see WP 3.0 default uploads paths are a bit different from WPMU 2.9.2
    but in your case it may be enough to correct paths in my filters

    in particulat in filter nfm_bp_avatar_upload_url_correct($url)
    use
    $url = get_blog_option( BP_ROOT_BLOG, 'siteurl' ) . "/wp-content/uploads/";
    instead of
    $url = get_blog_option( BP_ROOT_BLOG, 'siteurl' ) . "/files/";

    if it does not help – that would mean that WP 3.0 differently handle option upload_path (I still have no time to go deeply in WP 3.0 development – so simply don’t know for sure). In this case the most simple solution is to hardcode your upload path in my filter nfm_bp_avtar_upload_path_correct($path)
    change the part ABSPATH . get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    into the absolute server path to the upload folder.

    P.S. Impressed with BP implementation in your site – interesting idea and realization :)

    @poolie , @Anthony, @kasper777ny, @nahummadrid – thanks to you all… happy to know that this piece of code works for you :)

    @justbishop

    Member

    @foralien: thanks so much for even taking the time to look! Ill definitely play around with the changes you’ve suggested and see if that fixes the issue. If not, it’s not too big a deal, just another thing on the “when I get to it” to-do list, lol ;)

    And thanks for the compliment on the site! I know I haven’t really done too much exciting stuff with design/layout, but I’ve worked really hard on under-the-hood stuff :)

Viewing 25 replies - 1 through 25 (of 41 total)
  • The topic ‘Custom avatars arent showed on single blogs in WPMU’ is closed to new replies.
Skip to toolbar