BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] MediaPress Audio #44573

    Hello Dale,

    We have shared the “MPP Shared Gallery” plugin with you. Please check.

    Regards
    Ravi

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

    Hello Yuriix,

    Please try the following code in the ‘bp-custom.php’ file.

    
    
    /**
     * Filter ajax post request
     */
    function buddydev_restrict_post_update() {
    	// Always allow site admin.
    	if ( is_super_admin() ) {
    		return;
    	}
    
    	$object = empty( $_POST['object'] ) ? '' : sanitize_key( $_POST['object'] );
    
    	// Allowed user ids.
    	$allowed_user_ids = array( 10 );
    
    	if ( 'user' == $object && ! in_array( get_current_user_id(), $allowed_user_ids ) ) {
    		wp_send_json_error( array( 'message' => __( 'You are not allowed to post activity.' ) ) );
    	}
    }
    
    add_action( 'wp_ajax_post_update', 'buddydev_restrict_post_update', 9 );
    
    

    I am assuming you are using the BP Nouveau template pack.

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

    Hello Yuriix,

    Thank you for the acknowledgement. I am glad that you have resolved the issue on your own.

    Regarding your second requirement, Are you looking for a code that will restrict activity posting to only a certain user i.e. No other user can post activity?. If yes, please let me know what sort of activity you want to restrict the activity meaning User activity or group activity.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: BuddyPress Featured Members Suggestion #44523

    Hello Mike,

    Thank you for posting. Please try the following code:

    
    add_filter( 'bp_after_has_members_parse_args', function( $args ) {
    
    	if ( ! function_exists( 'bp_featured_members' ) ) {
    		return $args;
    	}
    
    	if ( bp_featured_members()->in_the_loop() || ( isset( $args['scope'] ) && $args['scope'] == 'featured' ) ) {
    		// Available options: Accepts 'active', 'random', 'newest', 'popular', 'online', 'alphabetical'.
    		$args['type'] = 'random';
    	}
    
    	return $args;
    }, 15 );
    
    

    You can put this code under the “bp-custom.php” file.

    For more info: https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi

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

    Hello Hai,

    Sorry for the inconvenience. I have tested the plugin with the BuddyBoss Platform and it is working fine for me. Is there any restriction you have applied to group creation?. BuddyBoss does offer restrictions for group creation if you have configured it please reset to none and then try again.

    You can locate BuddyBoss Settings under Settings > Groups > Group Access.

    Please check and let me know.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Cannot ACCEPT friendship requests #44490
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BuddyPress Activity plus reloaded #44487

    Hello Giuseppe,

    I have made this button “add remote image” hidden and Regarding the translation issue I have asked @sbrajesh to look into the issue, He will take care of this topic now.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Buddyblog post views counter #44486

    Hello Tosin,

    Thank you for the acknowledgement. I am glad that I could help.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Buddyblog post views counter #44483

    Hello Tosin,

    Please ignore my last reply and use the following code only:

    
    add_filter( 'the_excerpt', function ( $excerpt ) {
    
    	if ( ! function_exists( 'Post_Views_Counter' ) || ! function_exists( 'buddypress' ) || ! bp_is_user() ) {
    		return $excerpt;
    	}
    
    	if ( ! function_exists( 'bblpro_get_current_post_type' ) ) {
    		return $excerpt;
    	}
    
    	$current_post_type = bblpro_get_current_post_type();
    
    	if ( $current_post_type && in_array( $current_post_type, (array) Post_Views_Counter()->options['display']['post_types_display'] ) ) {
    		$excerpt = $excerpt . do_shortcode( '[post-views]' );
    	}
    
    	return $excerpt;
    } );
    
    

    Please let me know if it works or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Buddyblog post views counter #44482

    Hello Tosin,

    Thank you for the acknowledgement. Please try the following code:

    
    
    /* Display post views counter plugin in buddyblog post management */
    add_filter( 'pvc_display_views_count', function ( $display ) {
    	if ( ! function_exists( 'buddyblog_pro' ) ) {
    		return $display;
    	}
    	$pvc = Post_Views_Counter();
    	if ( empty( $pvc->options['display'] ) || empty( $pvc->options['display']['post_types_display'] ) ) {
    		return $display;
    	}
    	$current_post_type = bblpro_get_current_post_type();
    	if ( ! $display && $current_post_type && in_array( $current_post_type, (array) $pvc->options['display']['post_types_display'] ) ) {
    		$display = true;
    	}
    
    	return $display;
    } );
    
    add_filter( 'the_excerpt', function ( $excerpt ) {
    
    	if ( ! function_exists( 'Post_Views_Counter' ) || ! function_exists( 'buddypress' ) || ! bp_is_user() ) {
    		return $excerpt;
    	}
    
    	$alter = false;
    
    	if ( function_exists( 'bblpro_get_current_post_type' ) && bblpro_get_current_post_type() ) {
    		$alter = true;
    	}
    
    	if ( ! $alter ) {
    		return $excerpt;
    	}
    
    	return $excerpt . do_shortcode( '[post-views]' );
    } );
    
    

    Please let me know if it works or not.

    Regards
    Ravi