Facebook Avatars in Subdomain Blogs
-
I use bp 1.0.3, wpmu 2.8.1 and bbpress 1.0.1.
I also use the facebook connect plugin and would like to be able to show facebook avatars in subdomain user blogs. I have this accomplished with forums pages, thanks to Reboot Now in this post:
http://buddypress.org/forums/topic/bp-avatars-and-nothing-else-in-bbpress-possible
I use prologue theme as default for subdomain user blogs. The avatar issue is important as you can see here, this user signed up through fb connect, but has wavatar and not his fb avatar. http://dimassimotalento.fenerbook.com
There is no problem when user is registered the normal way, their avatars are ok in subdomain user blogs.
This problem was solved in forums like this:
function _get_avatar( $id ) {
$avatar_file = bb_get_usermeta( get_post_author_id(), ‘bp_core_avatar_v1’ );
$url = BB_PATH . $avatar_file;
if ( strlen( $avatar_file ) ) {
return ‘<img src=”‘ . attribute_escape( $url ) . ‘” alt=”” class=”avatar photo” width=”50″ height=”50″ />’;
} else {
$default_grav = ‘wavatar’;
$user_email = bb_get_user_email( $id );
$gravatar = ‘http://www.gravatar.com/avatar/’ . md5( $user_email ) . ‘?d=’ . $default_grav . ‘&s=50’;
return ‘<img src=”‘ . attribute_escape( $gravatar ) . ‘” alt=”” class=”avatar photo” width=”50″ height=”50″ />’;
}
return;
}
and by using this:
<?php echo _get_avatar( get_post_author_id() ); ?>
Can anyone help me to show avatars of fb users in subdomain blogs?
- The topic ‘Facebook Avatars in Subdomain Blogs’ is closed to new replies.