Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of hnla

Custom avatars arent showed on single blogs in WPMU (42 posts)

Started 1 year, 8 months ago by: gigol

  • Profile picture of gigol gigol said 1 year, 8 months ago:

    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 :)

  • Profile picture of Zeb Zeb said 1 year, 8 months ago:

    I’ve got the same problem…

  • Profile picture of Michael Berra Michael Berra said 1 year, 8 months ago:

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

  • Profile picture of Rich Spott Rich Spott said 1 year, 8 months ago:

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

  • Profile picture of Rich Spott Rich Spott said 1 year, 8 months ago:

    bump

  • Profile picture of LPH2005 LPH2005 said 1 year, 8 months ago:

    This same problem exists in WP 3.0 RC1 and BP 1.2.4.1

  • Profile picture of Anthony Anthony said 1 year, 8 months ago:

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

  • Profile picture of justbishop justbishop said 1 year, 8 months ago:

    what @LPH2005 said.

  • Profile picture of Nahum Nahum said 1 year, 8 months ago:

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

  • Profile picture of smuda smuda said 1 year, 8 months ago:

    same here :/

  • Profile picture of Michael Berra Michael Berra said 1 year, 7 months ago:

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

  • Profile picture of foralien foralien said 1 year, 7 months ago:

    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 :)

  • Profile picture of Michael Berra Michael Berra said 1 year, 7 months ago:

    thanks alot!!! :-)

  • Profile picture of justbishop justbishop said 1 year, 7 months ago:

    @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?

  • Profile picture of foralien foralien said 1 year, 7 months ago:

    @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