At the core of s2Member, is it's ability to protect content ( i.e. Posts, Pages, Tags, Categories, URI word fragments, etc ). Whenever a public User, or even an existing Member attempts to access an area of your site that is unavailable to them; either because they are not logged-in, not a paying Member at all; or maybe they are logged-in, but they don't have access to content you've protected at a higher Membership Level; — s2Member will always redirect these un-authenticated requests to your Membership Options Page. So your Membership Options Page is a key element of your site. It serves as the focal point of your s2Member installation.
Understanding this, it becomes important for s2Member to provide information about what the User/Member was attempting to access ( before they were redirected to the Membership Options Page ). This is where s2Member's MOP Vars come in ( i.e. Membership Options Page Variables ). Whenever s2Member redirects a User/Member to your Membership Options Page, it will include these important MOP Variables in the query string of the URL. These Variables can be used to provide more informative messages; or even to provide a different set of Membership Options ( i.e. Payment Buttons ), based on what a User/Member was attempting to access.
<?php if(current_user_can("access_s2member_level1") && $_GET["s2member_level_req"] === "2"){ ?>
.... they have access to Level #1 already, but they need to upgrade to Level #2 in order to view this content.
Display content here ( perhaps a Modification Button or a link to a Modification Form generated with s2Member Pro )
<?php } else { ?>
Else, display something different here.
<?php } ?>
Statistics: Posted by Cristián Lávaque — March 14th, 2011, 11:08 pm
Statistics: Posted by candy — February 21st, 2011, 10:15 am
Statistics: Posted by Cristián Lávaque — February 20th, 2011, 11:40 pm
Statistics: Posted by candy — February 20th, 2011, 8:46 pm
Statistics: Posted by Cristián Lávaque — February 20th, 2011, 8:27 pm
Statistics: Posted by candy — February 20th, 2011, 7:34 pm
Statistics: Posted by Cristián Lávaque — February 20th, 2011, 7:20 pm
Statistics: Posted by candy — February 20th, 2011, 5:32 pm
candy wrote:
And what if you have 3 levels and do not know which user landed there from where?!?!
Statistics: Posted by Cristián Lávaque — February 20th, 2011, 5:09 pm
Statistics: Posted by candy — February 20th, 2011, 4:25 pm
Statistics: Posted by Cristián Lávaque — February 20th, 2011, 3:19 pm
Statistics: Posted by candy — February 19th, 2011, 10:56 pm
<?php if (current_user_can("access_s2member_level1")){ ?>
Some content for Members who are logged in with an s2Member Level >= 1.
<?php } else { ?>
Message telling the person that he needs Level 1 access to see the content in this page.
<?php } ?>
Statistics: Posted by Cristián Lávaque — December 27th, 2010, 1:13 am
Statistics: Posted by moonviper — December 21st, 2010, 3:35 pm