Hi Kirk. Thanks for the great question.There are two Constants available for Content Dripping:
- Code: Select all
S2MEMBER_CURRENT_USER_REGISTRATION_TIME
S2MEMBER_CURRENT_USER_REGISTRATION_DAYS
S2MEMBER_CURRENT_USER_REGISTRATION_TIMEThis will always be an integer; in the form of a Unix timestamp. 0 if not logged in. This holds the recorded time at which the Member originally registered their Username for access to your site. This is useful if you want to drip content over an extended period of time, based on how long someone has been a Member.
- Code: Select all
<?php echo S2MEMBER_CURRENT_USER_REGISTRATION_TIME; ?>
This may output something like: 1270537981( this is a Unix timestamp, which is based on seconds )S2MEMBER_CURRENT_USER_REGISTRATION_DAYSThis will always be an integer. 0 if not logged in. This is the number of days that have passed since the Member originally registered their Username for access to your site. This is useful if you want to drip content over an extended period of time, based on how long someone has been a Member.
- Code: Select all
<?php echo S2MEMBER_CURRENT_USER_REGISTRATION_DAYS; ?>
This may output something like: 120 ( 120 days is approx 4 months )Using MONTH calculations ------------------------------------------------------------------------ Code: Select all
<?php if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER){ ?>
This is some content that will be displayed to all Members.
<?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS/30 >= 1){ ?>
Drip content to Members who are at least 1 month old.
<?php } ?>
<?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS/30 >= 2){ ?>
Drip content to Members who are at least 2 months old.
<?php } ?>
<?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS/30 >= 3){ ?>
Drip content to Members who are at least 3 months old.
<?php } ?>
<?php } ?>
So we are just calculating months dynamically; by dividing DAYS by 30.
Assuming there are 30 days ( on average ) in each month.