PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Specific Access for Member Levels (not inclusive)

s2Member Plugin. A Membership plugin for WordPress®.

Specific Access for Member Levels (not inclusive)

Postby kelley_rao » August 9th, 2011, 4:32 pm

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
User avatar
kelley_rao
Registered User
Registered User
 
Posts: 14
Joined: October 3, 2010

Re: Specific Access for Member Levels (not inclusive)

Postby kelley_rao » August 9th, 2011, 8:01 pm

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
User avatar
kelley_rao
Registered User
Registered User
 
Posts: 14
Joined: October 3, 2010

Re: Specific Access for Member Levels (not inclusive)

Postby Bruce C » August 9th, 2011, 8:27 pm

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!

:D
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: Specific Access for Member Levels (not inclusive)

Postby kelley_rao » August 9th, 2011, 8:44 pm

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
User avatar
kelley_rao
Registered User
Registered User
 
Posts: 14
Joined: October 3, 2010

Re: Specific Access for Member Levels (not inclusive)

Postby Bruce C » August 9th, 2011, 8:58 pm

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.
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: Specific Access for Member Levels (not inclusive)

Postby Cristián Lávaque » August 10th, 2011, 11:18 am

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 #3

You 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. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest

cron