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™

Can Drip Feeding Be Date Range Limited?

s2Member Plugin. A Membership plugin for WordPress®.

Can Drip Feeding Be Date Range Limited?

Postby KirkWard » October 25th, 2010, 7:34 pm

Is it possible to limit the content available to a member, based on a maximum number of days membership, as well as the minimum?

The example code given (below) appears to allow content after a minimum number of days ...
Code: Select all
if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 30)

How would I set a range of over 30 days, but less than sixty? Would the coding be like this?
Code: Select all
if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 30 AND S2MEMBER_CURRENT_USER_REGISTRATION_DAYS 60 <= )

This is also useful when selling products and only allowing a limited download time.
User avatar
KirkWard
Experienced User
Experienced User
 
Posts: 61
Joined: October 22, 2010

Re: Can Drip Feeding Be Date Range Limited?

Postby Jason Caldwell » October 25th, 2010, 10:02 pm

Yes, and you were very close. Try it like this:
Code: Select all
<?php
if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 30 && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS <= 60){
    // Something could go here...
    // This is at least 30 days, but not more than 60 days.
}
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Can Drip Feeding Be Date Range Limited?

Postby KirkWard » October 26th, 2010, 11:18 am

Thanks bunches.
User avatar
KirkWard
Experienced User
Experienced User
 
Posts: 61
Joined: October 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron