Privacy Settings Error Message

Hi

I am running the latest verison of the theme and the latest version of BP.

Under BP settings on the theme, I enable the option:

"Do you want to enable friend only privacy for user profile"

When I click on a profile in BP that I am not friends with I get the following error message:

Warning: Cannot modify header information - headers already sent by (output started at /home/belmonte/public_html/wp-content/themes/bp-community/members/single/home.php:12) in /home/belmonte/public_html/wp-includes/pluggable.php on line 934

Please help!

    Nicholas

    Hi Phil

    I have deactivated all plugins, not BP of course.
    I still get an error, it seems different though:
    Fatal error: Class 'BP_Friends_Friendship' not found in /home/belmonte/public_html/wp-content/themes/bp-community/functions.php on line 237
    In BP I have my components setup as follows:

    ONLY, Extended Profiles and Account Settings Selected.
    The Friend Conenction component is not selected.

    And then in the theme I have options:
    "Do you want to enable friend only privacy for user profile" is enabled.

    What I need is a very private site. People should not be able to see each others profiles. Only the administrators must be able to see the extra fields. But there is no option I can find in Buddypress or a plugin that works that allow me to effectively set the profile privacy settings.

    So I thought if I switch of the ability to Friend people in BP and I swith on the friend only privacy setting in bp-community users would not be able to friend each other and thus never be able to see other users profiles.

    If I switch the component in BP on:

    "Friend Connections" and I leave the setting in bp-community:
    "Do you want to enable friend only privacy for user profile" is enabled.

    Then I get a dirrent error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/belmonte/public_html/wp-content/themes/bp-community/members/single/home.php:12) in /home/belmonte/public_html/wp-includes/pluggable.php on line 934

    Nicholas

    Hi Phil

    Please read my email again. I tried all the different ways. In BP I have the following component switched "enabled":

    "Friend Connections"

    I also have the following component in BP-Community enabled:

    "Do you want to enable friend only privacy for user profile"

    I then do a search using the Search Members function in the menu bar using a member name I know is part of the community. I am not linked with her as a friend in my testing account, for the purpose of testing this functionality. I then get the following message:

    Warning: Cannot modify header information - headers already sent by (output started at /home/belmonte/public_html/wp-content/themes/bp-community/members/single/home.php:12) in /home/belmonte/public_html/wp-includes/pluggable.php on line 934

    To sum up:

    I create a test user.
    I do a search on a different user I am not friends with
    I get the search results back with the name of this user.
    I click on the name of this user.
    I get the above error message.
    BP-Community is supposed to take me to either the default page or the page I specify if I am not friends with that person. It does not do that, it gives me the above error message.

    Mason

    Hiya,

    Fatal error: Class 'BP_Friends_Friendship' not found in /home/belmonte/public_html/wp-content/themes/bp-community/functions.php on line 237
    In BP I have my components setup as follows:

    ONLY, Extended Profiles and Account Settings Selected.
    The Friend Conenction component is not selected.

    As Phil said, that's not a bug but the expected behavior when the Friend component is not selected.

    Warning: Cannot modify header information - headers already sent by (output started at /home/belmonte/public_html/wp-content/themes/bp-community/members/single/home.php:12) in /home/belmonte/public_html/wp-includes/pluggable.php on line 934

    I was able to recreate this issue - it doesn't appear to happen to the Super Admin user (which can see all members regardless of privacy settings) but when attempting to view the members directory from a non-logged in user I am also able to get this error with my privacy settings setup in the theme the same as yours.

    I've sent this over to Richie who'll take a look at this and get an update out as soon as possible.

    Thanks!

    Nicholas

    Hi Richie

    I did what you asked. Copied the files over. I still get the error. Here is how the settings look:

    On the theme:
    "Do you want to enable friend only privacy for user profile" is enabled
    In BP components:
    "Friend Connections" is enabled

    I log in as a NORMAL user, no admin rights of any kind.
    I do a search using the search box top right in the theme for a member.
    The theme returns the result with the member name.
    I click on the member name.
    I get this error message:
    Warning: Cannot modify header information - headers already sent by (output started at /home/belmonte/public_html/wp-content/themes/bp-community/members/single/home.php:12) in /home/belmonte/public_html/wp-includes/pluggable.php on line 934

    I have tried all different scenarios, all plugins disbaled, theme re-installed, still the same error.
    What I want to achieve is membership privacy.
    I want certisn profile fields to be visible to ADMIN only. But I could not find a plugin that works. So I thought this solution, of enabling friend only privacy is at least a 90% solution. I will just let my users know to not accept any friend requests from people they do not want to give access to their profiel information.

    Is there a different solution?

    Nicholas

    Hi Richie

    Edited the file, it now looks like this:

    function bp_displayed_user_is_friend() {
    global $bp;
    $friend_privacy_enable = get_option('tn_buddycom_friend_privacy_status');
    $friend_privacy_redirect = get_option('tn_buddycom_friend_privacy_redirect');

    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('wp_head','bp_displayed_user_is_friend',3);

    I tried with both wp and bp.

    With wp_head I get this error:
    Warning: Cannot modify header information - headers already sent by (output started at /home/belmonte/public_html/wp-content/themes/bp-community/members/single/home.php:12) in /home/belmonte/public_html/wp-includes/pluggable.php on line 934

    With bp_head I get this error:
    Warning: Cannot modify header information - headers already sent by (output started at /home/belmonte/public_html/wp-content/themes/bp-community/members/single/home.php:12) in /home/belmonte/public_html/wp-includes/pluggable.php on line 934

    So that did not work...Are you able to recreate the issue, will it maybe not be more effective if I give you temporary access and you can log in and check things out?

    Nicholas

    Will do, thanks Richie.

    Is there not a plugin that can do what I want that you know of? I just need certian fields in my extended profile to be visible to admin users only?

    Then I can switch the friend system on and open things up. But if I cannot block certian profile fields I have to find another way. Thats why I started playing around with these settings thats causing all these issues now...

    I have searched, but cannot find one thats compatible.