Forum Replies Created
-
@spinhead, the problem seems to be because your blog isn’t in the root domain. I think you need to change the config file a little to get it working. See my reply:
https://buddypress.org/community/groups/buddypress-private-community/forum/topic/redirect-hell/I’ve now added greater support for allowing access to your site. In the array of allowed URIs, you can now use ‘*’ at the end of an allowed URI,
e.g. Array(‘/public-blog’, ‘/public-blog/*’) would allow access to ‘/public-blog/post-1’, ‘/public-blog/post-2’, etc…
This is useful for allowing greater access to your site while keeping it private, and for allowing access to parts of your site that certain other plugins might require.
See FAQs for more information:
https://buddypress.org/community/groups/buddypress-private-community/home/@Gpo1, what happened?
Could you give your feedback in the plugin’s forum:
https://buddypress.org/community/groups/buddypress-private-community/forum/The general response has been good so far, it seems to be working fine for everyone else, so I’d be interested to know what’s going wrong for you.
Did you get an error message?
Hi, I’m the person who started this thread about 5 months ago!
I’ve been messing around with my own solution for a while now, and I’ve created my first couple of WP/BP plugins recently.
In fact, I’ve just released my BuddyPress Private Community Plugin:
https://buddypress.org/community/groups/buddypress-private-community/Somebody has already given it 5 stars!
It’s basically a single static class that has a few customizable settings, you can block RSS feeds, stop widgets from displaying when the user is logged out, and set an array of pages that are public. Of course you can set the redirect page when I logged out user tries to access a private page too. It defaults to the home page, but I suggest you change that in the config.
There is an example of how to create your own config file for the plugin, one that is saved in a place that won’t be overwritten when you update the plugin and that doesn’t require database access – so it should be a lightweight and quick plugin.
It’s been working great for me, let me know what you think and if you find any bugs!
@wordpresschina, it’s still working fine for me. I’m using a single WP not WPMU, dunno if that makes a deference or not.
You should check your server Error Log to see what is going wrong for you. If I get time a might make a plugin that handles everything… but I’m a bit busy at the moment – and there is a World Cup on ^ ^
Thanks @Travel-Junkie, I didn’t realize I could do it that way – I’m new to NextGen. That’s perfect for inserting single images.
But, it doesn’t give you the option of inserting whole galleries and slideshows, that’s what the “Add NextGen Gallery” button does, but it won’t load correctly for me. It should allow you to select a gallery and various other options before inserting the [nggallery id=X] code (or similar) for you.
Like I said, it doesn’t want to load the pop-up correctly because the php file directly requested is blocked some how by WP/BP – all that loads after clicking on the button is the 404 page not found error page:
[my-domain].com/wp-content/plugins/nextgen-gallery/admin/tinymce/window.php?ver=327-1235100
I’ve hacked at the PHP file that is trying to be loaded and converted it into a html file. Now the pop-up loads correctly, but the lack of dynamicness means the galleries, albums and pictures aren’t loaded into the pop-up. Instead of being able to simply pick a option from a select menu, I’ve made a text field where you can input the gallery ID. It then inserts the code as normal.
This really isn’t ideal, but it will do for now.
Does anyone know how I can allow access to php page at:
[my-domain].com/wp-content/plugins/nextgen-gallery/admin/tinymce/window.php?ver=327-1235100Thanks for your help
Actually, here is the reason I need to solve this problem.
I’m trying to use NextGEN Gallery, in the whole it’s working fine. But when I want to add a gallery to a post or page using the “Add NextGEN Gallery” button, the tinymce pop-up menu doesn’t load properly – I get the BP 404 error page loading inside the iframe of the pop-up menu instead.
I tested this a little and found it was because the iframe URL was to a file called /window.php. I noticed that all .php files I try to load directly in the browser return the 404 error. (I tested my-domain.com/hello-world.php, and got the BP 404 page not found error!)
So, I need to stop the 404 BP message from showing and to allow the NextGEN window.php to load in the tinymce pop-up.
Does anyone know how I can achieve this?
Cheers
I’m looking for the same kind of thing. I’ll have a look round something and I’ll let you know if I find anything…
Grrrr, how do you add code to posts in BP?
I’ve tried pre and code tags, but nothing working >_<
Hmmmm….
Thanks for your posts ^ ^
I’m finally getting round to setting up a private buddy press site.
I liked the looks of @Travel-Junkie‘s solution, but I’m having the same problem as @wordpresschina, I’m getting a infinite redirect loop. It seems that functions like bp_is_register_page() and bp_is_home() aren’t working correctly from @Travel-Junkie‘s function.
I changed it a little to:
function sh_walled_garden()
{
global $bp;$uri = $_SERVER;
$allowed_uris[] = ”;
$allowed_uris[] = ‘/’;for ($i=0; $i < count($allowed_uris); $i++) {
if ($allowed_uris[$i] === $uri) {
return;
}
}if( ! is_user_logged_in() ) {
bp_core_redirect( $bp->root_domain);
}
}
add_action( ‘get_header’, ‘sh_walled_garden’ );Where the $allowed_uris array is set by the programmer to allow access to certain public pages. If the user isn’t logged in and they are trying to access a private page, then they will be redirected to the home page (as that page will be public in my site setup and I don’t want people to be able to register through a sign up page.)
I’ll have to see how I get on with this solution for now…
Thanks for your help