Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to make a private community?


  • nipponmonkey
    Member

    @nipponmonkey

    Hi I’m quite new to WP and BP and would like to know the best way to make a private community.

    Basically, I’d like:

    • non members should only see a login/home page with no registration options.
    • non members can not see any posts, usernames or anything else related to the community.
    • all new members can only be created by admin.
    • all logged in members have full posting rights.

    Is this easily achieved? And what’s the simplest approach?

    Cheers

Viewing 25 replies - 1 through 25 (of 104 total)

  • modemlooper
    Moderator

    @modemlooper

    Doa search on here there have been many suggestions.


    hachimaki
    Member

    @hachimaki

    This is realy important, it doesn’t make any sense how it’s buddypress configured if all is public.

    I have been searching also how to make that as we see in the Spanish Social Network “Tuenti” (Tuenti.com)

    I also have been searching how to configure a homepage with different widgets once you’re logged (i use Unplugged Theme by Diesel Laws)

    More help will be much more appreciated.


    pcwriter
    Participant

    @pcwriter

    @hachimaki

    This post from Sarah Gooding should help get you started with widgets:

    http://wpmu.org/how-to-widgetize-a-page-post-header-or-any-other-template-in-wordpress/


    hachimaki
    Member

    @hachimaki

    Thank you pcwriter, it’ss really helpful

    I think you probably have solved my entire problem. I have to read carefully that tutorial, and if i figure out how to do all i think i can be back and solve the problem of @nipponmonkey.

    It Should take me up 3-4 hours, but i promise i’ll be back. I let here some spoilers:

    -If you can Widgetize a page, you can put a login form in a page.

    -If you can put a loging form in a page, without adding it to navigation, you can redirect all not-logged-user to that page, soy they MUST fill the login form before seeing anything.

    Regards form Spain


    hachimaki
    Member

    @hachimaki

    Thank you pcwriter, it’ss really helpful

    I think you probably have solved my entire problem. I have to read carefully that tutorial, and if i figure out how to do all i think i can be back and solve the problem of @nipponmonkey.

    It Should take me up 3-4 hours, but i promise i’ll be back. I let here some spoilers:

    -If you can Widgetize a page, you can put a login form in a page.

    -If you can put a loging form in a page, without adding it to navigation, you can redirect all not-logged-user to that page, soy they MUST fill the login form before seeing anything.

    Regards form Spain


    hachimaki
    Member

    @hachimaki

    Ok, here I am.

    For making buddypress a private commmunity, do the following:

    -Create a new page in the admin interface.

    -Make the page not to show in navigation with one of these: (http://www.kimwoodbridge.com/how-to-exclude-pages-from-the-wordpress-navigation-bar/ ) (https://wordpress.org/extend/plugins/exclude-pages/)

    -Fill the page with HTML (as you wish). If you want Widgets, you can follow this: http://wpmu.org/how-to-widgetize-a-page-post-header-or-any-other-template-in-wordpress/

    -Now, use this in the top of ALL PAGES NOT TO SHOW TO GUESTS: (https://buddypress.org/forums/topic/securing-components-from-non-logged-in-users/page/2)

    if (!is_user_logged_in() ){

    bp_core_redirect( $bp->root_domain.’/register’ );

    }

    AND REDIRECT THEM TO THE PAGE YOU CREATED BEFORE.

    AND THAT’S IT!


    modemlooper
    Moderator

    @modemlooper

    Another easy solution is to use a maintenance mode plugin permanently on. Create your own landing page and in the admin allow access to your registration page.


    r-a-y
    Keymaster

    @r-a-y

    @hachimaki

    Instead of modifying all the BP templates, you could try the Registered Users Only 2 plugin:

    https://wordpress.org/extend/plugins/registered-users-only-2/

    I’ve made a few mods to that plugin to better support BP here:

    https://buddypress.org/forums/topic/bp12-plugin-wishlists#post-42114

    @nipponmonkey

    Use what I suggested above.

    Then turn off registration and manually create users. Assign these users a role of contributor or higher.


    hachimaki
    Member

    @hachimaki

    I have some questions, in the other thread you say that you don’t recommend to ude ur plugin for wid-site.

    I also say that the blogs of the user must be accesible.

    -I have one question, plugin for inviting people to the community with all this privacy stuff on?

    Sorry for my bbas english, im spaniard, ^^

    greetings from spain


    r-a-y
    Keymaster

    @r-a-y

    I haven’t tried my mod site-wide on WPMU because it was only needed on the BP community-side for a site I was working on. If you’re not using WPMU, you should be okay.

    Don’t activate the plugin site-wide if you want your user blogs made public. In this case, only activate the plugin on the blog where BP is activated.

    Re: invites. What are you using for that? The modified plugin doesn’t block the register or activation pages, so if your invites plugin hooks into the register page, you should be fine.


    hachimaki
    Member

    @hachimaki

    The blogs are meant to be public, but no the comunity. So i’ll try with my path, and see what can i do with invitations


    Mike Pratt
    Participant

    @mikepratt

    @r-a-y I am embarrassed to be asking such a simple question:

    re registered-users line ~48 -> bp_core_redirect(bp_get_signup_page());

    What would be the correct way to do the following:

    redirect not_logged_in users to a welcome page.. say domain.com/welcome.php which has a login widget for registered users as well as a Create Account button/link taking you to domain.com/register.php ?

    I tried:

    `$page = $bp->root_domain . ‘/welcome.php’;

    bp_core_redirect($page);`

    but, of course, that led me to redirect Hell.

    Thanks for clarifying.


    r-a-y
    Keymaster

    @r-a-y

    Hi Mike,

    Your code is correct, but since your page isn’t the BP_REGISTER_SLUG or BP_ACTIVATION_SLUG, it will lead you to redirect hell!

    Add your page (and any other page you need to whitelist from blocking) to the following conditional:

    if ( bp_is_register_page() || bp_is_activation_page() || THEWELCOMEPAGE ) //buddypress
    return;

    Change THEWELCOMEPAGE to something that checks if you’re on welcome.php.

    If welcome.php is a WordPress page with the slug of “welcome”, you would use something like:

    is_page('welcome')

    So your conditional would look like:

    if ( bp_is_register_page() || bp_is_activation_page() || is_page('welcome') ) //buddypress
    return;

    Hope that helps!


    Mike Pratt
    Participant

    @mikepratt

    @r-a-y Thank you and may a thousand maidens be blessed upon your doorstep by morning!

    What would be the code to place to redirect the login form action specified by

    <form name="login-form" id="login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login' ) ?>" method="post">

    back to $bp->root_domain?


    r-a-y
    Keymaster

    @r-a-y

    Add this somewhere within your form tag:

    <input type="hidden" name="redirect_to" value="INSERT YOUR URL YOU WANT TO REDIRECT TO" />

    Btw, a thousand maidens is too much, I’d be happy with one nice lass at my doorstep ;)


    Mike Pratt
    Participant

    @mikepratt

    I had to FedEx her. You may have to sign for the delivery. She shouldn’t take too long to inflate ;-)


    Boris
    Participant

    @travel-junkie

    This is what I came up with:

    place the function below into functions.php in your theme folder.

    function sh_walled_garden()
    {
    global $bp;

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

    if( ! bp_is_blog_page() && ! is_user_logged_in() )
    bp_core_redirect( $bp->root_domain .'/'. BP_REGISTER_SLUG );
    }
    add_action( 'walled_garden', 'sh_walled_garden' );

    and this right on top of header.php (before the <!DOCTYPE… parts):

    <?php do_action( 'walled_garden' ) ?>

    The above makes all BP pages private, except the registration and activation pages. It also leaves all blog pages public. It’s a bit easier than editing all theme pages.

    Boris

    Wow! really appreciate it


    r-a-y
    Keymaster

    @r-a-y

    @travel-junkie

    Looks cleaner than the mod I made for Registered Users Only 2 plugin.

    You could probably change the action to “get_header”, then you wouldn’t need to add the “walled_garden” do_action in the header.php.

    it doesn’t work for me, i have paste it where you say and it doesn’t makes any difference, i can see my activity page (homepage) without logging in. :(

    If you could make a more-improved post… i suppose i have paste it right, but…

    travel Junkie,

    I also follow your posting but it still shown the activity stream…


    Boris
    Participant

    @travel-junkie

    @r-a-y

    cheers! didn’t even think of the get_header action. even cleanerer…

    @hachimaki and @marioe,

    well, don’t know why it’s not working for you guys, works perfectly for me… maybe you did paste something wrong. try just this in functions.php:

    function sh_walled_garden()
    {
    global $bp;

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

    if( ! bp_is_blog_page() && ! is_user_logged_in() )
    bp_core_redirect( $bp->root_domain .'/'. BP_REGISTER_SLUG );
    }
    add_action( 'get_header', 'sh_walled_garden' );

    You can delete the walled_garden action call in header.php

    Still not working. I have pasted the new code in functions.php in the buddypress child theme (i use unplugged theme wich uses the bp-default files).

    I pasted it at the first line= not working

    I pasted it with the */Private Community*/ and the code below= not working

    It doesn’t works, i dunno why.


    Boris
    Participant

    @travel-junkie

    hmm, weird. maybe it’s a child theme thing. i use it on a parent theme. shouldn’t be a problem, though.

    I pasted it at the first line= not working
    I pasted it with the */Private Community*/ and the code below= not working

    i didn’t get these two lines at all. with the second method, there’s no need to put anything on the first line of header.php.

Viewing 25 replies - 1 through 25 (of 104 total)
  • The topic ‘How to make a private community?’ is closed to new replies.
Skip to toolbar