Community Support Forums — WordPress® ( Users Helping Users ) — 2011-08-22T14:03:50-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14636 2011-08-22T14:03:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14636&p=32612#p32612 <![CDATA[Re: API/Scripting]]>
Check out Dashboard -> s2Member -> API/Scripting -> Simple/Shortcode Conditionals

Statistics: Posted by Bruce C — August 22nd, 2011, 2:03 pm


]]>
2011-08-21T20:08:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14636&p=32592#p32592 <![CDATA[Re: API/Scripting]]>
I replaced current_user_is with current_user_can and this time when viewing the page as Admin, I received the text "Some premium content for Level 4 Members".

Based on that result, I can simply duplicate content within each if/else if command for each respective level and that will accomplish what I need, however, is there a simpler way using the code that would use an "if and" rather than an "else if" (I'm not a programmer)?

Thanks

Statistics: Posted by buck415 — August 21st, 2011, 8:08 pm


]]>
2011-08-21T16:48:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14636&p=32587#p32587 <![CDATA[Re: API/Scripting]]> Statistics: Posted by Bruce C — August 21st, 2011, 4:48 pm


]]>
2011-08-21T12:50:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14636&p=32576#p32576 <![CDATA[API/Scripting]]>
I have installed and activated the EXEC-php plugin.

Logged in as Administrator, I created a test page with Level 3 access, and pasted the following:

Code:
<?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 } ?>


When I view the page, I only see the text "Some public content," which is not what I expected to see. If I am logged in as Administrator, won't I see the text for each level?

Here's what I want to accomplish:

A Level 1 user visits a page and sees content assigned to that level.
A Level 2 user visits that same page and sees content assigned to Level 2, and Level 1.
A Level 3 user visits that same page ans sees content assigned to Level 3, and Levels 1 & 2.

Thanks

Statistics: Posted by buck415 — August 21st, 2011, 12:50 pm


]]>