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™

Disable Incremental Access

s2Member Plugin. A Membership plugin for WordPress®.

Disable Incremental Access

Postby danv09 » March 4th, 2011, 7:15 pm

Hello.

Is there any way so every membership level can access only its content alone ?

Thanks.
User avatar
danv09
Registered User
Registered User
 
Posts: 8
Joined: March 4, 2011

Re: Disable Incremental Access

Postby Cristián Lávaque » March 5th, 2011, 12:40 am

Here's a lot of info on s2Member conditionals:

WP Admin -> s2Member -> API / Scripting

Example #3 under Using Advanced Conditionals answers your question pretty well:

Code: Select all
Example #3: Specific content for each different Member Level.

<?php if (current_user_is("s2member_level4")){ ?>
    Some premium content for Level 4 Members.
<?php } else if (current_user_is("s2member_level3")){ ?>
    Some premium content for Level 3 Members.
<?php } else if (current_user_is("s2member_level2")){ ?>
    Some premium content for Level 2 Members.
<?php } else if (current_user_is("s2member_level1")){ ?>
    Some premium content for Level 1 Members.
<?php } else if (current_user_is("s2member_level0")){ ?>
    Some content for Free Subscribers.
<?php } else { ?>
    Some public content.
<?php } ?>


You can also use a switch with an API constant, instead of the conditional function. Something like:

Code: Select all
switch S2MEMBER_CURRENT_USER_ACCESS_LEVEL {
    case 4:
        echo 'Some content for level 4 members.';
        break;
    case 3:
        echo 'Some content for level 3 members.';
        break;
    case 2:
        echo 'Some content for level 2 members.';
        break;
    case 1:
        echo 'Some content for level 1 members.';
        break;
    case 0:
        echo 'Some content for free members.';
        break;
    default:
        echo 'Some public content.';
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 0 guests

cron