BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 886

    I think I found a solution I got it to work for both members directory page and single members page with this code.

     /**
     * Hide Members Directory and single members page from non members(not logged in users)
     */
    function buddydev_hide_members_directory_for_non_members() {
        if ( bp_is_members_directory() || bp_is_user() ) {
            if (!is_user_logged_in() ) {
                 bp_core_redirect( bp_get_signup_page() );
    exit;
            }
        }
    }
     
    add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_for_non_members' ); 
  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: BuddyPress Member Types Pro Question #20890

    Any feedback on this question thanks

  • Participant
    Level: Guru
    Posts: 886

    Thank you very much I just downloaded the plugin now

  • Participant
    Level: Guru
    Posts: 886

    Any feedback sir thanks

  • Participant
    Level: Guru
    Posts: 886

    Hello brajesh,

    Thank you very much your code worked perfectly, you are a life saver I’m really grateful for your help. I will also like to appreciate the good work you’re doing with buddypress. Your deep contribution has truly transformed buddypress from what it was 5 years ago.

    God bless you

  • Participant
    Level: Guru
    Posts: 886

    OK thanks so much i’m really grateful

  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: [Resolved] Force profile photo upload on a specific page #20704

    Hello,

    This code below is preventing the code you sent from working

     /**
     * Buddydev force follow 6 members function.
     */
    function buddydev_check_or_redirect() {
    	// Force profile photo active?
    	$fp_active = class_exists( 'BD_Force_User_Avatar_Helper' );
    
    	// skip if logged and on non bp page.
    	if ( is_user_logged_in() && ! is_buddypress() ) {
    		if ( $fp_active ) {
    			remove_action( 'bp_template_redirect', array(
    				BD_Force_User_Avatar_Helper::get_instance(),
    				'check_or_redirect',
    			), 1 );
    		}
    
    		return;
    	}
    
    	if ( ! function_exists( 'bp_follow_get_the_following_count' ) || ! is_user_logged_in() || is_super_admin() ) {
    		return;
    	}
    
    	$is_dir = bp_is_members_directory();
    
    	// if we are on directory and force profile is not active
    	// return.
    	if ( $is_dir && ! $fp_active ) {
    		return;
    	}
    
    	$follow_count = bp_follow_get_the_following_count( array( 'object_id' => get_current_user_id() ) );
    
    	if ( $follow_count >= 4 ) {
    		return;
    	}
    
    	if ( $is_dir && $fp_active ) {
    		remove_action( 'bp_template_redirect', array(
    			BD_Force_User_Avatar_Helper::get_instance(),
    			'check_or_redirect',
    		), 1 );
    
    		return;
    	}
    
    	bp_core_add_message( __( 'Please follow 4 or more members to continue.' ), 'error' );
    
    	bp_core_redirect( bp_get_members_directory_permalink() );
    }
    
    add_action( 'bp_template_redirect', 'buddydev_check_or_redirect', 0 ); 
  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: Buddypress blog activity notification #20640

    Any feedback sir, thanks

  • Participant
    Level: Guru
    Posts: 886

    Hello Brajesh,

    Any feedback on this issue

    Thank you

  • Participant
    Level: Guru
    Posts: 886

    Hello Brajesh,

    I am not reffering to a specific plugin, I don’t have any classified plugin installed, but im reffering to any custom post type that will be created, the earlier classified was just used as an example of a custom post type, it could be any custom post type. e.g reviews, books, cars etc

    Thanks