BuddyPress – Xprofile Privacy plugin
BuddyPress currently doesn't support any kind of privacy control over profile data. Members of BuddyPress team are working on Privacy Component which will be part of some of the future releases, but until then this plugin can be helpful.
Xprofile Privacy plugin will give your users option to choose which profile data they want to share. Profile data can be public, viewable only to friends or be completely private. Users can set their privacy while editing profile or within Settings section in Profile Privacy part.
Here are some screenshots:
Installation steps:
- Download plugin: CPT BuddyPress Xprofile Privacy Plugin 0.1.1
- Go to Plugin admin section and active it
- IMPORTANT: In order to hide profile data that are not public when profile page is displayed, you will have to change one line in your BP members theme file:
profile/profile_loop.phpIf you are using default BuddyPress theme, then the file is:
wp-content/bp-themes/bpmember/profile/profile_loop.php
Replace the line:
4
<?php if ( bp_profile_group_has_fields() ) : ?>
with
4
<?php if ( bp_profile_group_has_fields() && cpt_bp_xprofile_privacy_allowed_fields() ) : ?>
- If you want to enable your users to set their privacy when editing profile data you will have to change one more file, this time BuddyPress core file.
In the file
bp-xprofile/bp-xprofile-classes.phpfind method
BP_XProfile_Field::get_edit_html()
and at the end of the method, just before return $html, add this line:
$html = apply_filters('bp_xprofile_field_edit_html', $html, $this);
I will post a ticket to ask BuddyPress team to add this hook into core, but for now this change is necessary.





