BuddyDev

Search

Profile Visibility Manager: Visual tag for Usernames

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #1743

    Hi Brajesh,
    While having our certification course some users were confused about the fact that some links on names in /members are “dead” and others not. The link on my name leads to my BP profile, others not because of their profile visibility setting. The default setting for new users on my site is “Logged in Users Only” what seems to be a good choice.

    Would it be possible to extend the names in /members with some kind of visual tag like a red or green dot to communicate if the profile is accessible (public) or not? This “tag” should only appear if a site visitor isn’t logged in.

    Hans

  • Keymaster
    (BuddyDev Team)
    Posts: 24599
    Brajesh Singh on #1754

    Hi Hans,
    Thank you for asking. It is easily doable by filtering on “bp_get_member_class” and adding a new class but your theme does not support it.

  • Participant
    Level: Enlightened
    Posts: 134
    HansRuedi Keller on #1770

    Hi Brajesh,
    Got it. Hopefully a better idea…

    Would it be possible to suppress the link on poster-name in members-list if profile visibility is set to “Logged in Users Only”?

  • Participant
    Level: Initiated
    Posts: 3
    Michael Nielsen on #2864

    Hi Brajesh,

    This actually sounds like a great feature. Could it be done conditionally?

    example pseudo code:

    if theme_supports_bp_get_member_class {
    do_filter “bp_get_member_class”;
    add tag to profile.
    }
    else {
    do_suppress link on poster-name;
    }

    Best regards,
    Michael

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #2869

    Hi Michael,

    Thank you for posting. Please use the following code in bp-custom.php file

    
    function bp_visibility_add_member_visibility_css_class( $classes ) {
    
    	if ( ! function_exists( 'bp_profile_visibility_get_settings' ) ) {
    		return $classes;
    	}
    
    	$visibility = bp_profile_visibility_get_settings( bp_get_member_user_id(), 'bp_profile_visibility' );
    	$classes[]  = 'visibility-' . $visibility;
    	return $classes;
    
    }
    add_filter('bp_get_member_class','bp_visibility_add_member_visibility_css_class');
    
    

    It will add a new class based on their profile accessibility and you can then just style the list as you may please.

    Thank You
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved