Support » Plugin: BuddyPress Private Community » [Plugin: BuddyPress Private Community] Can't get custom config to work :(

Viewing 15 replies - 1 through 15 (of 26 total)
  • Plugin Author NipponMonkey

    (@nipponmonkey)

    There shouldn’t be ‘{‘ or ‘}’ in the config file! So you must be doing something wrong.

    But first, did the plugin work when you first activated it? It should restrict logged out users to the homepage of your community.

    If that’s working you can then try adding your own custom config file, to add a valid config file you must create a new folder and file, it MUST saved as:

    /wp-content/plugins/buddypress-private-community-config/mm-buddypress-private-community-config.php

    Note the “-config” parts at the end of the new directory you must create and at the end of the php file.

    Here are the settings you can currently change – no ‘}’s!

    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array('/contacts', '/about', '/welcome', '/welcome/*', '/welcome?*');
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL = site_url() . '/welcome';
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_HOOK	= 'my_redir_to';
    //MM_BUDDYPRESS_PRIVATE_COMMUNITY::$BLOCK_RSS_FEEDS = FALSE;
    //MM_BUDDYPRESS_PRIVATE_COMMUNITY::$BLOCK_WIDGETS = FALSE;

    Let me know if you get it working – I have no idea where your error is coming from as I can’t see how the plugin could be causing it.

    All I did before was add my uri’s into the list but I received that error. (I never added an any }’s.)

    So I just redid the same thing with the new example after I upgraded the plugin and it works brilliantly now. 🙂

    I have no idea what I did as I swear I did not change anything, lol. But it’s working now. 🙂

    It’s genius – thanks so much!

    The page loading does seem to take a bit longer… do you know if there’s any way to speed up the process?

    Thanks and best wishes,
    Kristen

    Plugin Author NipponMonkey

    (@nipponmonkey)

    Glad you got it workin’.

    Where are you experiencing slow page loads?

    When you’re logged in, you shouldn’t notice any difference really. All it does is add a few simple checks.

    When you’re logged out and the user tries to access a private page, then the page can take a little longer to load because of the redirect. There isn’t much I can do to speed up the redirect though.

    The only thing that could slow down the page loads is the add_action() calls – I’m not an expert on this, but I don’t think they would slow down your site much at all.

    Often it’s calls to the database that slow things down, but this plugin doesn’t store any data in the database – so it should be quick.

    Personally, I haven’t notice any difference on my site unless I’m accessing a private page and I get redirected.

    Thanks!

    Gosh you respond quickly. Yeah, it’s the redirected pages that seem a bit slow but definitely not a big deal compared to how awesome your plugin works.

    Thanks so much again – you rock! 🙂

    Best wishes,
    Kristen

    Hi,

    Thank you very much for this useful plugin !
    However, the modification that I have made in ‘mm-buddypress-private-community-config.php’ doesn’t work : non-logged users can only see the homepage.
    – This file is in the folder “buddypress-private-community-config”
    – All my plugins are disabled (except buddypress, of course)
    – These are my modifications :

    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array('/contact', '/archives', '/a-propos',);
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL = site_url() . '/a-propos';
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_HOOK	= 'redirection';

    Do you know how to fix this problem ?
    Best wishes,
    Mat

    Plugin Author NipponMonkey

    (@nipponmonkey)

    You might like to change this:

    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array('/contact', '/archives', '/a-propos',);
    
    //to
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array('/contact', '/archives', '/a-propos');

    Also, it sounds like your config file isn’t loading as restriction to the homepage is the default settings.

    When you try to access a private page, do you see your custom redirect in the URL, ‘?redirection=/some-private-uri’?

    If you don’t then the config file isn’t being loaded.

    Remember, the config folder shouldn’t be in the buddypress-private-community folder, it should be in the wp-content/plugins/ folder.

    This is to make sure your settings aren’t deleted when you update the plugin in the future.

    Hi NipponMonkey,

    Thank you so much for your quick response, I really appreciate that.
    It seems to work now ! Thank you very much !

    Best wishes,
    Mat

    Hallo NipponMonkey very great work,
    but how i can use the register.php? in the REDIRECT_TO_URL = site_url()

    Plugin Author NipponMonkey

    (@nipponmonkey)

    @adal,

    I’m not sure what you mean, but this is how you can allow non-members to register to your private community:

    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array(
    '/my-landing-page', '/register', '/activate?key=*'
    );
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL = site_url() . '/my-landing-page';

    If you want your landing page to be the native BP registration page, then change the 2nd line to:

    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL = site_url() . '/register';
    // Note that the allowed uri, '/activate?key=*', uses the special
    // wildcard character * that will accept all uris starting with
    // '/activate?key=', so all activation codes will be accepted.
    //
    // Please note that if BP ever changes the uri for activating new members,
    // then you'll have to change this uri to match the new one.
    // This shouldn't be a big issue though.

    Thanks for your answer. I´ve copied the code into the config file. But it does not work.
    It puts me out a blank screen. when I copy the register.php from the registration ordner into the bp default folder, it shows me the regular startpage but not the registration fourmular.

    What do I have to do?

    $REDIRECT_TO_URL = site_url() . ‘/registration/register’; -ist this an option?

    Plugin Author NipponMonkey

    (@nipponmonkey)

    Use this code in the config file that you must create and save as:
    /wp-content/plugins/buddypress-private-community-config/mm-buddypress-private-community-config.php

    <?php
    // Allow users to register to BuddyPress (BP 1.2.5.2) through the native forms
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array('/register', '/activate?key=*');
    // Set the redirect to the native BP register form. All logged out users will be redirected to this page when they try to access a private BP page.
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL = site_url() . '/register';

    That’s all you need to do – just the 2-lines of code saved in the correct location.

    I’m not sure why you’d want to use “site_url() . ‘/registration/register'”, as the standard BuddyPress registration/”Create an Account” page is located at “site_url() . ‘/register'”.

    Are you using other plugins that change that?

    Also, what register.php file are you talking about??? You don’t have to do anything to a register.php file.

    I want to integrate the registration into the first site like it is on facebook.

    I´m talking about the register.php file in the default theme from buddypress.

    Perhaps you´ve got another idea how I can realize to get the registration formular onto the main page like in facebook.com?

    Plugin Author NipponMonkey

    (@nipponmonkey)

    Well, I’m not sure what you’re doing exactly, so I can’t give you the URIs you need to make public – you’ll have to work them out by testing.

    But if you need access to the register.php file then add:

    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array('/register.php', '/other-uris', 'my-landing-page');
    
    // Or
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array('/register.php*', '/other-uris', 'my-landing-page');
    
    // Just list the URIs that need to be public so members can register properly. Just go though your process of registering a new user and add all of the URIs that are called during the registration.
    // You can list whatever you like, e.g. '/register.html' or 'register.php?action=add-member', 'register.php?action=activate&key=*' - whatever you need, just add the URIs to the allowed list.
    
    // If you use the normal BP registration form, all you need is:
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array('/register', '/activate?key=*');
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL = site_url() . '/register';

    Thanks for this plugin, works quite well, thanks explanations Forum wings I could get it going smoothly.

    BUT I have problems with BuddyPress Feeds and when I share a story on Facebook, in preview it does not grab me or the title or content of the news as did before. Now I take the title and content of the page that I have in shaping MM_BUDDYPRESS_PRIVATE_COMMUNITY: $ REDIRECT_TO_URL = SITE_URL (). ‘/ Register’, which in my case is that of registration.

    Is there any way to fix this?
    Would not want the plugin put any restriction on the feeds and I returned to work correctly when share the URL of a post on facebook.

    The setup I have is the following:

    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS			=
    Array( '/foros' , '/sitios' , '/contactar', '/nosotros', '/registro', '/grupos' ,'/','','/activate?key=*',
    '/2010/*');
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL       = site_url() . '/registro';
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_HOOK			= 'my_redir_to';
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$BLOCK_WIDGETS			= FALSE;
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$BLOCK_RSS_FEEDS		= FALSE;
    
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$BLOCK_RSS_FEEDS_WHEN_LOGGED_IN	= FALSE;

    thanks all

    Plugin Author NipponMonkey

    (@nipponmonkey)

    If you’re trying to share a private WP/BP page on facebook, then you’ll get the redirect page instead. This is because FB is calling the page and FB isn’t logged into your site – so can’t access your private pages. I’ve just tested it.

    But your public pages will be shared as normal. So, the only fix would be to make your page/post public before sharing it on facebook.

    I’m not sure what your question/problem is regarding the WP/BP feeds.

    You have it set-up to allow access to all of your feeds. That means all of your WP and BP feeds are available to the public as normal. But some of the information in the feeds might not accessible through actual site – if the information is on private pages. Allowing access to feeds, can allow access to information that you might like to remain private and is private on the actual site.

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘[Plugin: BuddyPress Private Community] Can't get custom config to work :(’ is closed to new replies.