Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'hide admin in directory'

Viewing 25 results - 51 through 75 (of 78 total)
  • Author
    Search Results
  • #171568
    geoffreysf
    Participant

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

    Thank you!

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

    #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;
    }
    ?>
    
    #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;
    }
    
    #139169
    Arrogance is Bliss
    Participant

    Interesting ‘plugin’ that GRA4.. it is a connection to their website. A little more than phoning home. Your members get included into their website. Wherever their ‘plugin’ is activated, all the members show up on all the other websites. They have a plugin for oscommerce, phpbb and wordpress and they are working on a plugin for drupal. All members are gathered to their website and you have NO admin privileges. You have NO control over the content on the website and I don’t know for sure, but I think there could be some major security (and privacy) concerns for all of your website members.

    They don’t tell you straight out that you aren’t adding functionality to your WordPress website, they are providing a portal to their website, which shows up on your website making it appear like it’s your website. Quite crafty. – A FACADE-

    They are using ‘elgg’ social software on their server. They authenticate using cookies and they secretly provide your website with a ‘secret key’ and their coding changes the .htaccess rewrites for your website to redirect your members to their website. The page they tell you to add, is the same name as the directory of their plugin and the rewrite for permalinks makes it appear that your members are looking at a page, but they are looking at another website. The shortcode they tell you to put on the page you create for their plugin calls the function that imports the data from their website to display on that page. So, basically.. it’s an interface with their website gra4.com. Their website shows up on an ip address in the United States, but they are Russian (no prejudice, just an observation), to share the information. Part of their coding calls a another website virturossiya.org/c (which shows up as ‘GRA4SetConfigValue(‘GRA4_remote_url’… in one of the files. That website also shows up on an ip in the USA, but the page title is in Russian and the favicon is a red star. (looking at that last domain name I can see ‘virtual russia’).

    In conclusion, from my perspective, it’s a scam. You do NOT get your own social network with their ‘plugin’, you get to include your members into their website, without your members knowing it.. I don’t think that would be consistent with the spirit of WordPress or BuddyPress. I would stick with BuddyPress or one of the other true WordPress plugins that provide social networking within WordPress, unless you want to find yourself answering questions you have no answer for sometime in the future.. Let alone the risk of your own website and hosting information somehow being hacked. The concern I have is, if they are being honest, why hide all of this from WordPress users of their plugin? With their obvious ability to rewrite and redirect, who knows (really) where your website and member information is going?

    If they do get back into the WordPress Repository, I would really be careful of these people. Always check to see if a plugin requires a connection with remote servers before you consider using a plugin.

    kraigg
    Participant

    Can anyone help me?

    I’m trying to filter the activity stream so that it only displays ‘published’ forum topics and replies.

    I’m using bbPressModeration, which marks all forum topics and posts as ‘pending’, until the administrator approves and publishes the content. The problem is that pending content still appears in the activity stream.

    I’m using the code below for my custom activity stream.

    `
    <?php

    /* = Generate Custom Activity Stream


    * Place this function anywhere you want to show your custom stream.
    * Should accept any of these parameters:
    * https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/
    */

    my_activity_stream(‘per_page=4&page=1&action=new_forum_post,new_blog_comment,new_blog_post,new_forum_topic’);

    /* = Custom Activity Stream


    * Place this function in bp-custom.php (in your plugins directory)
    */
    function my_activity_stream($args ) {

    if ( bp_has_activities($args) ) : ?>

      <li class="” id=”activity-“>

      <a href="”>

    <?php endif;

    wp_reset_query();

    }
    `

    #135512
    oblax
    Participant

    Thanks. I saw it in members php page exclude admin mods should be set to 1.

    #135334
    @mercime
    Participant

    If you have a bp-default child theme, copy group-header.php file.into your child theme folder as in wp-content/themes/yourchildtheme/groups/single/group-header.php
    then delete lines 11-15 of said file. If you also want to delete Group Mods, then delete lines 7-30

    #128781
    @mercime
    Participant

    You mean you don’t want the Admin to be included in the list of members in members directory?

    angslycke
    Participant

    Excellent piece of information! Could prove to be really useful for me as well to hide administrators.

    MRSepehr
    Member

    Hello everyone,

    Add the codes below to your theme’s function.php file :

    add_action(‘admin_head’, ‘adminbarhide’);
    function adminbarhide() {
    define(‘BP_DISABLE_ADMIN_BAR’, true);
    }

    then go to wp-content/your-theme-directory/_inc/css/adminbar.css and change “padding-top: 25px” on second line to “padding-top: 0px” ,
    this code will remove admin bar only from your dashboard, and css code will hide white space after removing admin bar.

    after all I’m sorry about my bad English if there was some wrong spelling.

    #111964
    chrisreg1
    Member

    Hmm unfortunately, that still did not work. Thanks for all your help thus far guys. Here is how my problem originated:

    I recently transferred my site from the default ”/wordpress/” sub directory to my root directory. Everything works fine in BuddyPress except for the LOGOUT and LOGIN menu options from the BuddyPress menu bar (up at the top).

    Upon looking at the URL that the logout and login tries to redirect to (in the tag), it still thinks it is in the ”/wordpress” subdirectory and the thus results in a Error 404 – Page Not Found problem.

    I’ve search various ways to do this but people have either not have found a solution or seem to not have posted it. I originally thought I could just use the ‘Add All Nav Links to Admin Bar’ plugin (https://buddypress.org/community/groups/add-all-nav-links-to-bp-adminbar/) and hide the Login and Sign Up options but unfortunately the “Log Out” still remains since it is under the ‘My Account’.

    Any help would be much appreciated, thanks.

    #102176

    In reply to: Hide Directory

    James
    Participant

    ok, core developer doesn’t know this line (?) :)

    `remove_action(‘bp_adminbar_menus’, ‘bp_adminbar_blogs_menu’, 6);`

    for those, who needs, it will hide “my blogs” and account-“blogs” from admin bar.
    last stop – blogs in navigation, who will help?

    #102170

    In reply to: Hide Directory

    James
    Participant

    @DJPaul

    huge step forward, thanks, blogs directory disappeared…but, my blogs in admin bar and blogs in navigation still here.

    #95733

    In reply to: No register button ?

    gillm
    Member

    I have this problem too. However, I can’t see where to set-up user registration in the BP admin section – these are the options I have under General Settings –

    Disable BuddyPress to WordPress profile syncing?: Yes No
    Hide admin bar for logged out users?: Yes No
    Disable avatar uploads? (Gravatars will still work): Yes No
    Disable user account deletion?: Yes No
    Disable global forum directory?: Yes No
    Disable activity stream commenting on blog and forum posts?:

    #90525
    pcwriter
    Participant

    .You could also try my plugin (he says with shameless self-promoting grin).

    See this post for the latest beta version: https://buddypress.org/community/groups/add-all-nav-links-to-bp-adminbar/forum/topic/updated-the-beta/
    Here are the user configuration options available in the admin panel under “Settings” > “BP-WP-Navbar”
    – Hide or display the main theme navigation
    – Hide or display the site name in your new adminbar
    – Hide or display the Login and Signup links in the adminbar
    – Hide or display the “Visit Random” menu
    – Select whether to display top-level WordPress pages horizontally or in a dropdown menu
    – Define the label for the dropdown in WordPress 2.x
    – If you’re running WP3.x, the plugin will fetch whatever custom menu labels you assign and display them in the admin bar along with all child pages in dropdowns
    – Define the label for the Buddypress directory dropdown (default = “Community”)
    – Define the font, font-weight and font-style for all menu items
    – Define ALL colors: navbar background, main and sub menu item backgrounds, border, text and hover colors too
    – Set the overall width of the navbar and of sub-menus
    – Set the height of all menu items
    – Adjust margins where required
    – Reposition your fancy new custom navbar anywhere you like, relative to your theme so it scrolls with your pages

    If you add categories to your custom menus in WP3.x, the plugin will pick them up and display them in whichever menus they are assigned to. Give it a whirl.

    Vera Schafer
    Participant

    I was having a hard time trying to find the .htaccess file on my iMac, until I figured out that it is a hidden file (I’m working on MAMP Pro). If that is your case (Mac) , you have to unhide it.

    #80952
    @mercime
    Participant

    @themeanwhile – you can enable or disable the various components so if you want Activities only, enable that and disable other components. After you activate BuddyPress, go to the new BuddyPress menu item on the left column of dashboard, and go to

    a) General Settings – these are your choices
    Base profile group name:
    Full Name field name:
    Disable BuddyPress to WordPress profile syncing?: Yes No
    Hide admin bar for logged out users?: Yes No
    Disable avatar uploads? (Gravatars will still work): Yes No
    Disable user account deletion?: Yes No
    Disable global forum directory?: Yes No
    Disable activity stream commenting on blog and forum posts?: Yes No
    Default User Avatar – For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address

    b) Component Setup
    Activity Streams – Allow users to post activity updates and track all activity across the entire site.
    Enabled Disabled
    Blog Tracking – Tracks blogs, blog posts and blogs comments for a user across a WPMU installation.
    Enabled Disabled
    bbPress Forums – Activates bbPress forum support within BuddyPress groups or any other custom component.
    Enabled Disabled
    Friends – Allows the creation of friend connections between users.
    Enabled Disabled
    Groups – Let users create, join and participate in groups.
    Enabled Disabled
    Private Messaging – Let users send private messages to one another. Site admins can also send site-wide notices.
    Enabled Disabled
    Extended Profiles – Activates customizable profiles and avatars for site users.
    Enabled Disabled

    I would suggest you set up a test install so you can check the features for yourself.

    “Of course, activity filters, profile page, friends page, settings page, etc, would also need to be migrated to display in the backend.”
    Why? If you want to make the BP Activity section private, you can add conditional tags for is_user_logged_in …

    drifter0658
    Member

    If you rename it now ( usually rename it/ wp-content/plugins1) that will hide access to the plugins from the admin portion of your site. You would then be able to get to your site’s admin panel. Once you log in and reach your admin panel, rename the plugins directory back to /wp-content/plugins.

    The problem is most likely with the last plugin you activated.

    #80665

    In reply to: Hide Admin

    Mark
    Participant

    Socialpreneur has a nice snippet here that makes it easy to hide the admin from the members list assuming you know the admin’s login name.

    Place this in your bp-custom.php:


    function my_bp_member_user_login() {
    echo my_bp_get_member_user_login();
    }
    function my_bp_get_member_user_login() {
    global $members_template;
    return apply_filters( 'my_bp_get_member_user_login', $members_template->member->user_login );
    }

    Then in your members-loop.php file, place this just below the while statement (wrapped in php tags!):
    if ( my_bp_get_member_user_login() == 'admin' ) continue ;

    (Supposing your admin’s login is ‘admin’.)

    lee_vhoi_ol
    Member

    Thanks for the reply, I just went into my wp-admin panel and on to Buddypress>General Settings but I do not find any Membership box. Here are the choices available:

    Disable BuddyPress to WordPress profile syncing?: Yes No
    Hide admin bar for logged out users?: Yes No
    Disable avatar uploads? (Gravatars will still work): Yes No
    Disable user account deletion?: Yes No
    Disable global forum directory?: Yes No
    Disable activity stream commenting on blog and forum posts?: Yes No
    Default User Avatar

    I also tried the other sections under Buddypress, and they don’t seem to be there. Am I missing anything?

    Thanks

    #75710

    In reply to: Hide Admin

    Paul Wong-Gibbs
    Keymaster

    @scotm what are you doing on your BP site with the admin user to generate activity which you don’t want in the activity stream?

    @nuprn1 did you do a plugin to hide the admin account from the members directory, or was that someone else?

    snark
    Participant

    I found this code that can be wrapped around anything to hide it from everyone but administrators or ediors:

    <?php if ( current_user_can( ‘delete_others_posts’ ) ) { //only admins and editors can see this ?>

    (Items to be hidden here)

    <?php } ?>

    To make it work specifically for hiding that “Create a Group” button, I made a new version of the default template’s groups –> index.php file in my child theme, replacing this:

    <h3><?php _e( ‘Groups Directory’, ‘buddypress’ ) ?><?php if ( is_user_logged_in() ) : ?>  “><?php _e( ‘Create a Group’, ‘buddypress’ ) ?><?php endif; ?></h3>

    With this:

    <h3><?php _e( ‘Groups Directory’, ‘buddypress’ ) ?><?php if ( current_user_can( ‘delete_others_posts’ ) ) : //only admins and editors can see this ?>  “><?php _e( ‘Create a Group’, ‘buddypress’ ) ?><?php endif; ?></h3>

    It worked like a charm! Now only Admins and Editors can create groups on my site.

    21cdb
    Participant

    Great work! I haven’t had the time for a detailed test, but i have some short feadback for the beginning:

    1. Everything works fine and seems logical. Thats great. There could be some front-end twaeks, but i will come back later next week with some more detailed ideas and mockups.

    2. From our experience it is great to have advanced edit functions but hide them in a second row from the avarage user (like the wordpress backend editor does). For a wiki article the user (students) should focus on the content instead of any fancy formating. Basic options could be a select-box for h1, h2, h3 (this is important and must be easy accessible, because it will build the toc and people should get used to it) bold, italic, url link, unordered list, and numberd list. Everything else could go in a second or third row which appears if you click some “advanced options” button.

    3. (future release) A searchable wiki directory page with all public pages.

    4. (future release) “Suggest a wiki page” button so that non admin-members could ask the admin to create a new wiki page for them.

    5. (future release) non-admin wiki page creation

Viewing 25 results - 51 through 75 (of 78 total)
Skip to toolbar