Page 1 of 1

Can Drip Feeding Be Date Range Limited?

PostPosted: October 25th, 2010, 7:34 pm
by KirkWard
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.

Re: Can Drip Feeding Be Date Range Limited?

PostPosted: October 25th, 2010, 10:02 pm
by Jason Caldwell
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.
}
?>

Re: Can Drip Feeding Be Date Range Limited?

PostPosted: October 26th, 2010, 11:18 am
by KirkWard
Thanks bunches.