BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Donation feature for buddypress #40144

    Hello Tosin,

    Thank you for the kind words. Please use the following code it will return the message if the mandatory field of account details is empty. Please do let me know if it helps or not.

    
    
    add_action( 'bp_member_header_actions', function () {
    
    	$user_id = bp_displayed_user_id();
    
    	$donation_page_link = add_query_arg(
    		array(
    			'user_id' => $user_id,
    			'nonce'   => wp_create_nonce( 'donate-' . $user_id ),
    		),
    		get_page_link( 68 ) // Replace by your donation page link.
    	);
    
    	$r = array(
    		'id'                => 'donation_link',
    		'component'         => 'members',
    		'must_be_logged_in' => true,
    		'link_text'         => _x( 'Donate', 'button', 'buddypress' ),
    		'link_href'         => esc_url( $donation_page_link ),
    	);
    
    	echo bp_get_button( $r );
    } );
    
    add_filter( 'the_content', function ( $content ) {
    
    	// Our donation page link.
    	if ( ! is_page( 68 ) || ! isset( $_GET['user_id'] ) || ! $_GET['nonce'] ) {
    		return $content;
    	}
    
    	$user = get_user_by( 'id', absint( $_GET['user_id'] ) );
    
    	if ( ! $user || ! wp_verify_nonce( $_GET['nonce'], 'donate-' . $user->ID ) ) {
    		return $content;
    	}
    
    	// Replace field id with your one mandatory for donation. If empty return your message.
    	if ( empty( xprofile_get_field_data( 8, $user->ID ) ) ) {
    		return $content . __( 'This member has not updated his/her bank details' );
    	}
    
    	ob_start();
    
    	// Replace group_id to your group id.
    	echo do_shortcode( "[bp-shortcodes-profile user_id={$user->ID} group_id=2]" );
    
    	$shortcode_content = ob_get_clean();
    
    	return $content . $shortcode_content;
    } );
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Categories and Tags on blog posts #40142

    Hello Daniel,

    Thank you for the posting. Categories/tags are dependent on the theme template. I suggest if you are using any paid theme try to contact the theme author and ask him to help you with this issue.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Array text in Header Actions #40141

    Hello Carsten,

    Thank you for sharing the details. I have tested this with Nouveau and it is working fine for me. There might be a chance that any plugin, your active theme, or any custom code is conflicting with the functionality. Please try after deactivating other plugins and switching to the default theme temporarily and check if the issue still persists?

    Regarding the plugin version on the BuddyDev site and wordpress.org, both are the same. We are using the WordPress version on our site.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Donation feature for buddypress #40104

    Hello Tosin,

    Try using this code:

    
    add_action( 'bp_member_header_actions', function () {
    
    	$user_id = bp_displayed_user_id();
    
    	$donation_page_link = add_query_arg(
    		array(
    			'user_id' => $user_id,
    			'nonce'   => wp_create_nonce( 'donate-' . $user_id ),
    		),
    		get_page_link( 68 ) // Replace by your donation page link.
    	);
    
    	$r = array(
    		'id'                => 'donation_link',
    		'component'         => 'members',
    		'must_be_logged_in' => true,
    		'link_text'         => _x( 'Donate', 'button', 'buddypress' ),
    		'link_href'         => esc_url( $donation_page_link ),
    	);
    
    	echo bp_get_button( $r );
    } );
    
    add_filter( 'the_content', function ( $content ) {
    
    	// Our donation page link.
    	if ( ! is_page( 68 ) || ! isset( $_GET['user_id'] ) || ! $_GET['nonce'] ) {
    		return $content;
    	}
    
    	$user = get_user_by( 'id', absint( $_GET['user_id'] ) );
    
    	if ( ! $user || ! wp_verify_nonce( $_GET['nonce'], 'donate-' . $user->ID ) ) {
    		return $content;
    	}
    
    	ob_start();
    
    	// Replace group_id to your group id.
    	echo do_shortcode( "[bp-shortcodes-profile user_id={$user->ID} group_id=2]" );
    
    	$shortcode_content = ob_get_clean();
    
    	return $content . $shortcode_content;
    } );
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Donation feature for buddypress #40089

    Hello Tosin,

    Check the follwing code I have created for user profile using Nouveau Template pack:

    
    
    add_filter( 'bp_nouveau_get_members_buttons', function ( $buttons ) {
    
    	$user_id = bp_displayed_user_id();
    
    	$donation_page_link = add_query_arg(
    		array(
    			'user_id' => $user_id,
    			'nonce'   => wp_create_nonce( 'donate-' . $user_id ),
    		),
    		get_page_link( 68 ) // Replace by your donation page link.
    	);
    
    	$buttons['donation_link'] = array(
    		'id'                => 'donation_link',
    		'component'         => 'members',
    		'must_be_logged_in' => true,
    		'link_text'         => _x( 'Donate', 'button', 'buddypress' ),
    		'link_href'         => esc_url( $donation_page_link ),
    	);
    
    	return $buttons;
    } );
    
    add_filter( 'the_content', function ( $content ) {
    
    	// Our donation page link.
    	if ( ! is_page( 68 ) || ! isset( $_GET['user_id'] ) || ! $_GET['nonce'] ) {
    		return $content;
    	}
    
    	$user = get_user_by( 'id', absint( $_GET['user_id'] ) );
    
    	if ( ! $user || ! wp_verify_nonce( $_GET['nonce'], 'donate-' . $user->ID ) ) {
    		return $content;
    	}
    
    	ob_start();
    
    	echo do_shortcode( "[bp-shortcodes-profile user_id={$user->ID} group_id=2]" );
    
    	$shortcode_content = ob_get_clean();
    
    	return $content . $shortcode_content;
    } );
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Error HTTP when trying to upload a file #40087

    Hello Dave,

    I have tested it on my local server but was unable to produce this error. Please provide me a demo admin credential of your site temporarily so that I can check.

    Are you able to upload other media files using MediaPress?

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Member Types Pro and use of associated avatars #40024

    Hello Carsten,

    It seems You are using BP Block Widgets which was introduced in BuddyPress 9.0.0 and We have not explored much with block API so couldn’t help you with this at the moment.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Member Types Pro and use of associated avatars #40021

    Hello Carsten,

    I have checked and it seems you have not uploaded both versions of avatar i.e. full and thumb for member type. I have uploaded ones and it is working fine for me. Please check.

    Take a look:

    https://tinyurl.com/yfadmqdv

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Plugin Compatibility Issue #40020

    Hello Scott,

    Thank you for the acknowledgment. Regarding guest activity comments BuddyPress does not provide any way to post comments without login.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Donation feature for buddypress #40019

    Hello Tosin,

    Thank you for sharing the code. Shortcode does provide an attribute name ‘user_id’. Have you tried this?

    
    do_shortcode( '[bp-shortcodes-profile user_id=' . hibuddy_get_context_user_id() . ' group_id=4]' );
    
    

    Please give it shot and let me know if it helps or not.

    Regards
    Ravi