nycwebworks
El Presidente
Friendly Neighbour
Member Likes (0)
By default, it appears that BuddyPress profile settings have only 2 possible privacy settings--visible to everyone or visible only to logged in members. Is there a hack/plugin that will allow member to make their profiles visible only to BuddyPress "friends"?
Ideally, users should be able to set this privacy option individually (e.g., each member could choose their own setting). However, I'd settle for a hack that changes the behavior of the "only visible to logged in members" setting to "only visible to friends". Any suggestions?
Responses (14)
Geeky Developer (joined June 2009) Likes (0)
hi
don't know about the hack but adding this to theme functions.php should do it
adding this option to the profile setting will need some bp hook work.
cheers
Member (joined December 2010) Likes (0)
Thanks Richie... The code is successfully checking to see if a user is a friend of the member who's profile the user is trying to view and redirecting if not, but there are three problems:
1. It is preventing users from viewing their own profiles
2. It is redirecting super admins
3. It is redirecting to the home page with no explanation
What changes would be needed to make it:
1. Allow a user to view their own profiles
2. Ignore the filter if the logged in user is a super admin
3. Redirect to page "mysite.com/not-friends/" instead of "mysite.com/"
Thanks
Member (joined December 2010) Likes (0)
Bump...
Geeky Developer (joined June 2009) Likes (0)
try this
WPMU DEV Fanatic (joined October 2009) Likes (0)
@Richie_KS, that really is awesome stuff! Who needs the BP Privacy component with developers like you around! :)
@nycwebworks, let us know how that works for ya!
Member (joined December 2010) Likes (0)
@Richie_KS, thanks pal! I forgot to mark this as resolved.
@DavidM, yes, it works perfectly. The only drawback to this approach is that the setting is sitewide and individuals can't override it they choose. Hopefully we'll see better options for user preferences in a future release or plugin soon.
Member (joined December 2010) Likes (0)
And again I forget to mark it as resolved... lol
Member (joined July 2011) Likes (0)
HI ,
Great code Richie, i was looking for something simple as that. However, I took your code and changed it a little and i want to know if it is safe using it this way:
then on every page in /members/single that i want to make private i add the code below to the top of the page :
not-friend.php is a simple template page that hold the message that i want to appear for example " this information is private and only friends can see .
this way the user get to the member page and only see his name, avatar and also the buttons to "add friend" or send a message. but not his profile information.
Member (joined July 2011) Likes (0)
To all serious coders and developers,
This is Awesome! Good job Richie! We are building a new club site that will change the way people party on and off line. We are looking for some serious coders, web developers and mobile app cats to join us. We will be putting together a team, so please hit me up if you are interested, I will let you about the project when I receive your e-mail.
Thank You,
Eddie Key Jr.
offkeymkt@gmail.com
Member (joined February 2012) Likes (0)
What if I want certain profile fields to be visible publicly and others only visible to friends?
Member (joined February 2012) Likes (0)
Synt - it could well be that the Buddypress Profile Privacy plugin is what you're after.
http://wordpress.org/extend/plugins/buddypress-profile-privacy/
It requires a bit of tinkering but that does offer by-field privacy options. I just wish I could get it to restrict the views based on friends!
Member (joined April 2012) Likes (0)
wpmudev,
Can you take a look at @fitoussi 's code (Richie never responded) and see if this is a valid implementation? We'd like to achieve that same thing, friends only privacy.
This would be a nice WPMUDEV plugin!
~eric
@ericslangley
Member (joined July 2011) Likes (0)
Wow , that was a while ago :) but i ended up using it for a while back then and it worked fine. But how about the new privacy features in the latest update of buddy press? Isn't that what it suppose to do?
People Person (joined February 2012) Likes (0)
Wow this one is buried! :)
Did anyone else start a ticket on this elsewhere, seems a bit deja vu...
Perhaps we should as this is waaaay long and waaay old :)
WordPress Questions?
We've got answers!
Find out more »