WordPress.org

Forums

BuddyPress Private Community
Can't get custom config to work :( (27 posts)

  1. zanzaboonda
    Member
    Posted 4 years ago #

    I'm not sure why, as I thought I was following the info correctly, but I get a general error saying there is an unexpected '}' on the last line. Of course there is none so I'm assuming it's from somewhere else. :(

    Does anyone know how to fix this? Please?

    This is exactly what I need.

    http://wordpress.org/extend/plugins/buddypress-private-community/

  2. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    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.

  3. zanzaboonda
    Member
    Posted 4 years ago #

    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

  4. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    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.

  5. zanzaboonda
    Member
    Posted 4 years ago #

    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

  6. Mat
    Member
    Posted 4 years ago #

    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

  7. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    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.

  8. Mat
    Member
    Posted 4 years ago #

    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

  9. Adal
    Member
    Posted 4 years ago #

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

  10. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    @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.
  11. Adal
    Member
    Posted 4 years ago #

    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?

  12. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    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.

  13. Adal
    Member
    Posted 4 years ago #

    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?

  14. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    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';
  15. mira360
    Member
    Posted 4 years ago #

    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

  16. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    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.

  17. mira360
    Member
    Posted 4 years ago #

    Please answer soon, thanks a lot.

    But the problem I have it when I share on facebook, is with the post of the homepage that are public and visible to registered and unregistered users. Moreover even if one is registered not sharing my work well, so you said before. Also at $ ALLOWED_URIS array I have also '/ 2010 / *' to prevent any blockage of access to news of 2010.

    In the post I copied my own Could you tell me if I have it right so that feeds are not affected by the plugin?

    Thank you very much.

  18. mira360
    Member
    Posted 4 years ago #

    is strange with a new post, when i share it, all is ok now , but with de last post i publiqued no work good.

    IF go well with the next publication or post, that´s all well, thanks. We´ll see.

  19. jessicaswift
    Member
    Posted 4 years ago #

    Hello, I am using BuddyPress Private Community, and it works great, but I need to allow people to register for my site, and it's redirecting to the login page! I'm using Absolute Privacy as well, so people can create their own profiles and logins, but the Private Community is not allowing people to register. How can I change it so registration is open to anyone, but the rest of the site is blocked unless users are logged in?

    The problem I'm having is on this page: http://www.thedeclarationofyou.com/ecourse/

    Thank you in advance for your help!!

  20. mira360
    Member
    Posted 4 years ago #

    Put /activate?key=* and /register on your Allowed_Uris Config.

    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';
  21. jessicaswift
    Member
    Posted 4 years ago #

    Hi,

    I'm not sure how to do this.... I went into the code, but I don't know the correct way or place to insert this. Can you help? I appreciate it so much!

  22. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    @jessicaswift, do you have a customized config file set-up?

    That is where your changes must go to override the default settings of the plugin.

    You can find out how to make a custom config file and all of the settings that you can change in the plugin's FAQs:
    http://wordpress.org/extend/plugins/buddypress-private-community/faq/

    Check out:
    How can I override the default settings? &
    How can I allow members to automatically register to my private community?

    I haven't tried the plugin with the Absolute Privacy plugin, so you might have to change the config file to allow additional URIs to get it up and running how you'd like it to.

    You can add any number of public URLs that you'd like to allow users access to, this can be URIs to pages, posts or to activation URIs like '/activate?key=*' (see FAQs)

    The plugin is very flexible and can be configured to work however you'd like it to work, but you have to read the instructions to ensure you set it up right.

    You can check out more information in the BuddyPress forum too:
    http://buddypress.org/community/groups/buddypress-private-community/forum/

  23. lsither
    Member
    Posted 4 years ago #

    Is there a way to restrict a URL rather than using the Allowed_URL way.

  24. info@geekgirlwebdesign.com
    Member
    Posted 4 years ago #

    Hello. I think I may be having a similar issue. For some reason there is no option for people to register... only login: http://www.geekgirlwebdesign.com/socialbeta. When i click the login it goes to the WP admin login page. Please advise. Thanks!

  25. jasondonahoe
    Member
    Posted 4 years ago #

    On my private buddypress site usergroups.raintreeinc.com when users register the email for activation opens a page that says there was an error "There was an error activating your account, please try again.
    Activate your Account. Please provide a valid activation key."

    The activation key does not seem to work. What is worse is that I cannot manually go into the BuddyPress and active the user from the "pending activations" list because the user is not listed. The user is already in the user table but the role is set to None and I cannot manually edit the role to something like Contributor, any ideas?

  26. NipponMonkey
    Member
    Plugin Author

    Posted 4 years ago #

    Hmmmm... Works fine on my sites...

    Can you give me more information, what version of WP and BP are you using? Also, what version of PHP are you using?

    If you have any error messages in you server log related to the issues, could you provide them too.

    Finally, can you show me the config file you're using? Have you allowed access to the activation urls, so they aren't blocked?

    This might help too:
    http://buddypress.org/community/groups/buddypress-private-community/forum/topic/creating-custom-config-file-does-not-work/?topic_page=2&num=15#post-98049

    Regards

  27. Anonymous
    Unregistered
    Posted 4 years ago #

    hi

    I currently have wordpress 3.1.2 install with buddypress 1.2.8 install, I am trying to make the buddypress private community to work on my site for some reason i cant get it to work properly, i create the configuration file in the right directory but its still not working properly. i was wondering how i could get the widget id to unblock them, and what is the specific format should i go about doing that. im using the theme my login widget for user to log in on the site, and also my register page is block as well the redirection link if not working either, anyone has a working configuration file i can try.

    Thanks in advance guys,

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BuddyPress Private Community
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic