Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'Hide Admin'

Viewing 25 results - 351 through 375 (of 691 total)
  • Author
    Search Results
  • #174707
    mattg123
    Participant

    @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 accordingly

    #174705
    pjbursnall
    Participant

    Hi 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.

    #174704
    mattg123
    Participant

    @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>

    #174703
    pjbursnall
    Participant

    Hi 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.

    #174702
    mattg123
    Participant

    @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.

    #174519
    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).

    #172349
    robotnjik
    Participant

    I 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.?

    #172035
    martinbeaulne
    Participant

    If i hide the bottom tabs and the admin bar, each user can’t modify their profile.

    #171870
    shanebp
    Moderator

    Re 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_construct

    Re 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.

    #171569
    geoffreysf
    Participant

    Putting 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/

    #171568
    geoffreysf
    Participant

    This helped me immensely while trying to hide the admin user from the member’s directory.

    Thank you!

    #171233
    Ben Hansen
    Participant

    you 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.

    #170759
    therandomguy12345
    Participant

    @philipstancil

    @bphelp

    I 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;
    }
    ?>
    #170721

    In reply to: hide members

    @mercime
    Participant

    @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.

    #169691
    marmuel
    Participant

    Hi 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
    Marco

    #169550
    bp-help
    Participant

    @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;
    }
    ?>
    
    Ishanna
    Participant

    @aces

    Yes! Thank you, it works. 😀

    aces
    Participant

    @ishanna

    Could your problem be a copy/paste error?

    You appear to be using and – they should all be '

    Ishanna
    Participant

    Hallo @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,

    #169307
    aces
    Participant
    #169148
    philipstancil
    Participant

    Crazy 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;
    }
    
    #168790

    In reply to: remove admin-bar

    Developer ICAN
    Participant

    In 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?

    #168629
    David Cavins
    Keymaster

    As 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

    #167792
    nobodymove
    Participant

    @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! 🙂

    #167767
    nobodymove
    Participant

    @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..

Viewing 25 results - 351 through 375 (of 691 total)
Skip to toolbar