I already tested the advice I gave you and if you click on a users friends tab that you are not friends with it displays the message “You must be friends in order to access users friends.”
I am sure there is someway to build upon that function so it only displays the friends tab if you are friends with that user.
Thanks @bphelp !
I’m trying to make it so that a user’s “Friends” tab is only visible to that specific user (like “Settings” and “Messages”).
I think your advice would still enable a user’s friends to see their other friends.
Is there any way to make it so that the a user’s “Friends” tab is only visible to said user?
You can use this tutorial http://wpmu.org/how-to-add-profile-privacy-to-buddypress/
its meant for profiles but it can be adapted for friends. Follow it exactly but instead of putting
3. Edit your theme file to include the friendship check:
To restrict profile info, open up /members/single/profile.php and add this at the top of the page:
add that code in 3. instead to /members/single/friends.php
You may also want to change the test in 2. step to:
You must be friends in order to access users friends.
Greetings folks.
I would like to limit access to the “Friends” tab on a user’s page to the account owner and the admin?
Plus how can I hide the friends tab (in the same way “Messages” and “Settings” are only viewable for an account owner)?
Any idea how to do that?
For example, when you click on a BP user’s page, you see the “Activity”, “Profile”, “Friends, “Groups” tabs.
How can I remove the “Friends” tab from that area, and only allow access to the account owner (like “Messages” and “Settings”?
This is basically a privacy issue that I’m worried about.
Any help would be appreciated.
http://www.mediafire.com/download.php?u6oos92g344485f
This plugin does not hide the activity tab in the main nav or in the profile activity tab but it does make activity friend only unless your the admin in which case it shows sitewide activity. To test it you would have to create two accounts that are not admins and not friends and put come activity in on both and you will see that as long as your not friends you can not see the others activity.
It’s been a while since my original post, but I think I’ve figured this out and I hope this helps someone else. The original problem changed a bit too. Basically, now I want to show a profile group based on the value in an xprofile field (when editing a profile). So, if my User Category field for a logged in user says Recruiter, then I want to show the profile group called “Recruiter” (show this for admins too). Otherwise, I want to hide this profile group through php.
Thanks to the hint above, I was able to come up with a function in my child theme’s function.php file.
I’m just learning php/wordpress, and I don’t have a clear understanding why this works. I do know that $group_name[3] is the Recruiter profile group. Also, I do realize this snippet uses awful coding practices. If anyone has improvements, please let me know.
function my_recruit($group_name){
if ( is_site_admin() || xprofile_get_field_data( “User Category”)===”Recruiter”) {
echo $group_name[0];
echo $group_name[1];
echo $group_name[2];
echo $group_name[3];
}
else {
echo $group_name[0];
echo $group_name[1];
echo $group_name[2];
}
}
add_filter(‘xprofile_filter_profile_group_tabs’,’my_recruit’);
I am using latest wordpress and buddypress. For my project it is necessary to hide admin and some members for security reasons. I have tried Brajesh Singh’s solution (here) but failed.
How can it be possible?
Go to your admin > Pages and delete the register and empty the trash
Do the same if you have a Login page.
Then go to settings > buddypress.
– Tab Component and check the one you want.
– Tab Pages and create a page from there for each component.
Save.
Now BP is correctly configured.
Check also settings > permalinks and choose something other as default.
If you created some custom menus before installing BP, double check them to have the new pages.
Done !
My setup: WP Multisite (3.5) with Buddypress (1.6.3) and BBpress forum on local machine (with MAMP), all latest versions. Will build site on local before uploading on live server.
What I want to do is, all users should log-in/regster/reset password from buddypress login pages (front-end).
Intended users will also include admins (and super-admin, me!), and I guess they will be able to discharge their admin duties after login from BP front-end. IS this correct?
If so, The wordpress login should be absolutely invisible from frontend to any and all users even when they try to access the http://example.org/wp-login.php from browser address bar. wp-login.php should also not come up after unsuccessful login attempts or for reset password requests. Everything must be accomplished through BP login/register/reset components.
I intend to create an AJAX based widget which will be positioned on header top-right (like facebook, but with AJAX), which will handle everything without page reload. I am concocting some code snippets, but that’s for later.
I am looking to move or add part of the admin bar to my main nav bar. I would like to add the login/user and notifications to my main nav bar and hide the admin bar on the front end.
I know how to remove it, but can’t seem to figure out how to add these features to my nav bar.
This is the portion of the admin bar I need:
View post on imgur.com
And here is where I would like to add it:
View post on imgur.com
When attempting to edit my BP Profile fields I get a window showing the following code.
What is it and how do I fix it?
Thank you.
REQUEST variables: page = bp-profile-setup mode = edit_group group_id = 1 wordpress_0575dbccba3b6906f4fb144e66d0e6f6 = admin|1358338385|a0228376c57e9d89d8ed7afe14014b2e wp-settings-1 = m5=c&m9=c&m1=c&m10=c&m3=c&m6=c&m2=c&editor=tinymce&m8=c&m7=c&m11=c&m12=c&m4=c&m14=c&m15=c&m13=c&align=center&imgsize=full&m0=c&urlbutton=custom&m16=c&m17=c&hidetb=1&m18=c&m19=c&m20=c&m21=c&tml1=1&tml0=0&wplink=1&widgets_access=off&libraryContent=browse&cats=pop wp-settings-time-1 = 1358165589 PHPSESSID = l9nf1rl419lp1a1btvucffvuu7 wordpress_test_cookie = WP Cookie check wordpress_logged_in_0575dbccba3b6906f4fb144e66d0e6f6 = admin|1358338385|32007ef4034e251f66949757a22b42b2 bp-activity-oldestpage = 1 bp-activity-scope = all bp-activity-filter = new_blog_post
Using WordPress version 3.5
BuddyPress version 1.6.3
http://www.thecharlottechurch.org
Easiest way is to go to wp-admin on the site you want to hide, go to the Settings > Reading menu, and tick the “Discourage search engines from indexing this site” option. Of course, this will also ask search engines to not index that site.
That doesn’t seem to hide the main site’s wp-admin login. Each time a user who owns a blog clicks on the main site item at the top left hand side, they are sent to the admin of the top site.
>You do not have sufficient permissions to access this page.
If you want to hide stuff but want it to be available to Google, you could use CSS and/or jQuery to hide things. Check out this post about how to add BuddyPress-specific body classes:
CSS Body Class for BuddyPress Group Moderators and Admins
Here is a post that might help if you want to hide everything from Google: http://premium.wpmudev.org/forums/topic/buddypress-how-do-i-hide-community-elements-from-non-members
hi there, i have a similar problem on my wordpress multisite, however, unchecking “Show the admin bar for logged out users” doesn’t work for me.
what’s really weird is, on some websites on my multisite the admin bar shows up but not on others.
any ideas?
thanks,
Adam
I solved this problem.
The plugin “BuddyPress Friends Only Activity Stream” claimed to only show activity from your friends and the admins only. I guess since you can’t be friends with yourself, it hides your activity as well. :/
I may look into the plugin’s files later to see if there’s a workaround for this, but as of right now it’s staying deactivated.
Hi,
I just install WordPress 3.4.2 and BuddyPress 1.6.1 on my local machine (Windows 7 64bit, IIS 7.5, MySQL 5.5)
I can’t post in the “Activity Streams Directory” and in the “What’s new in Groupe…”
I saw a lot of post in your forum and over internet that are talking about incompatibility with MySQL Strict Mode…
I’ve enabled the DEBUG mode in wordpress and here’s the result when I try to post in the Activity :
===========
WordPress database error: [Incorrect integer value: ” for column ‘item_id’ at row 1]
INSERT INTO wp_bp_activity ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( 1, ‘activity’, ‘activity_update’, ‘admin posted an update’, ‘test’, ‘http://andre.com/members/admin/’, ‘2012-12-04 23:13:39’, ”, ”, 0, 0 )
-1
===========
NOTE : the domain “andre.com” point to “localhost”
I’ve tried to set 0 as a default value for the field ‘item_id’, but still having the same problem.
Can any one point me to the right direction to solve that problem… and in the same time save a lot of trouble to other people to 😉
Thank you!
streams are not related to profile fields. stream is created by site activity. i don’t think theres a decent way to hide that other then for admin users using a plugin or by modifying code stuff.
The name of the menu is ‘my-account-buddypress’. This is a buddypress menu and therefore you cannot find it in the wordpress adminbar.php file. It is added when you installed buddypress. You can remove it by adding the following to your theme’s functions.php file:
function remove_bp_adminbar() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu(‘my-account-buddypress’);
}
add_action( ‘wp_before_admin_bar_render’, ‘remove_bp_adminbar’ );
If someone knows the names of the submenus in this buddypress menu I would like to know them so that I can remove the redundant ones (media, forms, friends etc).
Hi! There are a way for hide a member in member list?
For example i would not show “admin” user.
Thanks
I think a better bet is to collect that info on the BP registration page and then not display it on the user profile (that way you’ll still be able to use it in other ways). With BP 1.6. you can change the visibility of each xprofile field to friends only, logged-in users, or public (and force that level or allow the user to override your selection). (Visible to admin only is coming in BP 1.7, btw, which would totally fix you up.) At the moment, you can modify your theme template file (themes/yourtheme/members/single/profile/profile-loop.php) to hide some fields like this:
`about line 17:
<?php $no_display_fields = array( // Enter the field name of any field that you don't want to appear on the user profile.
‘E-mail’,
‘Name of Field Hide’,
‘Another’
);
if ( bp_field_has_data() && !in_array( bp_get_the_profile_field_name(), $no_display_fields ) ) : ?>`
It’s a hack, but it works for me (until BP 1.7).
Hi @wpmirwin, this part of code above is from buddypress Notifcation manager plugin.
https://wordpress.org/extend/plugins/buddypress-notifications-manager/
mybe this plugin can help you.
this function hide the notifications subnav, and it should work in bp 1.5 and bp 1.6
function bp_hide_notifications_subnav(){
global $bp;
bp_core_remove_subnav_item($bp->settings->slug, ‘notifications’);
if ( bp_use_wp_admin_bar() ) {
add_action( ‘wp_before_admin_bar_render’, create_function(
”, ‘global $bp, $wp_admin_bar; $wp_admin_bar->remove_menu( “my-account-settings-notifications” );’ ) );
}
}
//if is not bp 1.5
if ( version_compare( BP_VERSION, ‘1.5’ ) < 0 )
add_action( ‘wp’, ‘bp_hide_notifications_subnav’);
else
add_action( ‘bp_setup_nav’, ‘bp_hide_notifications_subnav’ );
I’m in despair for such a solution right now. So, I think it’s better to have all custom fields mandatory while members can decide whether to hide or show them in public such that they can edit any fields later if they want to. Also, re-register from front end all manually created profiles from dashboard. This is the most plausible solution to me at this time.
Thanks for your time.
Thanks @modemlooper
I was able to comment out the entire form with /* and */, but the user is still directed to a general settings page (that is now blank except for the title “General Settings”). Granted this is better than having the password and email field, but is there a way for me to bypass that tab and go straight to the notifications?
Also, I have settings checked in the admin panel because I want the user to be able to change the notification and privacy preferences. Is that correct?
I’m not sure why I didn’t think of this before, but I could just hide the tab in CSS (like I did previously) and then use a 301 redirect match in my htaccess from settings to settings/notifications. Huh, is that a viable way to achieve this?
In BP-default folder you can edit the file members/single/settings/general.php
Just comment out the form for the settings. BTW did you uncheck settings option in admin?
Thanks for the rating.