June 15th, 2009 - 20:29
Witch line i have to change in profile_loop.php at facebuddy-member-theme ? Thanks.
June 16th, 2009 - 14:35
Hi dio.
In Facebuddy theme you also have to change line 4 of profile-loop.php file.
Instead of:
<?php if ( bp_group_has_fields() ) : ?>
place:
<?php if ( bp_group_has_fields() && cpt_bp_xprofile_privacy_allowed_fields() ) : ?>
Btw, bp_group_has_fields() is deprecated. This function still works, but it is better to use bp_profile_group_has_fields() (recommendation of BuddyPress team).
June 20th, 2009 - 12:44
hey, I implemented your plugin per instructions. I get this error:
Parse error: syntax error, unexpected T_ENDIF in /home/eastlond/public_html/wp-content/bp-themes/facebuddy-member-theme/profile/profile-loop.php on line 25
Im using facebuddy theme on wordpress mu 2.7.1, buddypress 1.01
June 21st, 2009 - 15:03
Hi jody.
There is a typo in previous comment, sorry. Wordpress seems to add space after <.
Instead of
< ?php if ( bp_group_has_fields() && cpt_bp_xprofile_privacy_allowed_fields() ) : ?>
it should be
<?php if ( bp_group_has_fields() && cpt_bp_xprofile_privacy_allowed_fields() ) : ?>
(beginning of the line should be <?php without space between < and ?)
June 24th, 2009 - 06:18
Thanks sandra. I’ll try that and let you know if it works. It would help if I knew php better. At mo I’m just copy pasting the code around.
June 24th, 2009 - 10:28
No problem.
Thanks for your interest.
June 24th, 2009 - 15:55
Thank you for this tutorial.
But I still have a problem width the security of the member data: after getting all these profile fileds private I have completely logged out and on the startscreen I made a member-search. Then I got search results (still logged out) and in the result entries I got shown some of the fields prior marked as “for friends only”. How can I also fix this. Where do I find the template for the member- blog- or group-search? Does anybody know?
June 25th, 2009 - 14:19
Hi Tom.
I disabled search on any field that is not public. So, if all your fields are private, search shouldn’t give you any results.
I see additional fields in “Featured Members” section though, so I guess you are referring to them.
Thanks for reporting this, I will fix it and upload new version of plugin as soon as possible.
July 9th, 2009 - 19:48
Any update for the plugin, Sandra?
July 10th, 2009 - 05:10
hi there. your plugin looks great. i do have one question that i couldnt figure out by looking through the code. i want to assign all the fields as private initially. this could be just as simple as having the radio button checked as if there is no value already in the database. i just couldnt find that part of the code. any help would be much appreciated. thanks
July 10th, 2009 - 10:27
@Ray
No, unfortunately, no update yet. I haven’t got time to get back to this.
But, it’s not forgotten…
July 10th, 2009 - 12:05
Hi jason.
I made a very small change in a plugin to set radio buttons to some default value. So, first step would be downloading plugin again.
Default for plugin is to set all fields to be public. If you want to set them to be private then you will need to change line 28,
define( ‘CPT_BP_XPROFILE_PRIVACY_FIELD_DEF_VALUE’, ‘2′ );
to
define( ‘CPT_BP_XPROFILE_PRIVACY_FIELD_DEF_VALUE’, ‘0′ );
And that should be it. Let me know how it worked out.
July 11th, 2009 - 03:08
Hi Sandra,
Thanks for noting that code for setting default values.
Is it possible to set default values for the “Base” fields only?
July 11th, 2009 - 05:01
Thanks…this is great! You’ve provided something that I’ve been looking for…great work!
July 11th, 2009 - 16:30
Hi..Now that I’ve tried this, it looks like it’s breaking another custom plugin I’ve got..wondering if you do custom work that might do a work around for this
July 12th, 2009 - 15:18
Hi, thanks for the great plugin, can’t get it working though! Have installed and activiated it fine, but when I log in and go to other accounts that I’m not friends with, I can still access it and see everything. I haven’t installed the section to allow users to adjust settings but I have adjusted the default setting as above to make the default private – still nothing looks like its changed, I can still access profiles that I’m not friends with – what I am doing wrong please?
Thanks, Mr C
July 13th, 2009 - 10:45
@Ray
No, that is not possible. This plugin is made just to provide basic privacy control, until BP team writes privacy component. That is why it is so simple, with just few options. If I see there is a lot of interest, I might expand it a bit.
@Allen Weiss
Can you give me more details about this problem?
Well, I can try.
July 13th, 2009 - 11:36
@Mr C
This plugin is made to give users privacy control of their profile data. No matter if you haven’t enabled privacy control in profile, users can still go to Settings area and change their privacy.
Anyway, if you first activated plugin as it was and then changed value of CPT_BP_XPROFILE_PRIVACY_FIELD_DEF_VALUE, then in your database privacy field default value is set to public. New settings (private) will be just a default value, preselected when user edits his profile. If user doesn’t change his settings, profile data will be public. To fix this to work as you like, you can run these queries on your database…
This will set default value of table field to private:
alter table wp_bp_xprofile_data alter column privacy_level set default 0;
This will set all profile data to be private.
update wp_bp_xprofile_data set privacy_level=0;
As I said, this plugin lacks of settings because it is meant to be a temporary solution until BP privacy component arrives.
July 13th, 2009 - 16:35
Hi Sandra
that’s ok..I found out how to make this work.
Thanks
Allen
July 14th, 2009 - 19:32
Hey.
Thanks for the plugin. But is there anyway to not show the privacy options at the name field? Is seems wierd that you can toggle that, as the users name will still be shown anyway no matter what you choose.
Otherwise a great plugin!
July 15th, 2009 - 12:42
Hi Mikael.
Yes, you are right… Maybe I can skip adding privacy control on name field or add some switch.
Thanks for suggestion.
July 24th, 2009 - 18:24
Hi Sandra!
Great plugin! Exactly what I was looking for!
One question, if you put the Name field to prive, does it also hide that name from Activity feeds and Wire posts etc? Or does it just hide in the Profile page?
Thanks for a great plugin!
Erwin
July 25th, 2009 - 23:54
Bin gerade nicht in der Stimmung auf Englisch
Steht der Code explizit unter der GPL? Wenn ja, kann das Plugin in den Core von BuddyPress einfließen.
Gruß Dennis
July 27th, 2009 - 10:24
Hi Erwin.
No, name field can’t be private/hidden in other BP components. Actually, Mikael from one of the previous comments made a good point, it would be good to remove privacy control from the name field because it makes confusion like it is now.
I don’t have much time to work on this now, but I will try to change it in the next couple of weeks so at least it will be clear to users that name is public data.
I hope that works for you.
July 27th, 2009 - 10:36
Hi Dennis.
Sorry, I don’t speak German. But, I translated your comment with Google translate so I have an idea what is your question.
Sorry if answer is not what you are looking for.
Yes, plugin is under the same license the BuddyPress is. It is not in the core because BP team is working on privacy component that will enable all sorts of privacy control so this plugin is a temporary solution until they release core component.
August 12th, 2009 - 20:50
Hello Sandra,
is there any way to control the activity stream, friends, etc as well? that would be much appreciated!
Thanks,
Reiner
August 20th, 2009 - 09:09
Hi Sandra,
Great plugin! Is there anyway to ‘choose’ the base information that can be changed? i.e. set a field that users cannot change???
Thanks.
Robin
August 21st, 2009 - 16:05
Hi,
I installed your plugin, customized it (look and feel). It is great. It shows up every where (on profile edits, even on registration page). But, I still cannot get it it to work, i.e., the fields are visible to every one! Irrespective of what i do
Any Ideas?
August 21st, 2009 - 16:28
Just a sample from the wp_bp_xprofile_data
44 1 9 Oracle 2009-08-21 08:15:11 0
45 3 9 Master 2009-08-21 08:15:11 0
46 753 9 Male 2009-08-21 08:15:11 0
Look at the last field, it is all set to 0, still I am able to see all the information via
http://www.oraclepronet.com/members/oracle
These are just test users. Has it got something to do with caching? I have cleared client side caching and dont have anything but a css cache tool on server
kindly advise
ramesh
August 21st, 2009 - 17:36
Sorry for posting so frequently…but i am working on a deadline to release this site
My observations
1. Updates to the table are happening properly, via update profile form (Queried database after changes).
2. Fields are still displayed irrespective of the value of privacy level in the table
Best Regards
Ramesh
August 27th, 2009 - 12:32
I have added the code to add the login boxes on the profile, however. I am using a theme from Avenue K9 and there is no area that allows me to add this:
If you want to enable your users to set their privacy when editing profile data you will have to change one more file, this time BuddyPress core file.
In the file
bp-xprofile/bp-xprofile-classes.php
find method
`code`BP_XProfile_Field::get_edit_html()`code`
and at the end of the method, just before return $html, add this line:
`code`$html = apply_filters(‘bp_xprofile_field_edit_html’, $html, $this);`code`
September 29th, 2009 - 22:37
I have Buddypress 1.0.3, and WPMU 2.8.4a. I can’t find this line BP_XProfile_Field::get_edit_html() in the core file bp-xprofile/bp-xprofile-classes.php . Please help!
September 30th, 2009 - 10:21
Functionality around xprofile data has changed significantly. In current 1.1 RC there is no more get_edit_html() method. But, as I saw on BP trac, in 1.0.3. version there is still this method in line 383. You can see it here:
http://trac.buddypress.org/browser/tags/1.0.3/bp-xprofile/bp-xprofile-classes.php
Anyway, my plugin won’t work on 1.1 (from obvious reasons
) and since privacy component from Jeff Sayre will be out soon and BP will have it’s own core privacy management in 1.2 version, I haven’t planed on maintaining this plugin, except if there are enough requests for it.
You can see here about Jeff’s plugin:
http://buddypress.org/forums/topic/buddypress-privacy-component-an-update
January 28th, 2010 - 10:10
Just to give an update: We have currently discontinued development of this plugin; we’ve switched to the Buddypress Privacy Component by Jeff Sayre ourselves. See http://jeffsayre.com/2009/12/05/buddypress-privacy-component-released/ for more details.
March 15th, 2010 - 12:53
Dear i could not find the theme “facebuddy” for my community, link is disturbed from where i wanna download, can anybuddy help me out?
April 12th, 2010 - 14:10
Sorry, we don’t have those files.
June 6th, 2010 - 19:40
Hi, is there a way to send some xprofile fields in BuddyPress activation email? I would like to send out firstname, lastname, phone number and country.
Thanks a lot!
Titus
June 6th, 2010 - 21:18
Sorry, we cannot support this plugin or any kind of Buddypress/Wordpress development as the original author doesn’t work at our company any more.
August 8th, 2010 - 10:49
hi this is what my site is telling me.hw can i solve this?Fatal error: Cannot redeclare bp_core_screen_signup() (previously declared in /home/botsc984/public_html/wp-content/plugins/buddypress/bp-core/bp-core-signup.php:12) in /home/botsc984/public_html/wp-content/plugins/buddypress/bp-core/bp-core-signup.php on line 203
August 24th, 2010 - 10:30
Hi!
I am sorry, but we cannot answer any Buddypress questions or provide any kind of Buddypress support any more. You’ll probably have better chances of getting your issue resolved by asking your question in the official Buddypress forums.
Kind regards
Markus