-
Author
Tagged: Members directory hide member
-
October 16, 2015 at 18:04 #82714mtgame21Participant
Using Buddypress. What is the recommended way to hide specific accounts from appearing in the Members Directory. The two scenarios would be:
1. hiding admin accounts from appearing on a member directory search results page
2. Have two PMPro membership levels. Basic account, you don’t show up on a member directory search results page. For the Premium account, you do show up in search results.Is there a plugin that might help with either or both of these scenarios?
October 17, 2015 at 02:18 #82894LauraModeratorHello, for the admin:
Add this to child theme functions.php
1. – Deny access to admins profileCOPY CODE// deny access to admins profile. User is redirected to the homepage function bpfr_hide_admins_profile() { global $bp; if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) : wp_redirect( home_url() ); exit; endif; } add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
2. – Remove admin from the member directory and recount members
COPY CODE// Remove admin from the member directory function bpdev_exclude_users($qs=false,$object=false){ $excluded_user='1'; // Id's to remove, separated by comma if($object != 'members' && $object != 'friends')// hide admin to members & friends return $qs; $args=wp_parse_args($qs); if(!empty($args['user_id'])) return $qs; if(!empty($args['exclude'])) $args['exclude'] = $args['exclude'].','.$excluded_user; else $args['exclude'] = $excluded_user; $qs = build_query($args); return $qs; } add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); // once admin is removed, we must recount the members ! function bpfr_hide_get_total_filter($count){ return $count-1; } add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');
3. – Hide admin’s activities from all activity feeds
COPY CODE// hide admin's activities from all activity feeds function bpfr_hide_admin_activity( $a, $activities ) { // ... but allow admin to see his activities! if ( is_site_admin() ) return $activities; foreach ( $activities->activities as $key => $activity ) { // ID's to exclude, separated by commas. ID 1 is always the superadmin if ( $activity->user_id == 1 ) { unset( $activities->activities[$key] ); $activities->activity_count = $activities->activity_count-1; $activities->total_activity_count = $activities->total_activity_count-1; $activities->pag_num = $activities->pag_num -1; } } // Renumber the array keys to account for missing items $activities_new = array_values( $activities->activities ); $activities->activities = $activities_new; return $activities; } add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 );
For the premium accounts this would require some extra time and development, i suggest to hire a developer to do it for you 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
October 19, 2015 at 18:29 #83195mtgame21ParticipantThanks Laura, I will give this code a try. Also, I did some more research and found a plugin called BP Profile Visibility Manager that I will experiment with as well. You can mark this as resolved.
October 19, 2015 at 22:34 #83279LauraModeratorHello, will do 🙂 Let me know if you need anything
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
October 28, 2015 at 19:14 #84753maxgalimbertiParticipantI tried the n. 2 but it doesn’t work, do I have to use the n. 2 alone
October 30, 2015 at 01:09 #84985LauraModeratorHello, try adding all of them 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
February 28, 2017 at 18:37 #154391bonzothecatParticipantHi! Thanks for posting these theme updates. Unfortunately they don’t seem to work on my site – I updated the theme as per the instructions above, but “admin1234” (my admin account) still keeps showing up in all the member lists. Any ideas?
Howard Taylor
Sooke, BC, Canada
March 1, 2017 at 17:19 #154492LauraModeratorHello, did you add the user ID? its just a number, NOT the user name 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 1, 2017 at 17:48 #154504bonzothecatParticipantHi, Laura! I rechecked the code that I entered (basically a cut-and-paste of yours), and confirmed it only references user id 1, and I also confirmed that the admin id on my system is 1. I have attached a copy of the my KLEO Child modifications, they look okay to me.
Howard Taylor
Sooke, BC, Canada
March 1, 2017 at 18:38 #154512bonzothecatParticipantSorry, couldn’t upload the .TXT file:
KLEO_child.txt: Sorry, this file type is not permitted for security reasons
Howard Taylor
Sooke, BC, Canada
March 2, 2017 at 23:16 #154638LauraModeratorHello, could you share admin credentials and ftp so i can take a look?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 4, 2017 at 18:15 #154765LauraModeratorHello, i do not have access to any folder, please let me know 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 6, 2017 at 05:08 #154842LauraModeratorHello, i mean to the ftp all i see is the ftp quota
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 6, 2017 at 14:31 #154875LauraModeratorHello, a suggestion: Create a new user, copy the user ID to the codes, make the user admin, delete the old admin user and assign all the stuff to the new admin
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 6, 2017 at 18:12 #154908bonzothecatParticipantHm. I have to wonder: if the code does not work for user id 1, why would it work for a different user id? Maybe I will just put up with admin always showing up in member lists.
Thanks, Howard
Howard Taylor
Sooke, BC, Canada
March 7, 2017 at 23:28 #155014LauraModeratorHello, maybe the admin id is not 1,that is why i suggested to do that 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 8, 2017 at 00:39 #155025bonzothecatParticipantHi, Laura;
I’m pretty sure the admin id is 1: it shows up in the Edit Groups page.
Cheers, Howard
Howard Taylor
Sooke, BC, Canada
March 8, 2017 at 01:15 #155026bonzothecatParticipantI checked the log, and I see this:
[06-Mar-2017 12:19:59 UTC] PHP Fatal error: Cannot redeclare get_current_user_id() (previously declared in /home/htaylor/public_html/wp-includes/user.php:426) in /home/htaylor/public_html/wp-content/themes/kleo-child/functions.php on line 92
Does this seem relevant?
Cheers, Howard
Howard Taylor
Sooke, BC, Canada
March 8, 2017 at 21:08 #155125LauraModeratorHello, all i can suggest now is to hire a developer to look at it for you as the code doesnt seem to be working for an unknown reason
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 8, 2017 at 21:17 #155126bonzothecatParticipantCan you tell me if the version of VC supplied with Kleo, VC 4.10, is compatible with WP 4.7.3? Does VC 4.10 work on other Kleo sites? I see in the VC release notes that 4.11 was released to be compatible with WP 4.5, and the current VC release is 5.0.
https://wpbakery.atlassian.net/wiki/display/VC/Release+Notes
Howard Taylor
Sooke, BC, Canada
March 10, 2017 at 01:26 #155290LauraModeratorHello, with each update, we update VC too, so just wait for the next kleo update 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.