Support Forum

Avatar on forum not showing

JA Jaysun
Jaysun
Member

I’ve checked all the options and integration and everything seems fine, when using a WordPress page the avatar is working – but once I load Simplepress the avatars are not shown on forum posts or in the top right of the screen in the WordPress userbar.

7 Answers

New Answer

MP Mr Papa
Mr Papa
Member

simple press avatars are different than wp avatars…  unless you have configured your settings to accomplish this… what are you avatar settings?

also, what avatar does it say in your sp profile will be displayed?  and can you try a the direct url to it?  your server permissions might be blocking web user access to the sp avatar folder…

JA Jaysun
Jaysun
Member

Sorry been a little busy and forgot about this problem embarassed

 

I’ve tried all sorts of variations of options to try and resolve this and a plugin to disable gravatar calling – as the forum seems to call for the Gravatar to be displayed even if Gravatar is placed below Sp-Default in priority.

 

What I’m trying to achieve is for the avatar the user has used in WordPress either by uploading or from Facebook registration to be used on the forum also. 

 

However when I switch to forum i’m just getting the default avatar instead.

 

avatar1.jpgavatar2.jpg

MP Mr Papa
Mr Papa
Member

the way you have the priorities set there, the only avatar that will be used is the wp avatar… no other sp avatar choice will exist…  so what do you have set for the wp avatar?  that would be on wp – settings – discussion…

now you mention their wp avatar by uploading or facebook…  wp out of the box does not support either of those… so are you using a custom plugin for the wp avatar?  and if so, does it use the wp api for the avatar?  otherwise, plugins like simple press wont even know the avatar exists…

JA Jaysun
Jaysun
Member

ok that’s probably what’s happening here then, I’m also using Buddypress and with that users can upload their own Avatar (which is also not shown in SimplePress).

 

Facebook integration is provided by the Ultimate Facebook plugin (allows registration using your Facebook account, logging in and other features)

 

I’ve disabling Gravatars in discussion settings and also the different options there, but my Simplepress install grabs the Gravatar regardless.

 

Seen some hacks to disable the Gravatar option from WordPress which will possibly work… just wanted to make sure it’s not something that can be resolved through the options in Simplepress…

Thank you for you advice smile

MP Mr Papa
Mr Papa
Member

a bit odd as I thought buddypress avatars used to work… but long time since we checked…

if you have the highest priority set to wp avatars like you do, all we do is simply call the wp function get_avatar() and have it tell us what the avatar is…

so if buddypress is not using that api, would wonder why and what its doing… even if it plugs that function (replaces it), it should keep the same interface (ie arguments) and behave properly…  do you know how buddpress is displaying its avatars in place of wp ones?  I assume you mean on posts, comments and in the admin when you say the avatars are displayed properly… or do you mean only on buddypress specific pages?

as to facebook, we have facebook logins (as well as twitter, google, and other 3rd party) built into simple press (rpx on components – login and registration)…  but facebook doesnt really have an avatar unless its displaying their profile pic?? and it seems like it would have to hook into the wp api for that too…

JA Jaysun
Jaysun
Member

Have fixed the problem smile

Firstly I added this code to my theme (wordpress theme) function.php file 

function bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) {

$default = ‘/avatarsdefault.png’;

if( $image && strpos( $image, “gravatar.com” ) ){

return ‘<img src=”‘ . $default . ‘” alt=”avatar” class=”avatar” ‘ . $html_width . $html_height . ‘ />’;

} else {

return $image;

}

}

add_filter(‘bp_core_fetch_avatar’, ‘bp_remove_gravatar’, 1, 9 );

function remove_gravatar ($avatar, $id_or_email, $size, $default) {

$default = ‘/avatars/default.png’;

return ‘<img src=”‘ . $default . ‘” alt=”avatar” class=”avatar” width=”60″ height=”60″ />’;

}

add_filter(‘get_avatar’, ‘remove_gravatar’, 1, 5);

function bp_remove_signup_gravatar ($image) {

$default = ‘/avatars/default.png’;

if( $image && strpos( $image, “gravatar.com” ) ){

return ‘<img src=”‘ . $default . ‘” alt=”avatar” class=”avatar” width=”60″ height=”60″ />’;

} else {

return $image;

}

}

add_filter(‘bp_get_signup_avatar’, ‘bp_remove_signup_gravatar’, 1, 1 );

 
And then installed the ‘User Avatar’ plugin from the wordpress directory.
This now gives me the same avatar on my wordpress pages and my Simplepress forum smile
 
Maybe this might be of some use to someone one day? which is why I posted the code – hope you don’t mind
MP Mr Papa
Mr Papa
Member

nope, not at all.  in fact, appreciate it!!  love folks helping out folks… thanks for the code!  and good work tracking it down…