$eot_time = get_user_option('s2member_auto_eot_time'); // for current user
$eot_time = get_user_option('s2member_auto_eot_time', $user_id); // for specific user
Statistics: Posted by Cristián Lávaque — November 29th, 2011, 4:59 am
Statistics: Posted by kennymcnett — November 28th, 2011, 8:02 pm
Statistics: Posted by Jason Caldwell — June 6th, 2011, 7:06 pm
Statistics: Posted by Cristián Lávaque — June 6th, 2011, 4:18 pm
Statistics: Posted by adamarling — June 6th, 2011, 1:22 pm
Statistics: Posted by adamarling — May 27th, 2011, 4:41 pm
Statistics: Posted by Jason Caldwell — May 24th, 2011, 7:54 pm
Statistics: Posted by Cristián Lávaque — May 24th, 2011, 1:36 pm
Statistics: Posted by Cristián Lávaque — May 24th, 2011, 11:08 am
Statistics: Posted by adamarling — May 24th, 2011, 2:25 am
Statistics: Posted by FrancescoRizzi — May 7th, 2011, 1:08 pm
Statistics: Posted by Jason Caldwell — May 7th, 2011, 12:32 pm
Cristián Lávaque wrote:
Regarding renewals, when adding more time to their membership before their EOT is up, will cause the previous one to end and the new one to start at the time of payment.
This is something we're planning to improve, but in the meantime you can fix it with this trick:
Create this directory and file /wp-content/mu-plugins/s2-hacks.php. Inside the file, add this code. Be sure there are NO spaces or line breaks before or after <?php ?>
* This code is untested, but it should work fine. Please let me know if you have any trouble.
- Code:
<?php
add_action('ws_plugin__s2member_during_paypal_notify_during_before_subscr_signup_w_update_vars', 'during_before_subscr_signup_w_update_vars');
function during_before_subscr_signup_w_update_vars($vars = array())
{
$GLOBALS['existing_s2_eot_time'] = get_user_option('s2member_auto_eot_time', $vars['user_id']);
}
add_action('ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars', 'during_subscr_signup_w_update_vars');
function during_subscr_signup_w_update_vars($vars = array())
{
if (($eot_time = get_user_option('s2member_auto_eot_time', $vars['user_id'])) && $GLOBALS['existing_s2_eot_time'])
update_user_option($user_id, 's2member_auto_eot_time', $eot_time + ($GLOBALS['existing_s2_eot_time'] - time ()));
}
?>
Statistics: Posted by FrancescoRizzi — May 7th, 2011, 11:03 am
<?php echo get_user_option("s2member_last_payment_time"); ?>
Statistics: Posted by Jason Caldwell — April 27th, 2011, 12:33 am
<?php echo get_user_option("s2member_last_payment_time"); ?>
Statistics: Posted by Cristián Lávaque — April 26th, 2011, 1:12 pm
Statistics: Posted by Cristián Lávaque — April 26th, 2011, 10:34 am
get_user_option('s2member_last_payment_date', S2MEMBER_CURRENT_USER_ID);
Statistics: Posted by Cristián Lávaque — April 26th, 2011, 1:21 am
FrancescoRizzi wrote:
Hmm... isgoing to give me the time when the user's membership expires? 'cause.. well, our memberships are annual, I might just take 365 days away from that value...
- Code:
get_user_option ("s2member_auto_eot_time", $uid);
Statistics: Posted by Cristián Lávaque — April 25th, 2011, 8:02 pm
[...] However, this will be 0 if they're not logged in; or if they've never paid you at all ( i.e. if they're still a Free Subscriber ). This holds the recorded time at which the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. This value is preserved for the lifetime of their account, even if they upgrade, and even if they're demoted at some point. Once this value is recorded, it never changes under any circumstance.
holds the recorded time at which the User originally registered their Username for access to your site; for free or otherwise.
get_user_option ("s2member_auto_eot_time", $uid);
Statistics: Posted by FrancescoRizzi — April 25th, 2011, 3:38 pm
Statistics: Posted by Cristián Lávaque — April 24th, 2011, 9:11 pm