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™

Drip Feeding Periods

s2Member Plugin. A Membership plugin for WordPress®.

Drip Feeding Periods

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

Is there a way to measure the drip feeding period by anything other than days?

If I am charging my members by the month, or any other PayPal increment, it would make sense to have the drip feed periods match the subscription periods.

Thanks once again
User avatar
KirkWard
Experienced User
Experienced User
 
Posts: 61
Joined: October 22, 2010

Re: Drip Feeding Periods

Postby Jason Caldwell » October 27th, 2010, 4:03 am

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_TIME
This 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_DAYS
This 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.
~ 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: Drip Feeding Periods

Postby KirkWard » October 27th, 2010, 7:19 am

Presuming I write a routine to calculate the "month days" (using a SUM from a routine similar to the EOM function in Excel), I presume this formula would have no problem accepting a variable?

Or, using 30.5 days, since 365/12 approx 30.5?
User avatar
KirkWard
Experienced User
Experienced User
 
Posts: 61
Joined: October 22, 2010

Re: Drip Feeding Periods

Postby Jason Caldwell » October 27th, 2010, 7:47 am

KirkWard wrote:Presuming I write a routine to calculate the "month days" (using a SUM from a routine similar to the EOM function in Excel), I presume this formula would have no problem accepting a variable?

Or, using 30.5 days, since 365/12 approx 30.5?

Yes, either of those concepts would be fine to use.

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.5 >= 1){ ?>
            Drip content to Members who are at least 1 month old.
        <?php } ?>
        
        <?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS/30.5 >= 2){ ?>
            Drip content to Members who are at least 2 months old.
        <?php } ?>
        
        <?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS/30.5 >= 3){ ?>
            Drip content to Members who are at least 3 months old.
        <?php } ?>

    <?php } ?>
~ 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


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron