Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How do I make Buddypress 1.6 a private community ?

  • @sefi

    Member

    Hi guys,

    my client wants his Buddypress community private, how can I do that ?

    I’d live the activity, members, groups pages to be hidden for non logged-in users.

    Regards,
    SeFi

Viewing 19 replies - 1 through 19 (of 19 total)
  • You can used my child theme its only for the BP-Default theme it adds this functionality.
    http://ezwebdesign.wordpress.com/free-stuff/

    @boonebgorges

    Keymaster

    WPMU.org recently had a nice writeup on something similar: http://wpmu.org/how-to-build-a-facebook-style-members-only-wordpress-buddypress-site/

    @sefi

    Member

    @shawn38 Thanks but I’m already using a theme for my client and I can’t change it…

    @BooneGorges As for shawn38 I’m already using a theme and I’m not a really good programmer so what you’re refering to is to difficult for me :(

    Can’t I find a plugin to do that ? No one ever thought of doing it ?

    Thanks a lot guys !

    @aces

    Participant

    You could create an empty text file called /wp-content/plugins/walled-garden.php, paste the following into it, then activate the plugin:
    `
    <?php
    /*
    Plugin Name: Buddypress Walled Garden
    Plugin URI: http://www.example.com/
    Description: A brief description of the Plugin.
    Version: 0.1
    Author: http://www.example.com/
    Author URI: http://www.example.com/
    License: A “Slug” license name e.g. GPL2
    */

    function sh_walled_garden()
    {
    global $bp;

    // if( bp_is_register_page() || bp_is_activation_page() || bp_is_page( BP_FORUMS_SLUG ) || bp_is_page( BP_GROUPS_SLUG ) )

    if( bp_is_register_page() || bp_is_activation_page() || bp_is_page( BP_FORUMS_SLUG ) )
    return;

    if( ! bp_is_blog_page() && ! is_user_logged_in() )

    bp_core_redirect( bp_get_signup_page() );
    }

    add_action( ‘bp_init’, ‘sh_walled_garden’ );

    function bp_remove_feeds() {
    remove_action( ‘bp_actions’, ‘bp_activity_action_sitewide_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_personal_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_friends_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_my_groups_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_mentions_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_favorites_feed’, 3 );
    remove_action( ‘groups_action_group_feed’, ‘groups_action_group_feed’, 3 );
    }
    add_action(‘init’, ‘bp_remove_feeds’);

    ?>`
    Tested in bp 1.6.1

    The plugin should not have spaces, blank lines, or anything else before “ and use a simple text editor ( like this ) rather than a wordprocessor….

    – – –

    To have a different menu for logged in users is slightly more complicated.

    You need to find the template bit that shows the menu.

    In the current bp-default theme header.php file is the following
    `
    false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ‘bp_dtheme_main_nav’ ) ); ?>
    `
    which can be replaced by
    `
    <?php
    if ( is_user_logged_in() ) {
    wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ” ) );
    } else {
    wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘secondary-menu’, ‘fallback_cb’ => ” ) );
    }
    ?>
    `
    Then create the secondary menu in the wordpress menu admin…..

    Please backup files and database before trying this out in case there are complications. It would be better to try out on a test/dev site first …..

    @philippmuenchen

    Participant

    I use this PlugIn: http://bp-tutorials.de/2010/09/private-buddypress

    It’s not updated since a long time but it still works fine for me…

    @dainismichel

    Participant

    huh, i just tried the “private buddypress” plugin — using the latest WP BP for nov 2 2012 (plz lookup the versions if you need to), and the plugin works just fine.

    i am quite grateful to the creator of the private buddypress plugin. it does everything i need it to do.

    life’s hard enough as it is — when you catch a “break” like this with code that works as promised without hassles and even without payment — you just really have to say thanks.

    thanks to dennis at: https://profiles.wordpress.org/GIGALinux/ seriously — thanks!

    @binutz

    Participant

    “WordPress Access Control” plugin can be of some help in hiding the pages from non-registered users..

    @fpats

    Participant

    Looks like the perfect plugin but as usual on our BP installation, this doesn’t work.
    Have installed it but there’s no tab added to our settings panel so it can’t be configured 🙁

    I’m not sure what i’ve done but FFS, the gods must really hate us.

    @aces

    Participant

    If you are going to resurect such an ancient page I would like to note that the upgrades to buddypress.org have messed up the code in my original post:
    `
    /*
    Plugin Name: Walled Garden
    Plugin URI: http://www.example.com/
    Description: A brief description of the Plugin.
    Version: 0.1
    Author: http://www.example.com/
    Author URI: http://www.example.com/
    License: A “Slug” license name e.g. GPL2
    */

    function sh_walled_garden()
    {
    global $bp;

    // if( bp_is_register_page() || bp_is_activation_page() || bp_is_page( BP_FORUMS_SLUG ) || bp_is_page( BP_GROUPS_SLUG ) )

    if( bp_is_register_page() || bp_is_activation_page() || bp_is_page( BP_FORUMS_SLUG ) )
    return;

    if( ! bp_is_blog_page() && ! is_user_logged_in() )

    bp_core_redirect( bp_get_signup_page() );
    }

    add_action( ‘bp_init’, ‘sh_walled_garden’ );

    function bp_remove_feeds() {
    remove_action( ‘bp_actions’, ‘bp_activity_action_sitewide_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_personal_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_friends_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_my_groups_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_mentions_feed’, 3 );
    remove_action( ‘bp_actions’, ‘bp_activity_action_favorites_feed’, 3 );
    remove_action( ‘groups_action_group_feed’, ‘groups_action_group_feed’, 3 );
    }
    add_action(‘init’, ‘bp_remove_feeds’);
    `

    ` false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ‘bp_dtheme_main_nav’ ) );`

    `if ( is_user_logged_in() ) {
    wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ” ) );
    } else
    wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘secondary-menu’, ‘fallback_cb’ => ” ) );
    }`

    Opening and closing php ( where appropriate ) tags have been removed due to buddypress.org’s issues with those tags….

    Still works for me with bp v 1.7 using ‘legacy forums’.

    @bphelp

    Participant

    @fpats

    Participant

    Not seen that before @bphelp thanks!
    Looks like i’m now staying up another hour.

    @espellcaste

    Moderator

    Here goes another plugin that does exactly what you want.

    https://wordpress.org/extend/plugins/private-buddypress/

    @fpats

    Participant

    Neither work i’m afraid, not for us anyway.

    I’ve activated private community but can still access BP when not logged in.
    I’ve activated private buddypress but no tab is added to our settings page so it can’t be configured.

    Someone please shoot me.

    thanks anyway, i’ll keep trying.

    @bphelp

    Participant

    @fpats
    Have you considered maybe its your theme overriding the functions of both these plugins? What theme are you using?

    @fpats

    Participant

    Very possibly but i’m not skilled enough to check, i have limited experience in all this so have to rely on plugins.

    It’s this theme > maestro

    I’ll keep trying anyway, there’s membership/role plugins i can try i guess.

    @bphelp

    Participant

    @fpats
    Okay but if its the theme and you invest a lot of time testing plugins and none of them work because of the theme then your back at square one. I suggest activating the bp-default theme, then activating the private community plugin, then log out and click the nav links to see if the problem persists. It only takes maybe 2 minutes to check.

    @fpats

    Participant

    Done, thanks.
    Yes it’s the theme as private community works with default BP.

    Not really sure how that helps me though. I’ve gone through 6-7 premium themes now trying to get BP to work how it should and 3 of those are since BP1.7 was launched with it’s claims of working with any theme (it blatantly doesn’t).

    I think i’m just going to give up with it before i have a breakdown to be honest.

    @bphelp

    Participant

    BuddyPress 1.7 does work with most themes providing they have standard wordpress template structures. There really is no way I see for BP to be compatible with every template scheme out there. There is plenty of free themes on wordpress.org that work fine with BP.

    @mercime

    Participant

    claims of working with any theme


    @fpats
    I’ve seen reports where there are themes from themeforest which have failed the easiest route to BP Theme Compatibility enjoyed by almost all WordPress themes. Many possibilities to theme failure. Let’s take a look at what could be causing the failure in your theme and find the best alternative route provided by BP Theme Compat to make it work.

    Start a new topic here with your theme name and Theme Compat as title. Copy the source code of your theme’s page.php file, post the code in pastebin.com and post the generated pastebin URI in your topic. BP Theme Compat has alternative methods of making it work, here alone or with the theme author’s participation.

Viewing 19 replies - 1 through 19 (of 19 total)
  • The topic ‘[Resolved] How do I make Buddypress 1.6 a private community ?’ is closed to new replies.
Skip to toolbar