Page 1 of 1

Profile Page With Subscription Level?

PostPosted: March 23rd, 2011, 3:48 pm
by NickB
Can members access some sort of profile page which lists their current subscription level along with other general profile info?

Re: Profile Page With Subscription Level?

PostPosted: March 25th, 2011, 10:50 am
by man-O-media
Hi Nick,

I'm not quite sure what you mean but if you simply want to have a display on the profile page that tells the user what level they have, there are some constants you can use in your proile page template:

Have a look at this from the API scripting page:
S2MEMBER_CURRENT_USER_ACCESS_LEVEL
This will always be (int) -1 thru 4. -1 if not logged in. 0 if logged in as a Free Subscriber.

Code: Select all
<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 4){ ?>
    A Member has an Access Level of 4.
<?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 3){ ?>
    A Member has an Access Level of 3.
<?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 2){ ?>
    A Member has an Access Level of 2.
<?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 1){ ?>
    A Member has an Access Level of 1.
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0){ ?>
    A User is logged in as a Free Subscriber.
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === -1){ ?>
    A User is not logged in at all.
<?php ?>


There are also Shortcodes and there is a mass of other info as well on that page.

Daine