Page 1 of 1

Restrict BuddyPress Pages

PostPosted: August 10th, 2010, 11:51 am
by jgucci
I would like to restrict the buddypress pages, members, activity, groups and so on but I can not find their page ids.

Where do you find these?

Re: Restrict BuddyPress Pages

PostPosted: August 10th, 2010, 11:43 pm
by BeckB
You should be able to do this through the URI Access Restrictions (under General Settings). e.g.:
members/
groups/
forums/
activity/

Re: Restrict BuddyPress Pages

PostPosted: August 17th, 2010, 4:14 pm
by Jason Caldwell
Correct. This is how BuddyPress is integrated with s2Member; using URI Level Access.

Inside your WP Dashboard, see:
s2Member -> General Options -> URI Level Access Restrictions.

Re: Restrict BuddyPress Pages

PostPosted: September 8th, 2010, 4:54 am
by micb11
Dammmmmm! Just spent an hour and a half trying to write some code to stop this. Then eventually found this added the word "members" to URI and all done.

Is there a way to redirect to certain pages for certain uri's. If a member is registered on level 1 they cannot access their profile until we manually upgrade them to level 2. but rather go to the register page I would like them to go to a page that says "Your level of access has not been approved yet"

Sure it can be done with conditionals in function.php ?

Re: Restrict BuddyPress Pages

PostPosted: September 9th, 2010, 10:20 am
by Jason Caldwell
Thanks for the great question.
Here are some ways you could handle this:


1. Install Exec-PHP, and then put something like this inside your Login Welcome Page for s2Member.
Code: Select all
<?php if(current_user_is("s2member_level0")){ ?>
    Your level of access has not been approved yet.
<?php } else if(current_user_is("s2member_level1")){ ?>
    Welcome! Thanks for your purchase.
<?php } ?>
( for further details, in your Dashboard, go to: s2Member -> API Scripting -> Advanced Conditionals )

----------------------------------

2. No PHP required, use [s2If] Shortcode Conditionals in any Post/Page/Widget.
Code: Select all
[s2If current_user_is(s2member_level0)]
    Your level of access has not been approved yet.
[/s2If]

[s2If current_user_is(s2member_level1)]
    Welcome! Thanks for your purchase.
[/s2If]
* requires s2Member v3.2.4+ ( for further details, see: s2 -> API Scripting -> Simple Conditionals ).

----------------------------------

3. Use Replacement Codes inside a Special Redirection URL.
Code: Select all
http://www.example.com/login-welcome-level-%%current_user_level%%
( see: General Options -> Login Welcome Page -> Special Redirection URL )