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: 25482

    Hi Richard,
    Please put the following code in your bp-custom.php

    
    
    /**
     * Redirect to login page on accessing single media for non logged.
     */
    function mpp_custom_single_media_access_restriction() {
    
    	if ( ! function_exists( 'mpp_is_single_media' ) || ! mpp_is_single_media() || is_user_logged_in() ) {
    		return;
    	}
    	// Redirect to login page.
    	bp_core_redirect( wp_login_url() );
    }
    
    add_action( 'bp_template_redirect', 'mpp_custom_single_media_access_restriction' );
    
    /**
     * Do not load lightbox for non logged users.
     *
     * @param array $settings settings.
     *
     * @return array
     */
    function mpp_custom_filter_lightbox_options( $settings ) {
    
    	if ( ! did_action( 'init' ) || is_user_logged_in() ) {
    		return $settings;
    	}
    
    	// if we are here, user is not logged and it is after init action.
    
    	$settings['load_lightbox'] = 0;
    
    	return $settings;
    }
    add_filter( 'mpp_settings', 'mpp_custom_filter_lightbox_options' );
    

    Currently, we don’t have filter for individual option, so we had to filter the settings array. In future, I will add a way to filter individual option too.

    Please do let me know if the code works for you or not?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25482

    Hi BIN,
    Thank you for the patience.

    I have updated the plugin. Please upgrade to 1.3.0 from here
    https://buddydev.com/plugins/blog-categories-for-groups/

    1. User must select category on create screen :- Now it is enforced. The users are required to select terms.

    2. Do not let Blog admins disable blog: – Please visit Dashboard->Settings->Blog Categories for Groups and for the option “Allow group admin to disable blog tab?” set “No”.

    4. Now all articles published by different group admin but who join the same directory are listed together. :- Fixed. It will only list articles from current group now.

    5. You can disable this behaviour now. For the option “Disable group blog post edit link leading to dashboard?” . Set it to “Yes”.

    Hope that helps.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25482

    Hi,

    Thank you for the patience.

    Please upgrade to 1.3.0 and then you can visit Dashboard->Settings->Blog Categories for Group and for the setting

    “How do we link to single posts?”, Please select “Link to normal site blog post page.” That will do it.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25482

    Thank you. I will post the code soon.

    Please make sure to remove the code posted in the previous reply.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25482

    Hi Richard,
    Thank you.

    Since you are using the MPP Lightbox now, we can go with any of the strategy. Which one will you like to go with?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25482

    You can use hour/days in time value, just use their number in minutes, For example, 60 for 1 hour and 1440 for 1 day.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25482

    Hi Carsten,

    1. I checked again. To allow unlimited, return 0. The zero should be number not ‘0’.

    2. Sorry, I was confused, it is priority and number of arguments the attached function receives.
    Here 10 is priority on which our function gets called and 2 is no. of arguments it will be passed.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25482

    Hi Richard,
    I am sorry but I am not sure how are you able to use that plugin with MediaPress.

    Are you sure you are not using custom media loop or any js/css/php for it as out of the box, they can not work out of the box(specially showing the larger image on click).

    Please recheck and let me know.

    Regards
    Brjesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25482

    Hi Richard,
    Thank you.
    Sure, Please feel free to ask any question.

    Regards
    Brajesh

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