You need to have Exec-PHP installed, then make sure you use ONLY the HTML editor on posts and pages, as the Visual editor will destroy the code. With this, you can put it directly into posts and pages.
Here's an example from my test "welcome" page
- Code: Select all
<?php if (S2MEMBER_CURRENT_USER_IS_LOGGED_IN){ ?><!-- checks to see if they're logged in at all, if they are, we show -->
Welcome, <?php echo S2MEMBER_CURRENT_USER_DISPLAY_NAME; ?>! <br>
You are currently a "<b><?php if (is_user_logged_in() && current_user_can("access_s2member_level1")){ ?><?php echo S2MEMBER_CURRENT_USER_ACCESS_LABEL; ?><?php } else { ?> Free Member<?php } ?> </b>", and have been for <b><?php echo S2MEMBER_CURRENT_USER_REGISTRATION_DAYS; ?></b> days.
<!-- this doublechecks to make sure they're logged in (not sure why I did that) and makes sure they're of a minimum level, then tells them their level label (which you specify in the options) and tells them how long, overall, that they've been a member -->
<br style="clear:all;">
<i>Modify Your User Information</i>-<br>
<iframe src="<?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; ?>" scrolling="auto" style="width:60%; height:325px; margin:auto; border:1px solid #666666;"></iframe>
<!-- this embeds the box where the user can modify their info -->
<?php } <!-- end this statement -->
else { ?> <!-- else, begin where we show something for users who are not logged in -->
You are not logged in. Please <A HREF="<?php echo S2MEMBER_LOGIN_PAGE_URL; ?>">click here to log in and proceed</A>!
<br><br>
Not a member? <a href="<?php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL; ?>">Click here to sign up today!</A>
<?php } ?> <!-- end the first if/else statement -->
This code is on a private test page and may be a bit outdated, since my site's plans have changed and we're holding off on a members area for a bit. The last bit isn't needed if you set "Allow Free Subscribers Access To This Page? " to No, I believe.