Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)
  • @jsepkenya

    Participant

    add this to your theme functions
    to redirect to wherever

    ///////////////////////////////////////////////////////////////////////
    /// check if is friend
    ///////////////////////////////////////////////////////////////////////
    function bp_displayed_user_is_friend() {
    global $bp;
    $friend_privacy_enable = “enable”;
    $friend_privacy_redirect = ‘http://yourdomain.com/members’;

    if($friend_privacy_enable == “enable”) {
    if ( bp_is_profile_component() || bp_is_member() ) {
    if ( (‘is_friend’ != BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $bp->displayed_user->id )) && (bp_loggedin_user_id() != bp_displayed_user_id()) ) {
    if ( !is_super_admin( bp_loggedin_user_id() ) ) {
    if($friend_privacy_redirect == ”) {
    bp_core_redirect( $bp->root_domain );
    } else {
    bp_core_redirect( $friend_privacy_redirect );
    }
    }
    }
    }
    } //enable
    }
    add_filter(‘get_header’,’bp_displayed_user_is_friend’,3);

    ///////////////////////////////////////////////////////////////
    // check privacy
    ////////////////////////////////////////////////////////////////

    function check_if_privacy_on() {
    global $bp;
    $location = $_SERVER[‘HTTP_REFERER’];
    $privacy_enable = “enable”;
    $privacy_redirect = ‘http://your domain.com/login/’ ;
    if($privacy_enable == “enable”) {
    if ( bp_is_profile_component() || bp_is_activity_component() || bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) {
    if(!is_user_logged_in()) {
    if($privacy_redirect == ”) {
    bp_core_redirect( $bp->root_domain . ‘/’ . BP_REGISTER_SLUG . ‘/’ );
    } else {
    bp_core_redirect( $privacy_redirect ) ;
    }
    }
    }
    } //off
    }

    add_filter(‘get_header’,’check_if_privacy_on’, 1);

    function check_if_create_group_limit() {
    global $bp;
    $create_limit_enable = “yes”;
    $create_limit_redirect = ‘http://yourdomain.com/groups’;
    if($create_limit_enable == “yes”) {
    if( bp_is_group_create() ) {
    if ( current_user_can( ‘delete_others_posts’ ) ) { //only admins and editors
    } else {
    if( $create_limit_redirect == ” ) {
    bp_core_redirect( $bp->root_domain . ‘/’ );
    } else {
    bp_core_redirect( $create_limit_redirect );
    }
    }
    }

    } //off
    }
    add_filter(‘get_header’,’check_if_create_group_limit’,2);

    for all pages created with buddypress level 1 i hope is all u want to restrict

Viewing 1 replies (of 1 total)
Skip to toolbar