Page 1 of 1

Unique Membership Levels

PostPosted: May 16th, 2011, 2:49 pm
by behladesign
I have a site using S2 member that offers content to workshop participants for free and then premium memberships (paid). I made the free, workshop participants, member level 0.

The paid memberships are set to levels 1 and 2 (they can see the same content, but the cost of the membership is different: level 1 is $24.95/mo for workshop graduates) and level 2 is $49.95/mo for non workshop graduates.

My question is how can i make it so that the level 0 members can't see the content from level 1 and 2. Also, level 1 and 2 member can't see the content for level 0.

http://gapzip.com/

Also, i have set the login page for each member level to go to a landing page for that member. Is it possible for level 1 and level 2 to go to the same landing page since they will see the same content? If not, i can use sidebar manager in wordpress to create the custom sidebar for the member pages (that's what i'm planning to do for the member based content, have the page nav on a sidebar).

Re: Unique Membership Levels

PostPosted: May 16th, 2011, 2:56 pm
by rossagrant
Navigate your way to the menu inside the dashboard S2Member--->API/Scripting--->Using Simple Conditionals.

It will show you how you can wrap ANYTHING in a shortcode which will only give users who are of a certain level access to it.

To any other members they simply won't see it, or you can put some other text inbetween shortcodes for the free members to see which says something like, 'To View This Link, Upgrade Your Subscription!' etc.

I use them all the time and Jason is looking at implementing these codes by means of a button in the visual editor for easy implementation in future versions.

Hope that helps!

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 3:28 am
by behladesign
Which set of code would you recommend for my needs? I want level 0 only to see level 0. Level 1 and 2 can see the same content. Would i need to add this shortcode to every page that I want the restrictions to apply?

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 4:31 am
by Harty
Hi, I am a new user myself, but perhaps you can put the same content on two pages ( level 1 and 2 ) and assign each page to either level 1 or level 2. Guess it depends how many pages you are working with... Just an idea.

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 12:53 pm
by Cristián Lávaque
behladesign wrote:Which set of code would you recommend for my needs? I want level 0 only to see level 0. Level 1 and 2 can see the same content. Would i need to add this shortcode to every page that I want the restrictions to apply?


For it to work the way you want, you need the conditionals in every page, yes. You could just have a conditionals template you paste into every page/post and then fill in the content...

Code: Select all
[s2If is_user_not_logged_in()]
    Some public content, they're NOT logged in.
[/s2If]

[s2If is_user_logged_in()]
    Content for anyone that is logged in, regardless of their Membership Level.

   [_s2If current_user_is(s2member_level0)]
      Content for members at exactly Level 0.
   [/_s2If]

   [_s2If current_user_is(s2member_level1) OR current_user_is(s2member_level2)]
      Content for members at exactly Level 1 or 2.
   [/_s2If]
[/s2If]


The problem is that you don't want higher levels to see a lower level (i.e. levels 1 and 2 not see 0). Each level can see everything at its level or lower. The only way to restrict at exactly its level is with conditionals, as shown above. WP Admin -> s2Member -> API / Scripting -> Using Simple Conditionals

If you want to restrict access to content without conditionals, you'd need to have everyone at the same level and group them with custom capabilities to restrict access, and you'd separate content into different pages instead of blocks inside a same page.

WP Admin -> s2Member -> API / Scripting -> Custom Capabilities
http://www.s2member.com/custom-capabilities-video/

In order to let some register free at level 1 you'll need s2Member Pro's pro-forms. You can't register them all at level 0 because you can't charge for it, which is a problem with the two paid groups.

I hope that helps. :)

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 5:26 pm
by candy
No idea if it applies to your issue, but what about using a different category for each of the memberships and than just simply s2-protect the categories !?!?

Like you organize all your level_0 content under category_A, your level_1 content under category_B and your level_2 content under category_C

Than go and simply protect the respective categories according to the level you want!?!?

Was just an idea ;)

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 5:56 pm
by Cristián Lávaque
But Candy, he doesn't want Level 1 or 2 members to see Level 0 content, which can't be accomplished with just Category Access Restrictions, since they work with Levels and incremental access applies. :|

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 6:06 pm
by candy
oh, ok, so I guess it was not the best idea :-(

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 7:06 pm
by Cristián Lávaque
But your help is still very appreciated. :)

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 7:25 pm
by Harty
Instead of having levels 1 and 2, you could use a discount code for students and have just one paid level. For level zero you could use a wordpress page password, but it wouldn't be totally secure...

Re: Unique Membership Levels

PostPosted: May 17th, 2011, 11:54 pm
by behladesign
Thank you for your excellent replies! It's starting to make a lot more sense now!

I watched the video that Cristian recommended and it lead me to this video.
http://www.s2member.com/custom-capabilities-video/

There are two things I took away after watching this video.

1. We really have 2 member levels 0 (free for workshop participants). and level 1 (paid membership) and with level 1 there are two ways that a user can pay 1. as a workshop graduate they get a discount and pay $24.95 and 2. as a full price membership for $49.95.

In this video he talks about creating a unique page template for the member level and putting the conditionals in that page template.

Then we can put this code into the template:

Code: Select all
[s2If is_user_not_logged_in()]
    Some public content, they're NOT logged in.
[/s2If]

[s2If is_user_logged_in()]
    Content for anyone that is logged in, regardless of their Membership Level.

   [_s2If current_user_is(s2member_level0)]
      Content for members at exactly Level 0.
   [/_s2If]

   [_s2If current_user_is(s2member_level1) OR current_user_is(s2member_level2)]
      Content for members at exactly Level 1 or 2.
   [/_s2If]
[/s2If]


I'm thinking that this approach would work well, because the end user (client) can just select that page template according to the member level that they want that page to be. This would pull in the conditional variables and the option to have custom css applied to any pages that use that particular template. The benefit of the custom css that is different than the main theme is that the logged in members will have a more obvious (visual) sense that they are in the "member area" of the site.

2. The second thing i took away is the conditional variable that if a user attempts to login and fails it takes them to the membership signup page. This makes sense, but I also wonder if the member wants to retrieve their lost password how would they do that?

Re: Unique Membership Levels

PostPosted: May 18th, 2011, 12:03 am
by Cristián Lávaque
Just to make sure I'd like to make this clear: when I mentioned the word "template" talking about that code to paste in posts/pages and fill in with content, I wasn't talking about a theme template. Yes, you can use the HTML tab of your editor and add IDs or classes to use as selectors in your CSS, that's fine.

Also, if you use the conditionals for this, you don't need to use the custom capabilities, but you can use them if you want. Also, if you're using conditionals, since it's not the whole page that's protected, the person won't be sent to the Membership Options Page, he just won't be shown what he can't see and you can customize the message they do see to make them upgrade or whatever.

Re: Unique Membership Levels

PostPosted: May 19th, 2011, 1:51 pm
by behladesign
What are the actual template functions (PHP function ) that can be used to block access to some content?

I want to create an entire new function that checks the user level (in php before the page is server) and allows OR blocks access to the content.

Re: Unique Membership Levels

PostPosted: May 19th, 2011, 4:17 pm
by Cristián Lávaque
To block certain parts you use conditionals, either shortcode or PHP, as explained in s2Members Scripting API documentation.

To protect a whole page you do it with custom capabilities as I explained earlier. viewtopic.php?f=4&t=6452#p15174