Page 1 of 1

Uses s2Member API Constants, instead of functions. Error

PostPosted: May 6th, 2010, 6:33 pm
by erichamby
If you use Example #5: Uses s2Member API Constants, instead of functions.
you get errors.

Parse error: syntax error, unexpected T_ENDWHILE

Re: Uses s2Member API Constants, instead of functions. Error

PostPosted: May 6th, 2010, 7:02 pm
by erichamby
I guess what i need to know is does using Example #3 work the same has Example #5? I wasnt sure if the plugin actually changed the user role.

Re: Uses s2Member API Constants, instead of functions. Error

PostPosted: May 6th, 2010, 9:06 pm
by Jason Caldwell
The examples found under s2Member -> API Scripting -> Advanced Conditionals.

Yes, example #3 works the same as example #5.

Example #5 should have been this:
Code: Select all
<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 4){ ?>
    Some content for Members with an s2Member Level >= 4.
<?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 3){ ?>
    Some content for Members with an s2Member Level >= 3.
<?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 2){ ?>
    Some content for Members with an s2Member Level >= 2.
<?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 1){ ?>
    Some content for Members with an s2Member Level >= 1.
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0){ ?>
    Some content for Free Subscribers.
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === -1){ ?>
    Some public content.
<?php } ?>

Thanks for reporting this. I'll have this corrected.