Page 1 of 1
Specific Access for Member Levels (not inclusive)
Posted:
August 9th, 2011, 4:32 pm
by kelley_rao
Hello,
Rather than having tiered content, I have a site that has specific content for a specific Level/Membership.
Right now, Level 1 can see their items but Level 2 can see Level 2 + Level 1. Where and what do I edit so that content is specific to just ONE level with no crossover?
Thanks,
Kelley
Re: Specific Access for Member Levels (not inclusive)
Posted:
August 9th, 2011, 8:01 pm
by kelley_rao
Hi again,
I might have explained above backwards.
But the question remains and I've now tried to limit access by using Restricted Access to certain page ID's. But, my Level 1 people are still getting access to Level 2 content (only if they knew the URL to get to it as we have different menus for different logins).
In a nutshell, I've set up S2 for Level 1 and higher having access to 10 pages. Level 2 and higher has access to 4 of the 10 pages in Level 1. In my case, Level 1 has more importance (if you will) than Level 2 -- do I have this configured backwards?
Confused!
Kelley
Re: Specific Access for Member Levels (not inclusive)
Posted:
August 9th, 2011, 8:27 pm
by Bruce C
Technically you do have it backwards. However, if you already have multiple users and cannot reconfigure everything, you can always use conditionals like this in order to only show level 1 user's content to level 1 and level 2 content to level 2.
- Code: Select all
<?php if (current_user_can('access_s2member_level1') && !current_user_can('access_s2member_level2'))
{ ?>
Hello level 1 user
<?php } else if (current_user_can('access_s2member_level2')){ ?>
Hello level 2 user
<?php } else if (current_user_can('access_s2member_level0')) {?>
Hello free user
<?php } else {?>
You are not registered
<?php } ?>
Shortcode equivalents can work the same way.
Hope that helps!
Re: Specific Access for Member Levels (not inclusive)
Posted:
August 9th, 2011, 8:44 pm
by kelley_rao
Thanks Ace (and also for the tip on Custom Welcome pages)
If I needed to add above code, may I ask what page I edit? I'm rather new to this but muddling my way through!
Thanks again.
Kelley
Re: Specific Access for Member Levels (not inclusive)
Posted:
August 9th, 2011, 8:58 pm
by Bruce C
Well, it would have to be posted to any page in which you have different content for different users.
The Login Welcome Page is one that a lot of people seem to use conditionals on, however, it's just up to what page you want the content to be shown on.
P.S. for the code to work you need to have Exec-PHP (or something like it) installed.
Re: Specific Access for Member Levels (not inclusive)
Posted:
August 10th, 2011, 11:18 am
by Cristián Lávaque
Levels give incremental access. The only way to show content to a specific level right now is to use conditionals as shown in the 3rd example of the simple conditionals.
WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals -> Example #3You could also give each level a custom capability and then restrict a whole page/post using those from the meta box in the edit page, instead of levels. This would make s2Member take the person to the Membership Optiones Page when trying to view that content, instead of remaining there as in the case of the conditionals.
http://www.s2member.com/custom-capabilities-video/I hope that helps.