-
Author
-
April 3, 2017 at 23:13 #157527
humbledor
ParticipantHi,
I’ve setup the WordPress Social Login with Steam as the provider. I’ve come across an issue that I’m not sure how to fix. When the user registers it gets the steam profile avatar which displays correctly on the profile page and if you use the default Buddyapp my account link in top right navigation.
However if you choose to manually add the BuddyApp ‘My Account’ link to the navigation it displays the users gravatar (even though gravatar is turned off in wordpress settings) instead of the steam profile avatar that shows everywhere else. How can this be fixed?
Many thanks,
Tom
April 5, 2017 at 08:49 #157647Laura
ModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! ?Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 6, 2017 at 17:47 #157796Radu
ModeratorHi,
Can you please provide an URL and an account connected with steam to see how this it happens please ?
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 6, 2017 at 20:46 #157847humbledor
ParticipantIt seems to be effecting BuddyApp specifically rather than default buddypress. Noticably:
- BuddyApp Ajax Search results for members
- BuddyApp widgets that display avatars
- BuddyApp ‘My Account’ avatar if manually added to nav menu
Buddypress areas show steam avatar image:
<img src="https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/48/48e8c9b972b05bce77c08c336e8db03af67898c0_full.jpg" alt="Profile picture of [cc] Warren" class="avatar avatar-wordpress-social-login" height="184" width="184">BuddyApp specific areas its using gravatar:
<img src="//www.gravatar.com/avatar/c4ef35386437208ab87e76be3e8ee215?s=25&r=g&d=mm" class="kleo-rounded" alt="">Website: https://continuumfall.net
April 6, 2017 at 21:22 #157848humbledor
ParticipantI dunno if this helps but this is the php file for wordpress social login that is used to display avatars:
COPY CODE<?php /*! * WordPress Social Login * * http://miled.github.io/wordpress-social-login/ | https://github.com/miled/wordpress-social-login * (c) 2011-2015 Mohamed Mrassi and contributors | http://wordpress.org/plugins/wordpress-social-login/ */ /** * Displaying the user avatar when available on the comment section and top bar * * These functions are borrowed from http://wordpress.org/extend/plugins/oa-social-login/ */ // Exit if accessed directly if( !defined( 'ABSPATH' ) ) exit; // -------------------------------------------------------------------- /** * Display users avatars from social networks when available * * Note: * You may redefine this function */ if( ! function_exists( 'wsl_get_wp_user_custom_avatar' ) ) { function wsl_get_wp_user_custom_avatar($html, $mixed, $size, $default, $alt) { //Check if avatars are enabled if( ! get_option( 'wsl_settings_users_avatars' ) ) { return $html; } //Only Overwrite gravatars if( ! stristr( strtolower( $html ), 'gravatar.com' ) ) { return $html; } //Current comment global $comment; //Chosen user $user_id = null; //Check if we have an user identifier if(is_numeric($mixed)) { if($mixed > 0) { $user_id = $mixed; } } //Check if we are in a comment elseif(is_object($comment) AND property_exists($comment, 'user_id') AND !empty($comment->user_id)) { $user_id = $comment->user_id; } //Check if we have an email elseif(is_string($mixed) &&($user = get_user_by('email', $mixed))) { $user_id = $user->ID; } //Check if we have an user object else if(is_object($mixed)) { if(property_exists($mixed, 'user_id') AND is_numeric($mixed->user_id)) { $user_id = $mixed->user_id; } } //User found? if( $user_id ) { $wsl_avatar = wsl_get_user_custom_avatar( $user_id ); if( $wsl_avatar ) { $wsl_html = '<img alt="'. $alt .'" src="' . $wsl_avatar . '" class="avatar avatar-wordpress-social-login avatar-' . $size . ' photo" height="' . $size . '" width="' . $size . '" />'; // HOOKABLE: return apply_filters( 'wsl_hook_alter_wp_user_custom_avatar', $wsl_html, $user_id, $wsl_avatar, $html, $mixed, $size, $default, $alt ); } } return $html; } } add_filter( 'get_avatar', 'wsl_get_wp_user_custom_avatar', 10, 5 ); // -------------------------------------------------------------------- /** * Display users avatars from social networks on buddypress * * Note: * You may redefine this function */ if( ! function_exists( 'wsl_get_bp_user_custom_avatar' ) ) { function wsl_get_bp_user_custom_avatar($html, $args) { //Buddypress component should be enabled if( ! wsl_is_component_enabled( 'buddypress' ) ) { return $html; } //Check if avatars display is enabled if( ! get_option( 'wsl_settings_users_avatars' ) ) { return $html; } //Check arguments if( is_array( $args ) ) { //User Object if( ! empty( $args['object'] ) AND strtolower( $args['object'] ) == 'user' ) { //User Identifier if( ! empty( $args['item_id'] ) AND is_numeric( $args['item_id'] ) ) { $user_id = $args['item_id']; //Only Overwrite gravatars # https://wordpress.org/support/topic/buddypress-avatar-overwriting-problem?replies=1 if( bp_get_user_has_avatar( $user_id ) ) { return $html; } $wsl_avatar = wsl_get_user_custom_avatar( $user_id ); //Retrieve Avatar if( $wsl_avatar ) { $img_class = ('class="' .(!empty($args ['class']) ?($args ['class'] . ' ') : '') . 'avatar-wordpress-social-login" '); $img_width = (!empty($args ['width']) ? 'width="' . $args ['width'] . '" ' : 'width="' . bp_core_avatar_full_width() . '" ' ); $img_height = (!empty($args ['height']) ? 'height="' . $args ['height'] . '" ' : 'height="' . bp_core_avatar_full_height() . '" ' ); $img_alt = (!empty( $args['alt'] ) ? 'alt="' . esc_attr( $args['alt'] ) . '" ' : '' ); //Replace $wsl_html = preg_replace('#<img[^>]+>#i', '<img src="' . $wsl_avatar . '" ' . $img_alt . $img_class . $img_height . $img_width . '/>', $html ); // HOOKABLE: return apply_filters( 'wsl_hook_alter_get_bp_user_custom_avatar', $wsl_html, $user_id, $wsl_avatar, $html, $args ); } } } } return $html; } } add_filter( 'bp_core_fetch_avatar', 'wsl_get_bp_user_custom_avatar', 10, 2 ); // --------------------------------------------------------------------April 10, 2017 at 18:38 #158113Radu
ModeratorI see, can you please provide FTP login and admin login credentials to test the fix live on this ?
Credentials will be provided in a private reply
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 10, 2017 at 19:03 #158121humbledor
ParticipantHi hope this helps:
FTP username: seventhqueen@continuumfall.net
FTP server: http://ftp.continuumfall.net
FTP port: 21
FTP Password: mICnkDx0wlWg7fqWKmApril 10, 2017 at 19:54 #158128humbledor
ParticipantOh and admin account:
login: https://continuumfall.net/wp-login.php
username: seventhqueen
password: mICnkDx0wlWg7fqWKmApril 13, 2017 at 20:26 #158457Radu
ModeratorHi,
It’s fixed check it, this will be fixed on next theme update
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 13, 2017 at 21:30 #158472humbledor
ParticipantHi thanks Radu,
I can see that the my account avatar is working but I noticed the kleo ajax search is still using gravatar when I look at the source html?
Thanks
April 19, 2017 at 16:45 #158934Radu
ModeratorFixed, check it
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 20, 2017 at 15:03 #159078humbledor
Participanteh? you commented out the avatar part in the theme-functions.php? no avatar showing at all now lol
April 20, 2017 at 17:27 #159101humbledor
Participant$image = kleo_get_avatar($image_args);
This seems to just get the avatar of the logged in user not the corresponding user that displays in the search result e.g. all user results have the logged in users avatar.
April 20, 2017 at 17:35 #159104humbledor
ParticipantAh you forgot to add back item_id to the image_args:
COPY CODE$image_args = array ( 'item_id' => $member-> ID, 'width' => 40, 'height' => 40 ); $image = kleo_get_avatar($image_args);April 24, 2017 at 17:08 #159439Radu
ModeratorHi,
Oh.. yes.. you right, I’ve forgotten to specify the member id argument ..sorry for that, I will fix in theme right now, on your install it’s ok right now I guess.
Let me know
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.