Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to make a private community?

  • Avatar of nipponmonkey
    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 - 51 through 75 (of 104 total)
  • Avatar of Valentin Kukov
    Valentin Kukov
    Participant

    @valkukov

    hi everyone, sorry to be a pain in the a** but I was wondering whether anyone could write a summary post stating the cleanest simplest way to achieve a private network (including where to paste the statements and in which files). Sounds like @Travel-Junkie has the winning ticket but a lot of amendments/improvements have been made. Can anyone help? TX

    Avatar of Valentin Kukov
    Valentin Kukov
    Participant

    @valkukov

    Please ignore my last post.

    @Travel-Junkie It works a treat. Thanks very much. Just added the code below within the php tags in my active theme’s functions.php file (…/wp-content/themes/XXXXXX/functions.php) and that was all I had to do. Very nice indeed. Now the site is only visible to logged in users (except for blog posts which are visible to everyone)

    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’ );

    Avatar of Valentin Kukov
    Valentin Kukov
    Participant

    @valkukov

    PS. This only seemed to work for me using ftp to upload my theme with the above script inserted into the functions.php file already.

    NB watch out when you copy the code from this forum as it can alter the script in places

    Avatar of holyphoenix
    holyphoenix
    Participant

    @holyphoenix

    There are tons of different code edits in here. I am wondering which I should use for buddypress with multisite wordpress 3.0 and where to put it. I made my own bp-custom.php file, but it doesn’t seem to work. Is this file suppose to exist already? And if so it didn’t appear on my installation. :p At least not in the path wp-content/.

    Thanks for your help.

    Avatar of Pisanojm
    Pisanojm
    Participant

    @pisanojm

    @r-a-y @Travel-Junkie

    Ok, I’m still dorking around with this… the goal is to have my site a register only site. When people go to musicpln.org they will be redirected to the landing page (http://musicpln.org/landing1) which is a BP page with a login widget. I also would like the feeds to not be blocked.

    This code goes in the function.php file:

    function sh_walled_garden()
    {
    global $bp;

    if( bp_is_register_page() || bp_is_activation_page() ||is_feed() || is_page(‘landing1′) )
    // Where landing1 is the page slug of where I would like to redirect
    return;

    if( ! is_user_logged_in() )
    bp_core_redirect( $bp->root_domain .’/’. BP_REGISTER_SLUG );
    // my activity page is the “homepage” and I don’t want to show any BLOG(s)
    }

    add_action( ‘get_header’, ‘sh_walled_garden’ );

    I would like this to redirect to the landing1 reference above (which includes the login widget) The url is http://musicpln.org/landing1

    I saw that you put this code in a previous reply…

    Where can I put this to make it redirect to the LoginPage above? How can I tie this altogether now?

    Avatar of Pisanojm
    Pisanojm
    Participant

    @pisanojm

    Hello BP gurus,
    Just checking to see if any of you have any code examples for my privacy problem above… I would love to get this to work tomorrow before my launch… re: private community & redirect to different page for login (with login widget).

    Avatar of Pisanojm
    Pisanojm
    Participant

    @pisanojm

    Ok, spending evern more time on this… I went back to the idea of using @r-a-y ‘s modified regestered-users-only-plugin… Now it is 95% the way I want except the homepage is not re-directing to the landing page… every other page does this…. probably has something to do with the home page being the activity stream??? I’m copying the key changes I have done to the plugin below:

    // This is a base array of pages that will be EXCLUDED from being blocked

    if ($bp&&($bp->current_component == BP_REGISTER_SLUG ))//buddypress
    return;

    if ( bp_is_register_page() || bp_is_activation_page() || is_feed() ||is_page(‘landing’) ) //buddypress)
    return;

    $this->exclusions = array(
    ‘wp-login.php’,
    ‘wp-signup.php’,
    ‘wp-register.php’,
    ‘wp-activate.php’,
    ‘wp-cron.php’, // Just incase
    ‘wp-trackback.php’,
    ‘wp-app.php’,
    ‘xmlrpc.php’,
    );

    // If the current script name is in the exclusion list, abort
    if ( in_array( basename($_SERVER), apply_filters( ‘registered-users-only_exclusions’, $this->exclusions) ) ) return;

    // Still here? Okay, then redirect to the login form
    bp_core_redirect( ‘http://musicpln.org/pln-posts/landing/’ );

    Avatar of Pisanojm
    Pisanojm
    Participant

    @pisanojm

    Good News… I think I figured out the above, all though I still don’t know why I had to add it…

    I added this:

    if ( is_front_page () )
    bp_core_redirect( ‘http://musicpln.org/pln-posts/landing/’ );

    above

    if ($bp&&($bp->current_component == BP_REGISTER_SLUG ))//buddypress
    return;

    and now it all works like a charm… I’m sure somebody can make this look cleaner that I did, but it is effectivley working now…

    Avatar of linusf
    linusf
    Participant

    @linusf

    @r-a-y, @Travel-Junkie I replaced Ray’s original code with Travel-Junkies as it was favoured by the majority. However I´m using a lot of pages and Travel-Junkies solution is only blocking the core Bp functions. In addition Ray’s post is no longer present. What do I need to add to block all of my pages for non registered users? where can I find Rays original code?

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    @linusf – Read the other solution Travel Junkie posted:
    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-make-a-private-community/?topic_page=3&num=15#post-44729

    This will block everything but the register and activation pages.

    Hello , i am using the RANDY CANDY theme and it has no “functions.php” file.
    Anyway , i paste the code that Travel_Junkie gave in “fuctions.php” file
    that is located is “/bp-themes/bp-default” folder , but still I see no change.

    Please help , I am desperate… Sorry for the bad English , I am Greek.

    Avatar of Tyler
    Tyler
    Participant

    @typete

    How do I redirect to the wordpress login page and not the buddypress registration page? I want to create all the user accounts myself and prevent random people registering for my site. Thanks!

    Avatar of Lsm_267
    Lsm_267
    Participant

    @lsm_267

    Hi,
    I modified my functions.php as @Travel-Junkie said. It works perfectly on my WP 3.0.1. but I want to go a little further.
    I want the member home page only to be visible for the admin and for the registered member, not the others members of the BP.
    for exemple, the http://mysite.com/members/angora/ should be visible only for the logged in user named angora
    I’ve heard about bp_is_home, but no idea how to deal with…
    Any idea would be helpfull ; thanks in advance

    Avatar of marioe
    marioe
    Member

    @marioe

    @travel-junkie Method worked for me with 2.9.2, I just upgraded to 3.0.1 and now is not working. anyone experiencing the same?

    Avatar of Beck B
    Beck B
    Participant

    @beckb

    @meetsos, if you haven’t solved the problem yet:
    I believe you should be able to create a functions.php file in the Randy Candy theme. (Or go one better and create your own child theme based on Randy Candy, so you can benefit from published updates without losing your modifications.)

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @Travel-Junkie, I’m totally new to this but I want a page to show signup page for outsidders and show user’s bp-profile page for logged in users. How to do this, please?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Jenny that’s what Travel_junkies code does (at least the first part of your request); have you tried it? Are you having specific issues with it?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Jenny a search of the forum turns up this thread, (always worth a quick search to see what’s been covered )

    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/being-re-directed-to-your-profile-page-after-login/

    Give the plugin listed in the last post a go and see if it works for you, and just acknowledge back whether it worked for you

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @hnla, thanks for helping! This plugin doesn’t provide the function of redirecting to a welcom page for outsiders, but following the path, I found another plugin “Redirects” which allow for pointing a target page for outsider users. Many thanks!

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Travel_junkies code redirects logged out users to the main sign up page which is what I thought you were asking for, it can easily be configured to allow main directory pages to be viewed, but nothing deeper, or I guess to redirect to another page of choice, it’s not a plugin per se it’s the core function and would run from a file such as bp-custom.php it could be turned into a plugin quite easily though as a plugin at basic level is simply a convenient on/off switch. If ‘Redirects’ works for then that’s fine, iot’s not one I’ve run across before.

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @hnla, logically, I can see his code leads to several posibilities, but coding is really an alien’s job for me :-)
    Since I got the plugin, I still need you help me figure out one critical answer– What’s the URL for a logged in user’s Profile?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Jenny that plugin you found ‘redirects’ is this a BP plugin? if not then use the one I linked to which is custom coded to work for BP (can’t vouch whether it’s currently compatible with latest releases)

    At the end of the day I think you are looking for one plugin to cover two different jobs which may prove problematical.
    Possibly you need to use your ‘redirects’ if that works satisfactorily with BP AND the other plugin to provide the actual logged in redirect to profile pages.

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @hnla, let me try if my understanding about the codes are correct or not:
    BP Redirect to Profile = force user to go profile page on log in. It’s not what I want to achive;
    Travel-Junkie’s code = Make all BP communit not accessable for outsiders, they can only access blog page. It’s not what I want;

    This is what I want: I have an Introduction page for outsiders. I name is “MySpace”. When logged in user click it, it goes to his/her profile. When outsiders click it, it shows the Introduction page and suggest him/her to signup.

    Now I see the “Redirects” not working because I need a dynamic URL(depends on user status) as the target URL.

    What to do?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    That sounds like you actually need a custom front page, but what do mean by ‘click it’ that’s a rather loose term click what?

    Why does that page not simply have the text/content you want with a simple link to the registration page and also a simple login, registered users will login and be directed to their profile page by the plugin mentioned earlier. What you do with the main site home link is another question, suppose it’s possible to have that custom frontpage display your intro page to all logged out users and once logged in if a member navigates back to that page it will display ? activity loop / main site blog posts

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @hnla, I said “Click it” because it’s on the blog’s main navigation menu. If a visitor click this menu, it will go to the Introduction page.

    What you said is exactly what I want— “simply have the text/content you want with a simple link to the registration page and also a simple login, registered users will login and be directed to their profile pag”, but the plugin you mentioned does not perform like this. It works on the action of a user log in(click the log in page) and then redirect.

Viewing 25 replies - 51 through 75 (of 104 total)

You must be logged in to reply to this topic.