Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Privacy options (friends only viewing)


texet
Participant

@texet

@Pcrain

When i placed your code,it shows this error message

Fatal error: Cannot use object of type stdClass as array in /home/username/public_html/sitename/wp-content/bp-themes/bpmember/friends/index.php on line 13

If you update your code thusly, it should work:

<?php

global $bp, $wpmu;
$potential_friend_id = $bp->displayed_user;
$friend_status = BP_Friends_Friendship::check_is_friend( $bp->loggedin_user, $potential_friend_id );
if ( $friend_status != 'is_friend' && $potential_friend_id != $bp->loggedin_user) {
echo "You must be friends to view this profile.".bp_add_friend_button();
} else { ?>

And of course add the

<?php } ?>

at the end.

Skip to toolbar