Skip to:
Content
Pages
Categories
Search
Top
Bottom

Working for anyone with latest WP / BP ?

  • Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Can anyone confirm that this works with WP 3.0.4 and BP 1.2.7

    The below goes into an infinite loop for any url

    `
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array(‘/about’, ‘/contact’);
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL = site_url() . ‘/home’;
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_HOOK = ‘my_redir_to’;
    `

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of nipponmonkey
    NipponMonkey
    Member

    @nipponmonkey

    Well, your $REDIRECT_TO_URL page isn’t in the list of allowed URIs(!) as required for the plugin to work.

    Add ‘/home’ to the Array of $ALLOWED_URIS – this should help.

    I’m having an issue as well. My config:

    `MM_BUDDYPRESS_PRIVATE_COMMUNITY::$ALLOWED_URIS = Array(‘/joinus’,’/contact’, ‘/about’, ”,’/news’,’/get-involved’,’/faq’,’/kvn’);
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_TO_URL = site_url() . ‘/joinus’;
    MM_BUDDYPRESS_PRIVATE_COMMUNITY::$REDIRECT_HOOK = ‘bp_redir_to’;`

    Any time I try to any page besides the home page it tries to redirect me to http://localhost/kvn/joinus?bp_redir_to=/kvn/joinus

    Right now the home page is http://localhost/kvn/, which, like I said, works fine.

    My config file is at buddypress-private-community-config/mm-buddypress-private-community-config.php

    P.S.: I only added the ‘/kvn’ to ALLOWED_URIS to see if it was having WordPress in a subdir that was causing the issue.

    I’ve made some code changes to restrict_access()

    http://pastie.org/1554151

    I removed all of the preg_* functions because they weren’t necessary and generally slow. Also removed the big for loop. It’s now using $wp->query_vars; instead of trying to hack apart $_SERVER.

    As a side effect, users don’t need to have preceding slashes in all of their allowed uri’s and it will work with WP sites that are in subdirectories.

    Please check this out and consider adding it back to the plugin. I may have removed code that was doing something specific for you, but this is working good for me. Some attribution would be nice if you decide to use it :) (neil@descend.org)

    Thanks for your work, by the way. This plugin is saving me a good amount of time on a client project.

    Avatar of nipponmonkey
    NipponMonkey
    Member

    @nipponmonkey

    @neiltron, using $wp->query_vars; doesn’t work in the same way as my code. Some plugins use query strings like “?event_id=4″, using $wp->query_vars doesn’t get this extra information that is vital for a correct redirect uri.

    I’ve made some updates myself, not live yet – still testing:
    - the plugin will work the same when WP is in a sub foulder. (www.my-domain.com/my-community/{BP})
    - New method for blocking widgets, and widgets can be blocked on an widget ID basis when the user is logged out – and the widgets are blocked for all themes.
    - Added an extra mode that allows you to allow access to everyone (logged out users) and block some private URIs (the opposite to how it currently works).

    I’ll upload the new version once I’ve done a bit more testing…

    Avatar of HaveAnEpiphany
    HaveAnEpiphany
    Member

    @haveanepiphany

    Still a little confused… should I expect this to work on a new WP/BP site running the latest versions? It looks to be exactly like what I need, so I’d love to be able to use it!

    Thanks…

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.