This topic has 45 replies, 4 voices, and was last updated 9 years by Laura.

  • Author
  • #48018
     BDecker19
    Participant

    Hi, having issues where our site is currently displaying the user avatar in the menu. The images are getting set in Buddypress as can be seen in our directory, although they’re just not displaying in the menu bar when a user is logged in. See attached. Thoughts how can try diagnosing?

    Attachments:
    You must be logged in to view attached files.
    #48020
     BDecker19
    Participant

    note, it seems btw the issue may be that it’s looking for a gravatar image, rather than the default profile image (or whatever the main directory section area is grabbing?)

    #48069
     Laura
    Moderator

    Hello, please share a website link, admin account so we can check it out 🙂 Also ftp would help
    Thanks for contacting us

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #48118
     BDecker19
    Participant
    This reply has been set as private.
    #48162
     sharmstr
    Moderator

    I had a similar avatar issue with Social Login. See the reason here: https://archived.seventhqueen.com/forums/topic/intergrating-social-login-plugin-with-kleo-login#post-44269

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48175
     BDecker19
    Participant

    Hmm… tried adding in this code, and unfortunately doesn’t seem to be solving the issue for us?

    #48197
     Laura
    Moderator

    Hello, i have uploaded an avatar for the user you gave me and it worked fine in members directory, the register with linkedin adds an avatar to each profile? Did the member with the bug register with linkedin? It works in the users goes to profile and changes the avatar

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #48201
     BDecker19
    Participant

    hmm… may have lost you a little here? basically you’re saying then it may be the social login plugin that’s not correctly updating the avatar file?

    #48202
     BDecker19
    Participant

    if so, could you let me know what’s involved in setting an avatar correctly (for instance, what happens when a user uploads an avatar manually the way you did)?

    #48203
     BDecker19
    Participant

    in the system that is…

    #48206
     sharmstr
    Moderator

    Again, it sounds exactly like the problem I had with the Social Login plugin. The avatar in the menu did not display if a user used any social site to login (facebook, google +, linkedin). It was only when I user uploaded an image via their profile AND logged in via WP.

    The reason this happens is because the Social Login is doing its own filtering of the get_avatar function. You need to see if the plugin you’re using is doing the same thing.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48207
     BDecker19
    Participant

    When you say “doing its own filtering of the get_avatar function” — what’s this mean exactly?

    #48225
     Laura
    Moderator

    Hello, it means that it doesnt look for buddypress, but for wordpress avatar, it needs to be changed, you could ask in their support forum? 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #48226
     BDecker19
    Participant

    when you say “it” — kinda confused. I’d think it’s the theme that’s looking for either the buddypress or wordpress avatar, rather than the plugin, no?

    #48227
     sharmstr
    Moderator

    When something is filtered (changed), it doesnt matter who/what calls it. (http://codex.wordpress.org/Plugin_API/Filter_Reference) The results have already been changed by the time Kleo calls it. Furthermore, as shown in the code, kleo is calling bp_get_loggedin_user_avatar. That’s not a kleo function, that’s a Buddypress function.

    Have you discussed this with the plugin devs? We’ve illustrated that it only happens when people use their plugin to log in, correct?

    I’ll walk you through the issue with Social Login. Hopefully this will help you understand and assist you finding the issue with whatever plugin you’re using.

    As I’ve said, SL filters ‘get_avatar’. get_avatar is called by bp_get_loggedin_user_avatar.

    COPY CODE
    
    add_filter ('get_avatar', 'oa_social_login_custom_avatar', 10, 5);
    

    The filter calls ‘oa_social_login_custom_avatar’.

    COPY CODE
    
    /**
     * Hook to display custom avatars
     */
    function oa_social_login_custom_avatar ($avatar, $mixed, $size, $default, $alt = '')
    {
    	//The social login settings
    	static $oa_social_login_avatars = null;
    	if (is_null ($oa_social_login_avatars))
    	{
    		$oa_social_login_settings = get_option ('oa_social_login_settings');
    		$oa_social_login_avatars = (isset ($oa_social_login_settings ['plugin_show_avatars_in_comments']) ? $oa_social_login_settings ['plugin_show_avatars_in_comments'] : 0);
    	}
    
    	//Check if social avatars are enabled
    	if (!empty ($oa_social_login_avatars))
    	{
    		//Check if we have an user identifier
    		if (is_numeric ($mixed) AND $mixed > 0)
    		{
    			$user_id = $mixed;
    		}
    		//Check if we have an user email
    		elseif (is_string ($mixed) AND ($user = get_user_by ('email', $mixed)))
    		{
    			$user_id = $user->ID;
    		}
    		//Check if we have an user object
    		elseif (is_object ($mixed) AND property_exists ($mixed, 'user_id') AND is_numeric ($mixed->user_id))
    		{
    			$user_id = $mixed->user_id;
    		}
    		//None found
    		else
    		{
    			$user_id = null;
    		}
    
    		//User found?
    		if (!empty ($user_id))
    		{
    			//Override current avatar ?
    			$override_avatar = true;
    
    			//BuddyPress (Thumbnails in the default WordPress toolbar)
    			if (function_exists ('bp_core_fetch_avatar') AND function_exists ('bp_core_avatar_default'))
    			{
    				//Fetch the BuddyPress user avatar
    				$bp_user_avatar = bp_core_fetch_avatar (array ('item_id' => $user_id, 'no_grav' => true, 'html' => false));
    
    				//Do not override if it's not the default avatar
    				if (!empty ($bp_user_avatar) AND $bp_user_avatar <> bp_core_avatar_default ())
    				{
    					//User has probably upladed an avatar
    					$override_avatar = false;
    				}
    			}
    
    			//Show avatar?
    			if ($override_avatar)
    			{
    				//Read the avatar
    				$user_meta_thumbnail = get_user_meta ($user_id, 'oa_social_login_user_thumbnail', true);
    				$user_meta_picture = get_user_meta ($user_id, 'oa_social_login_user_picture', true);
    
    				//Use the picture if possible
    				if ($oa_social_login_avatars == 2)
    				{
    					$user_picture = (!empty ($user_meta_picture) ? $user_meta_picture : $user_meta_thumbnail);
    				}
    				//Use the thumbnail if possible
    				else
    				{
    					$user_picture = (!empty ($user_meta_thumbnail) ? $user_meta_thumbnail : $user_meta_picture);
    				}
    
    				//Avatar found?
    				if ($user_picture !== false AND strlen (trim ($user_picture)) > 0)
    				{
    					return '' . oa_social_login_esc_attr ($alt) . '';
    				}
    			}
    		}
    	}
    
    	//Default
    	return $avatar;
    }
    

    As you can see in the function, it changes the get_avatar call to return the following, no matter what arguments you supply.

    COPY CODE
    
    '' . oa_social_login_esc_attr ($alt) . '';
    

    The problem with this is that Kleo wants all the html stripped out so that it only receives the path to the file, not the img src tags. Since kleo doesnt get a path and gets the actual image html, it cant find the avatar and shows a default one instead.

    Again, talk to the devs and see if they filter get_avatar. Maybe something else is going on, but you should investigate this as an option.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48229
     BDecker19
    Participant

    Ok, definitely will. To be honest, still a bit confused though. Where is bp_get_loggedin_user_avatar calling to? As in, the image address it seems isn’t stored in the database anywhere, right?

    #48446
     BDecker19
    Participant

    See below reply from social login provider. Is this helpful in diagnosing what the issue is?

    Hi Benji,
    I found a bug when displaying the full sized avatar and have fixed that. However that does not help you with your kleo theme not displaying the proper thumbnail. Since that is something that is out of our scope I cannot code that modification. I can however point you to the code we have developed and hopefully you can modify your theme to use the same code. In the file LoginRadius.php there is the code:
    if ( isset( $loginRadiusSettings[‘LoginRadius_socialavatar’] ) && in_array( $loginRadiusSettings[‘LoginRadius_socialavatar’], array( ‘socialavatar’, ‘largeavatar’, ‘allgravateravatar’, ’emptysocialavatar’ ) ) ) {
    add_filter( ‘bp_core_fetch_avatar’, ‘login_radius_bp_avatar’, 10, 2 );
    }
    The login_radius_bp_avatar() is the function used for Buddypress avatar rendering. This is probably the same function you need for your theme icon. Please let us know if this is helpful in your modification.
    LoginRadius Team

    #48449
     sharmstr
    Moderator

    Oh look, they are filtering the avatar. *sigh*

    I need to see login_radius_bp_avatar

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48453
     sharmstr
    Moderator

    Put this in your childs functions.php file and see what happens. This is just a guess since I dont have their code.

    edit: attached code instead

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #48457
     BDecker19
    Participant

    see attached. does this help??

    #48458
     sharmstr
    Moderator

    You cant attach php files.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48459
     BDecker19
    Participant

    ah, how bout this?

    Attachments:
    You must be logged in to view attached files.
    #48462
     sharmstr
    Moderator

    Did you try the code I gave you?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48463
     BDecker19
    Participant

    yes. didn’t solve the problem…

    #48464
     BDecker19
    Participant
    This reply has been set as private.
    #48465
     sharmstr
    Moderator

    I also need a linkedin account to use to login with.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48467
     BDecker19
    Participant
    This reply has been set as private.
    #48468
     sharmstr
    Moderator

    Is this site live or still in beta?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48469
     BDecker19
    Participant

    eh, somewhere in between. but no actual users yet, and just made a backup

    #48470
     sharmstr
    Moderator

    what’s the ftp server name?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48471
     BDecker19
    Participant
    This reply has been set as private.
    #48472
     sharmstr
    Moderator

    never mind. i got it.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48543
     sharmstr
    Moderator

    Its showing up now but they put their own css on it when they filter it. I’m not fixing that. Good luck.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48555
     BDecker19
    Participant

    Hey, thanks so much for this. Semi-out of curiosity, are you able to let me know what you did to fix it?

    #48560
     sharmstr
    Moderator

    look at the top of your functions.php file.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48570
     BDecker19
    Participant

    Hmm… ok. So it looks like you’re overwriting kleo BP config file, changing the “output” within kleo_menu_user_avatar from:

    COPY CODE
      $output .= '<a title="' . bp_get_loggedin_user_fullname() . '" class="kleo-bp-user-avatar' . 
                ( $args->has_children && in_array($depth, array(0,1)) ? ' js-activated' : '' ) . '" href="' . $url . '" title="' . $attr_title .'">'
                    .  '<img src="' . bp_get_loggedin_user_avatar(array('width' => 25, 'height' => 25, 'html' => false)) . '" class="kleo-rounded" alt="">' . ($item->attr_title != '' ? ' ' . $item->attr_title : '');

    to:

    COPY CODE
    $output .= '<a title="' . bp_get_loggedin_user_fullname() . '" class="kleo-bp-user-avatar kleo-rounded-noborder kleo-avatar-menu' . 
                    ( $args->has_children && in_array($depth, array(0,1)) ? ' js-activated' : '' ) . '" href="' . $url . '" title="' . $attr_title .'">' . bp_get_loggedin_user_avatar(array('width' => 25, 'height' => 25)) . '</a>';

    Where the difference is you’re adding the extra classes (I guess just to ensure proper styling?) and then calling the bp_get_loggedin_user_avatar function, which it wasn’t previously.

    Is this all right?

    Thanks so much for your help here!

    #48571
     hma
    Participant

    Hello,
    I have a basic question,
    I can see in the picture attached that Bdecker has put on lien the admin bar which is in grey with some menu from Kleo like notifications, and picture of user (when working ,;-))
    Forgive me but how can I reach this ?
    I only got a basic and ugly wordpress admin bar…
    Best regards,
    hervé

    #48575
     sharmstr
    Moderator

    @hma – That’s not the admin bar. That’s kleos top bar menu. Theme options > Header Options. Create the menu in Appearance > Menus

    Benji – I’m not overwriting the config. As I explained a few times now, I modified the kleo_menu_user_avatar because ….

    The problem with this is that Kleo wants all the html stripped out so that it only receives the path to the file, not the img src tags. Since kleo doesnt get a path and gets the actual image html, it cant find the avatar and shows a default one instead.

    The path is dependent upon how they logged in. If they log in via WP then it looks in the avatar folder. If they log in via linked in, then the path is on the linkedin servers.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48584
     hma
    Participant

    I Understand. Thanks. Now, will it be possible to use this kleo bar menu while still getting access to the user vertical options menu that spans all the modules at the far right of the screeen ?
    Hervé

    #48586
     BDecker19
    Participant

    Hey Herve. Wanna send a link to your site? Happy to show you how I set things up if can be at all helpful!

Viewing 40 posts - 1 through 40 (of 46 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?