Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    You are welcome 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi Mikel,
    Yes.

    That will make it only visible to the owner of the profile.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi Mikel,
    You need to dset the visibility to “Profile Owner”

    When you use wc4Bp, they already decide the visibility for you. With Custom profile tabs, we do not decide the visibility as there are chances some of the dynamic tabs might be visible to logged out visitor etc.

    That’s why, you need to use the Visibility control and set it to profile owner to make it only visible to the profile owner. Your selection of roles for availability is correct and you do not need to change that.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi Chris,
    Thank you for the patience.

    Here is the code to add all users from same domain as friend. It adds them as friend when a user account is activated.

    
    
    /**
     * Add users from same domain as friend on account activation.
     *
     * @param int $user_id user id.
     */
    function buddydev_add_friends_on_activation_by_email_domain( $user_id ) {
    
    	$user = get_user_by( 'id', $user_id );
    	if ( ! $user ) {
    		return;
    	}
    
    	$email_parts = explode( '@', $user->user_email );
    
    	if ( count( $email_parts ) !== 2 ) {
    		return;
    	}
    
    	$domain = $email_parts[1];
    
    	$potential_friend_ids = buddydev_get_users_with_email_domain( $domain );
    
    	if ( empty( $potential_friend_ids ) ) {
    		return;
    	}
    
    	foreach ( $potential_friend_ids as $potential_friend_id ) {
    
    		if ( $potential_friend_id == $user_id || friends_check_friendship( $user_id, $potential_friend_id ) ) {
    			continue;
    		}
    
    		friends_add_friend( $potential_friend_id, $user_id, true );
    	}
    
    }
    
    add_action( 'bp_core_activated_user', 'buddydev_add_friends_on_activation_by_email_domain' );
    
    /**
     * Get all users who have given email domain.
     *
     * @param string $domain domain name.
     *
     * @return array
     */
    function buddydev_get_users_with_email_domain( $domain ) {
    	global $wpdb;
    
    	$pattern       = '%@' . trim( $domain );
    	$sql_statement = $wpdb->prepare( "SELECT ID FROM {$wpdb->users} WHERE user_email LIKE %s", esc_sql( $pattern ) );
    
    	return $wpdb->get_col( $sql_statement );
    }
    
    

    I am not sharing the code for the member type since BuddyPress does not set member type on activation and BuddyBoss does set it but that is not straight forward(or guaranteed and depends on settings).

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485
    Brajesh Singh on in reply to: bp group activities notifier notification bug #31641

    Hi Jay,
    Thank you for using the plugin.

    We do delete when a user visits single activity screen
    https://github.com/sbrajesh/bp-group-activities-notifier/blob/master/bp-group-activities-notifier.php#L63

    If it is not deleting, most probably the user is not visiting individual activity. Please check.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485
    Brajesh Singh on in reply to: Local Transcoder – Change FFMPEG Path ? #31640

    Hi Maurice,
    Thank you for the question.

    Local transcoder does not care about the location of FFMPEG. We do not use the complete path of executable. we assume that when we run ffmpeg from the commandline it work.

    Please make sure shell_exec() works on your server as we use it for determining the existence of the FFMPEG binary.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485
    Brajesh Singh on in reply to: Default New User Member Type #31639

    Hi Carlos,
    Thank you for the reply.

    I assume you are trying to change the role of the user from Subscriber to something else?

    Do you want user’s role to be different than subscriber(based on member type). If yes, have you configured member type to role association settings?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485
    Brajesh Singh on in reply to: How can I echo this code in header #31638

    Please share the code on pastebin and link me or please use backticks to post code block here.

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi,
    Thank you for the question.
    You can use the function xprofile_get_field_data() for fetching the details of a user.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485
    Brajesh Singh on in reply to: [Resolved] Unable to upload Cover Pic #31636

    Hi Daniel,

    Since your cover upload works and profile works upload for groups, there are only 2 possible reasosn for the issue

    1. You don’t have the profile upload for user enabled in BuddyPress settings
    2. or your theme has some bug preventing you from upload.

    If you can confirm that first is not the issue then it has higher probability of being a theme related issue.

    Regards
    Brajesh