BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Extended User Groups – Filter by Group Type #36941

    Hello Deanna,

    I have added multiple group types support. Please upgrade your plugin and give it a shot.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Can you help me with this code. #36915

    Hello Tosin,

    Replace this function “bp_follow_notify_author_followers” with following code:

    
    
    function bp_follow_notify_author_followers( $new_status, $old_status, $post ) {
    
    	if ( $new_status === $old_status || 'publish' !== $new_status ) {
    		return;
    	}
    
    	$post = get_post( $post );
    
    	$options             = get_option( 'bp_follow_notify_settings' );
    	$selected_post_types = empty( $options['bp_follow_notify_post_types'] ) ? array() : $options['bp_follow_notify_post_types'];
    
    	if ( ! in_array( $post->post_type, $selected_post_types ) ) {
    		return;
    	}
    
    	$author_id   = $post->post_author;
    	$author_name = get_the_author_meta( 'display_name', $author_id );
    	$counts      = bp_follow_total_follow_counts( array( 'user_id' => $author_id ) );
    
    	if ( empty( $counts['followers'] ) ) {
    		return;
    	}
    
    	$followers = bp_follow_get_followers( array( 'user_id' => $author_id ) );
    
    	$blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    
    	$subject = '[' . $blog_name . '] New Post From ' . $author_name;
    
    	$message = sprintf( __( '
    				%2$s
    				
    				%3$s
    				
    				Link: %4$s
    				-----------
    				You are receiving this email because you are following %1$s.', 'bp-follow-notify' ),
    		$author_name,
    		$post->post_title,
    		wp_trim_words( $post->post_content ),
    		get_permalink( $post->ID )
    	);
    
    	$notifying_emails = array();
    	foreach ( $followers as $follower ) {
    
    		/* Email Notification */
    
    		$user               = get_user_by( 'id', $follower );
    		$notifying_emails[] = $user->user_email;
    
    		/* BP Notification */
    		if ( bp_is_active( 'notifications' ) ) {
    			bp_notifications_add_notification( array(
    				'user_id'           => $user->ID,
    				'item_id'           => $post->ID,
    				'secondary_item_id' => $author_id,
    				'component_name'    => 'bp_follow_notify',
    				'component_action'  => 'follow_new_post',
    				'date_notified'     => bp_core_current_time(),
    				'is_new'            => 1,
    			) );
    		}
    	}
    
    	$sender_name  = ( ! empty( $options['bp_follow_notify_sender_name'] ) ? $options['bp_follow_notify_sender_name'] : $blog_name );
    	$sender_email = ( ! empty( $options['bp_follow_notify_sender_email'] ) ? $options['bp_follow_notify_sender_email'] : 'no-reply@' . $blog_name );
    
    	$headers = '';
    
    	$headers = "MIME-Version: 1.0" . "\r\n";
    	$headers .= "Content-type: text/html; charset=" . get_bloginfo( 'charset' ) . "" . "\r\n";
    	$headers .= "From: " . $sender_name . " <" . $sender_email . ">" . "\r\n";
    
    	$bcc_emails = join( ',', $notifying_emails );
    
    	$headers .= "Bcc: " . $bcc_emails . "\r\n";
    
    	$admin_email = get_option( 'admin_email' );
    
    	@wp_mail( $admin_email, $subject, $message, $headers );
    }
    
    

    Try this.

    Regards
    Ravi

    • This reply was modified 4 years, 5 months ago by Ravi.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Auto Join groups doesn’t work #36901

    Hello Hugo,

    Can you please point me to the site so that I can help you with the value you can use?. Also, Let me know if “Groups” is a xprofile field or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Can you help me with this code. #36884

    Hello Tosin,

    Can please share the screenshot and point me to the email you want to hide?.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Auto Join groups doesn’t work #36883

    Hello Hugo,

    Thank you for posting. Try using the value which is saving in database table and Give it a shot.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Deanna,

    Thank you for using the plugin. I will add the functionality to select multiple group types at weekend.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: new capability to manage self made users only #36852

    Hello Waseem,

    Thank you for asking. Have you checked the plugin named “User Role Editor” which allows modifying the capability of existing users or create a custom role with custom capabilities?

    Plugin URL: https://wordpress.org/plugins/user-role-editor/

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BuddyPress User Testimonials #36844

    Hello Daniel,

    We have released the plugin. Please upgrade to the latest version. Regarding other questions, @sbrajesh will assists you.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Waseem,

    Thank you for the acknowledgment. I am glad that the issue is resolved.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Can you help me with this code. #36841

    Hello Tosin,

    Please replace the following line:

    
    $headers .= "From: " . $sender_name . " <" . $sender_email . ">" . "\r\n";
    

    with

    
    $headers .= "From: " . $sender_name . "\r\n";
    $headers .= "Bcc: " . $sender_email . "\r\n";
    
    

    Now, Give it a shot and let me know if it works or not.

    Regards
    Ravi