Search Results for 'Hide Admin'
-
AuthorSearch Results
-
November 24, 2013 at 12:42 am #174707
In reply to: Buddypress on Mobile / Hide admin access
mattg123Participant@pjbursnall , I wouldn’t say that it is pretty easy here
<?php global $current_user; get_currentuserinfo(); $display = $current_user->display_name; $login = $current_user->user_login; $userid = $current_user->ID; $home = get_home_url(); ?>
add that above your custom drop-down then its pretty simple just echo out the username, url etc
<li class="li-fourth"><a href="<?php echo $home . '/members/' . $login . '/activity/mentions'; ?>">Mentions</a></li>
EDIT –
Oh the other bit you’d have to google for is the avatar but here
<?php echo bp_core_fetch_avatar( array('item_id' => $userid, 'type' => 'full', 'width' => 100,'height' => 100));?>
You’ll want to adjust the width/height accordinglyNovember 24, 2013 at 12:38 am #174705In reply to: Buddypress on Mobile / Hide admin access
pjbursnallParticipantHi Matt,
I have no issue creating a drop-down menu, the other side is a little trickier when you don’t know php, but I’ll have a good read.
Seems BP is not as straightforward as it’s made out to be.
Thanks,
Paul.November 24, 2013 at 12:30 am #174704In reply to: Buddypress on Mobile / Hide admin access
mattg123Participant@pjbursnall yeah that code replicates the notification element only (the only part that is somewhat confusing to replicate) you place the code in the plugins directory in bp-custom.php you may have to create the file yourself.
http://stackoverflow.com/questions/9953482/how-to-make-a-pure-css-based-dropdown-menu – shows you how to create a drop down menu, https://codex.wordpress.org/Function_Reference/get_currentuserinfo get the current users info so you can create links to their profile pages, etc.
Just a note, to add the notifcations to your custom bar your code will look something like
<li><?php bp_notification_badge(); ?></li>
November 24, 2013 at 12:19 am #174703In reply to: Buddypress on Mobile / Hide admin access
pjbursnallParticipantHi Matt,
Thanks for the quick reply. Agreed on the admin bar, seems kind of lazy to me in it’s current form. Please excuse my ignorance but where do I place the above? My theme’s functions.php? And will that just handle the notifications element?
I’d like to find a proper fix for this as on some devices BP is completely unusable.
Thanks again,
Paul.November 24, 2013 at 12:09 am #174702In reply to: Buddypress on Mobile / Hide admin access
mattg123Participant@pjbursnall Personally I think buddypress should disable admin access anyway as most users don’t want it but that is neither here nor there. Recreating the admin bar is pretty easy, you need to know some css, html and a few bp functions to get the current users details like username etc, as for the notifications @modemlooper or @mercime posted this a while back (my apologies for not remembering which).
function bp_notification_badge() { if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ); if ( empty($notifications)) { echo '<li class="li-first" id="li-first-right"><a href="' . get_home_url() . '/members/' . $current_user->user_login . '"><span class="circle-zero">0</span></a><ul class="second-level" id="second-level-right"><li class="li-second"><a href="' . get_home_url() . '/members/' . $current_user->user_login . '">No new notifications!</a></li></ul></li>'; } else { echo '<ul class="second-level" id="second-level-right">'; $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { $badge = count($notifications); echo '<li class="li-third">'.$notifications[$i].'</li>'; } echo '</ul>'; echo '<a href="' . get_home_url() . '/members/' . $current_user->user_login . '"><span class="circle-badge">'.$badge.'</span></a>'; } } }
As for actually disabling the admin bar + backend that can be done with a plugin, plenty of them just google.
November 20, 2013 at 4:41 am #174519In reply to: 2.0 top features – ideas
Martyn_Participant* Better options for users to self delete
Expanding. Without backend access, it would be nice for a site allow a user to delete in several ways. Purge all their profile fields and networks (‘destroy all personal data’), Retain their profile fields and networks whilst making it look like they have vanished (‘hide’ if you like), Delete Uterly.
* Multiple networks. We have friends, and with plugins one sided friendships (aka followers). sometimes its useful to have different types of relationships identified – “close friends” or “have done business with” or “merely online buddies”. It would be nice for an admin to be able to define additional types of friendships either independently, or by associating a scale (an integer valued friendship, 1=I want to see your feed stuff 2=online mates 3=actual real life chums 4=we’re married).
October 5, 2013 at 6:30 pm #172349In reply to: Feature request: Hide certain members
robotnjikParticipantI have similar request. We would like to exclude admins from groups. We set that only admins can create groups and now all groups have admin for a member. It is ok to have admin activity listed but we would like to hide admins from member listings on group pages. Is this code or part of code work on BP 1.8.1.?
September 30, 2013 at 2:55 pm #172035In reply to: Function to update databse fields
martinbeaulneParticipantIf i hide the bottom tabs and the admin bar, each user can’t modify their profile.
September 26, 2013 at 11:03 pm #171870In reply to: Hide Admin from Group List
shanebpModeratorRe your rebuild of the ajax_querystring…
It’s even better to remove yourself before that query is constructed.
Take a look at this hook: bp_pre_user_query_constructRe remove group admin from loop…
That’s a tough one.
I recall not being able to do that or that the consequences were too ugly or some fail.
This is kinda of clunky – but sometimes I create a dummy user for use in those situations.
And make it clear in that profile that you aren’t a member of _____.
It gives you a ‘mask’ to wear and makes it easier to compartmentalize friend requests, etc.September 20, 2013 at 4:10 am #171569geoffreysfParticipantPutting this in the functions or bp-custom.php files did not work.
I finally managed to get the admin and any other user excluded from the members directory by modifying the bp_had_members query that was already in my members-loop.php file.
<?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ).’&exclude=1,3,25′ . ‘&type=alphabetical&per_page=30’ ) ) : ?> <!– &exclude= user_ids of the people you want to exclude –>
By adding just this, it also removed the users from the total members count.
Note: I do not use friends or activity feeds on my site, so I have no idea if it hides from them, but I suppose it wouldn’t.
I have been looking high and low for the answer to this with my limited PHP knowledge… and wanted to share it back so other people could learn from it too.
And credit where it is due, this post led me to the answer.
https://buddypress.org/support/topic/member-parameters-not-working-with-bp_ajax_querystring/September 20, 2013 at 4:04 am #171568geoffreysfParticipantThis helped me immensely while trying to hide the admin user from the member’s directory.
Thank you!
September 12, 2013 at 6:17 pm #171233Ben HansenParticipantyou can’t really hid the entire profile out of the box but you can hide most of the fields and info by setting the default visibility in the profile field setup screens.
September 2, 2013 at 5:57 pm #170759In reply to: Feature request: Hide certain members
therandomguy12345ParticipantI want to hide specific users from the “(BuddyPress) Recently Active Members” & “(BuddyPress) Members” widgets (latter one is most important for me), but I don’t want these users from the members directory. So what does the below code exactly do? Does it exclude users from members directory or the widgets? Or both?
<?php // Remove admin from directory add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); function bpdev_exclude_users($qs=false,$object=false){ //list of users to exclude $excluded_user='1';//comma separated ids of users whom you want to exclude if($object!='members')//hide for members only return $qs; $args=wp_parse_args($qs); //check if we are listing friends?, do not exclude in this case 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; } //Remove admin from member count add_filter('bp_get_total_member_count','bpdev_members_correct_count'); function bpdev_members_correct_count($count){ $excluded_users_count=1; //change it to the number of users you want to exclude return $count-$excluded_users_count; } ?>
September 1, 2013 at 3:32 pm #170721In reply to: hide members
@mercimeParticipant@famous You can limit who views the members directory page to the Site/Super Admin only by surrounding the members directory section using is_super_admin https://codex.wordpress.org/Function_Reference/is_super_admin then either echo message that the section is restricted or just redirect non-Admin users to another page if visitors try to use the members slug in your site.
August 11, 2013 at 6:08 am #169691In reply to: Feature request: Hide certain members
marmuelParticipantHi there,
I´ve added the code in the functions.php of my child-theme.
In the “Who´s online”-widget, I still see the super admins. Any ideas to hide them in the widget?
Thank you!
Cheers
MarcoAugust 8, 2013 at 12:23 am #169550In reply to: Feature request: Hide certain members
bp-helpParticipant@merosler
If your adding php code I hope you have made a child theme as @philipstancil did because that is the proper way. I would never add custom code to a parent theme’s functions.php because if you update the theme then it may get overwritten. Anyway, make sure whenever you add code to functions.php it always needs to be between opening and closing php tags like this:<?php // Remove admin from directory add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); function bpdev_exclude_users($qs=false,$object=false){ //list of users to exclude $excluded_user='1';//comma separated ids of users whom you want to exclude if($object!='members')//hide for members only return $qs; $args=wp_parse_args($qs); //check if we are listing friends?, do not exclude in this case 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; } //Remove admin from member count add_filter('bp_get_total_member_count','bpdev_members_correct_count'); function bpdev_members_correct_count($count){ $excluded_users_count=1; //change it to the number of users you want to exclude return $count-$excluded_users_count; } ?>
August 7, 2013 at 10:02 am #169507August 6, 2013 at 2:55 pm #169454acesParticipantCould your problem be a copy/paste error?
You appear to be using
‘
and’
– they should all be'
August 6, 2013 at 1:51 pm #169446IshannaParticipantHallo @sbrajesh !
I tried use code:
add_action(‘bp_friends_setup_nav’,'bpdev_custom_hide_friends_if_not_self’); function bpdev_custom_hide_friends_if_not_self(){ if(bp_is_my_profile()|| is_super_admin()) return ; bp_core_remove_nav_item(‘friends’); }
I copied and pasted the code into the ‘bp_custom.php’ file but it did not work for me.
I’m new to wordpress, html, php and css but I seem to find my way til now. Some advise please? I really need this option to work and I can’t find a plugin that cover this.Kind regards,
August 3, 2013 at 6:44 pm #169307In reply to: Turning off admin activity in "Activity streams"
acesParticipantJuly 31, 2013 at 6:51 am #169148In reply to: Feature request: Hide certain members
philipstancilParticipantCrazy that we both found this old thread within 12 hours of each other. I got it working with this code:
// Remove admin from directory add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); function bpdev_exclude_users($qs=false,$object=false){ //list of users to exclude $excluded_user='1';//comma separated ids of users whom you want to exclude if($object!='members')//hide for members only return $qs; $args=wp_parse_args($qs); //check if we are listing friends?, do not exclude in this case 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; } //Remove admin from member count add_filter('bp_get_total_member_count','bpdev_members_correct_count'); function bpdev_members_correct_count($count){ $excluded_users_count=1; //change it to the number of users you want to exclude return $count-$excluded_users_count; }
July 25, 2013 at 1:16 pm #168790In reply to: remove admin-bar
Developer ICANParticipantIn the latest BuddyPress – 1.9 – i want to hide the admin bar but keep it for WP site users (editors, admins) that aren’t BP users? Is that possible?
July 23, 2013 at 2:19 pm #168629In reply to: Customize Group Admin subnavigation
David CavinsKeymasterAs a hack I can hide them using css by adding this to my functions.php file:
function hide_group_admin_tabs($classes) { $user_id = bp_loggedin_user_id(); $group_id = bp_get_current_group_id(); if ( bp_is_groups_component() ) { if ( groups_is_user_admin($user_id, $group_id) ) { $classes[] = 'group-member-admin-cap'; } else if ( groups_is_user_mod($user_id, $group_id) ) { $classes[] = 'group-member-mod-cap'; } } return $classes; } add_filter( 'body_class', 'hide_group_admin_tabs', 98 );
And then adding display:none; rules to the tabs. But I would like to handle the navigation the right way (and not with a css hack). Any ideas?
Thanks for your help,
-David
July 9, 2013 at 5:17 am #167792In reply to: How Do I Hide Extended Profile Fileds from Users
nobodymoveParticipant@bphelp. I think I have discovered the culprit to this little mystery.. I have been using the Buddypress Members Import plugin: http://www.youngtechleads.com/buddypress-members-import/
For some reason when I import my database, the plugin does not seem to process the xProfile Field visibility settings properly.. The profile fields are still listed as “Admins Only” But for some reason they are still visible to all users.
Earlier, I manually added some new test profile fields and they worked fine. I also discovered, that if I edit, and re-save a user’s profile field after import, all profile fields for that user will then revert to the proper visibility settings.
I have contacted the plugin author to make him aware of the issue, hopefully he can fix it. If you have any suggestions that might be a quick fix for this I’m all ears! 🙂
July 8, 2013 at 8:57 pm #167767In reply to: How Do I Hide Extended Profile Fileds from Users
nobodymoveParticipant@bphelp. Upon a little further research, I wanted to note that I created a new User Profile Group, created a private field seen by Admins Only in that group, and the settings seem to be working fine in that group. In my Base (Primary) group though, all profile fields still remain visible to all users. Does the Base (Primary) group automatically force all fields visibility public by default? If so, is there way to override?
If there is no way to change the visibility in the Base (Primary), I suppose I can just put private info in the other Profile Group, but I’m curious if or how that may effect my database import..
-
AuthorSearch Results