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™

Unique Membership Levels

s2Member Plugin. A Membership plugin for WordPress®.

Unique Membership Levels

Postby behladesign » May 16th, 2011, 2:49 pm

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).
User avatar
behladesign
Registered User
Registered User
 
Posts: 46
Joined: May 16, 2011

Re: Unique Membership Levels

Postby rossagrant » May 16th, 2011, 2:56 pm

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!
User avatar
rossagrant
Experienced User
Experienced User
 
Posts: 127
Joined: May 5, 2010

Re: Unique Membership Levels

Postby behladesign » May 17th, 2011, 3:28 am

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?
User avatar
behladesign
Registered User
Registered User
 
Posts: 46
Joined: May 16, 2011

Re: Unique Membership Levels

Postby Harty » May 17th, 2011, 4:31 am

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.
User avatar
Harty
Registered User
Registered User
 
Posts: 104
Joined: April 27, 2011
Location: New Zealand

Re: Unique Membership Levels

Postby Cristián Lávaque » May 17th, 2011, 12:53 pm

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. :)
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

Re: Unique Membership Levels

Postby candy » May 17th, 2011, 5:26 pm

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 ;)
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Unique Membership Levels

Postby Cristián Lávaque » May 17th, 2011, 5:56 pm

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. :|
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

Re: Unique Membership Levels

Postby candy » May 17th, 2011, 6:06 pm

oh, ok, so I guess it was not the best idea :-(
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Unique Membership Levels

Postby Cristián Lávaque » May 17th, 2011, 7:06 pm

But your help is still very appreciated. :)
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

Re: Unique Membership Levels

Postby Harty » May 17th, 2011, 7:25 pm

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...
User avatar
Harty
Registered User
Registered User
 
Posts: 104
Joined: April 27, 2011
Location: New Zealand

Re: Unique Membership Levels

Postby behladesign » May 17th, 2011, 11:54 pm

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?
Last edited by Cristián Lávaque on May 18th, 2011, 12:03 am, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
behladesign
Registered User
Registered User
 
Posts: 46
Joined: May 16, 2011

Re: Unique Membership Levels

Postby Cristián Lávaque » May 18th, 2011, 12:03 am

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.
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

Re: Unique Membership Levels

Postby behladesign » May 19th, 2011, 1:51 pm

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.
User avatar
behladesign
Registered User
Registered User
 
Posts: 46
Joined: May 16, 2011

Re: Unique Membership Levels

Postby Cristián Lávaque » May 19th, 2011, 4:17 pm

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
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: Bing [Bot] and 1 guest

cron