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: 25348
    Brajesh Singh on in reply to: Visible Gallery Only Private Groups #27569

    Hi Javier,
    You will need some way to restrict visibility of the content.

    Here is some code to create conditional shortcode

    
    
    /**
     * Only show content if user is logged in.
     * [if-logged] .....[/if-logged]
     */
    add_shortcode( 'if-logged', function ( $atts, $content = '' ) {
    
    	if ( ! is_user_logged_in() ) {
    		return '';
    	}
    
    	return do_shortcode( $content );
    } );
    
    

    Once you have this code, you can wrap other shortcodes/contents inside it to make it only visible to logged in user.

    Here is an example

    
    
    [if-logged]
    [mpp-list-gallery id=1355 column=1]
    [/if-logged]
    
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25348

    Hi C,
    Please upgrade to 1.1.4 and let me know if that fixes it.

    It seems to me that the issue is related to how select2 js is being used. I have disabled even registering the select2 from our plugin on non relevant pages. That should fix it.,

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25348
    Brajesh Singh on in reply to: Add profiles fields in members directory #27567

    Hi,
    Sure. I will love to do a tutorial in a week. It seems it might help many people.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25348

    Thank you!

  • Keymaster
    (BuddyDev Team)
    Posts: 25348
    Brajesh Singh on in reply to: Conditional Profile Fields for BuddyPress not working #27564

    Hi Mizzlaura ,
    Welcome to BuddyDev forums.

    Please share some screenshots to help me understand the issue.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25348

    Hi John,
    Thank you for the topic and the video.

    It is not a bug. This is expected result and the popup is not cutting off the screen.

    Your page has content longer than the view, that makes the space available(which is visible on scroll).

    The popup is designed to position itself closely to the “Report” button and if there is no space(say there was no scroll), It will reposition to be inside the visible area.

    In the example video, the space is there due to scroll, so it positions itself close to the report button.

    If you want, you can resolve this by changing the behaviour of the buttons(instead of opening them in centre, you can open them near the handle).

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25348
    Brajesh Singh on in reply to: BP Private MSG for non logged in users #27553

    Hi Han,
    Please consult BuddyBoss’s team for support. It is a paid theme and they should be able to help you better.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25348

    Hi Gavin,
    Thank you.

    Please use the following code.

    
    
    // Check access for user.
    add_action( 'bp_template_redirect', function () {
    
    	if ( ! is_user_logged_in() || is_super_admin() ) {
    		return;
    	}
    
    	// User has somemeber type?
    	if ( bp_get_member_type( bp_loggedin_user_id() ) ) {
    		return;
    	}
    
    	// redirect as user does not ahve any member type.
    	$redirect_to = site_url( '/' ); //change with where you want to redirect. Make sure it is outside buddypress.
    
    	if ( is_buddypress() ) {
    		// if we are in BuddyPress section, redirect.
    		bp_core_redirect( $redirect_to );
    	}
    } );
    
    

    It redirects user to site home page if they try to access any BuddyPress content.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25348
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25348

    Hi,
    Thank you for the suggestion. I will consider it in future.

    You can use code to add it for now. It will need 2 parts. 1 Adding tab and 2 handling ajax request for generating the output.

    Regards
    Brajesh