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: 25337
    Brajesh Singh on in reply to: Admin notifications #24393

    Hi,
    Your problem is the use of

    
    bp_displayed_user_id()
    

    It is only valid when you are on a user’s profile. Please give the following code a try

    
    function bpcustom_disable_group_notifications_for_student_posts( $stop_notification ) {
    
    	if ( bp_has_member_type( get_current_user_id(), 'student' ) ) {
    		$stop_notification = true;
    	}
    
    	return $stop_notification;
    }
    
    add_filter( 'bp_local_group_notifier_skip_notification', 'bpcustom_disable_group_notifications_for_student_posts' );
    
    

    It is modified version of your code and should work.

    Please let me know if it does or not?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    Thank you Milan.

    Please do share if you resolve it earlier.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    You are welcome!

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    Hi Milan,
    Thank you for using MediaPress.

    This is a bit difficult to implement than it seems. It is difficult for us to understand the intent of user.

    The problem is the post form is handled by BuddyPress and as soon as a user clicks outside of the post form(It looses focus and has no content), It gets minimized and the other buttons etc hidden.

    Here is how the user interacts with upload.

    1. Clicks in the post form. The form becomes active and the buttons are shown
    2. The form is still active, the user uses mouse to click on the button and the “Drag Drop” box shows.
    The form has lost the focus and any next interaction will hide the form.
    3. User clicks on “Select Files” and the post form gets hidden(hadled by template pack, not us)

    That is the normal interaction flow.

    If we bind to the focus out of the form, the user won’t be able to select the files.

    I did experiment hiding in past. Here is a tiny js that you can use to hide the box on focus out

    
        jq( '#whats-new-form' ).on( 'focusout', function( e ) {
            jq( '#mpp-upload-dropzone-activity').hide();
        } );
    
    

    It won’t server the purpose though as it breaks usability(uploads won’t work).

    This is an enhancement on my list of todo things. We can certainly improve it in future. It will need more subtle handling like checking for the target and seeing if the click happened outside of the upload box. In that case, depending on the media list, we can hide it.

    It will be available in near future.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    Hi Milan,
    Welcome to BuddyDev.

    We had disabled it to avoid people wondering why they can not edit media list. Please allow us to release an update in next 2 days to let the users edit text for media updates too.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    Hi Tosin,

    1. Please create a new page and assign that to the Logout page setting. This page will not be accessible to the user.

    2. Now, you can redirect user to any page on logout

    
    
    /**
     * Filter logout url.
     *
     * @return string
     */
    function bl_custom_filter_logout_url( $url ) {
    
    	if ( is_admin() && ! defined( 'DOINGAJAX' ) ) {
    		return $url;
    	}
    
    	$logout_url = bl_get_logout_link();
    
    	if ( empty( $logout_url ) ) {
    		return $url;
    	}
    
    	$redirect = 'http://yoursite.com/page-xyz/';// change with actual.
    	// $redirect = wp_validate_redirect( $redirect );
    
    	if ( $redirect ) {
    		$query['redirect_to'] = $redirect;
    	}
    
    	$logout_url = add_query_arg( $query, $logout_url );
    
    	return $logout_url;
    }
    
    add_filter( 'logout_url', 'bl_custom_filter_logout_url', 100 );
    

    Please change the $redirect with your own url.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    Hi Joss,
    Thank you for letting me know. I am glad it worked 🙂

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    You are welcome 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    Thank you for confirming.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25337

    Thank you Vivek.

    I am glad you resolved it. It seems strange but from the topic you linked, It might have something to do with activity stream query.

    I will certainly check in future. For now, Marking it as resolved as the search indexing option is innocuous.

    Regards
    Brajesh