Custom avatars arent showed on single blogs in WPMU
-
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
-
I’ve got the same problem…
Same with me after upgrade to 1.2.4.1
WPMU 2.9.2.
Please help ( @andy)?I, also, have this same problem (after upgrade to BP 1.2.4.1) running wpmu 2.9.2
bump
This same problem exists in WP 3.0 RC1 and BP 1.2.4.1
Phew, I thought it was me… I am also having this issue. Running WP3.0 and BP 1.2.4.1
what @LPH2005 said.
I was just about to create this topic. Also lost sitewide avatars after the switch to Multi 3.0+1.2.4.1.
same here
HELLO??? This is pretty bad! Does someone have a fix for this (even a temporary…)? @apeatling
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
thanks alot!!!
@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?
@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 mechanismthanks for the reply, @foralien! A lot of what you said has gone right over my head, though
@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 checkhttp://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!
i dont find the bp-custom.php file
@him666, you have to create one. It goes in the plugins folder
@foralien thanks, works like a charm….
Worked for me too, thank you very much.
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
great work @foralien!
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 filtersin 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 partABSPATH . 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
@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
- The topic ‘Custom avatars arent showed on single blogs in WPMU’ is closed to new replies.