• Anonymous User

    (@anonymized-1391468)


    I would like to show my members when their expiry date is. I am using the following code snippet which actually returns the EOT value fine. However, it includes the grace period. Is there a function that I can use to retrieve the set grace period and subtract it before I echo the EOT?

    $s2member_auto_eot_time = get_user_field ("s2member_auto_eot_time");
    if ($s2member_auto_eot_time != '') {
      $eotdate = new DateTime("@$s2member_auto_eot_time");
      echo $eotdate->format('d-M-Y');
    } else {
      echo "never";
    }

    https://www.ads-software.com/plugins/s2member/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Anonymous User

    (@anonymized-1391468)

    Managed to dig up the answer myself:

    $s2member_auto_eot_time = get_user_field ("s2member_auto_eot_time");
    if ($s2member_auto_eot_time != '') {
      $real_eot = $s2member_auto_eot_time - $GLOBALS['WS_PLUGIN__']['s2member']['o']['eot_grace_time'];
      $eotdate = new DateTime("@$real_eot");
      echo $eotdate->format('d-M-Y');
    } else {
      echo "never";
    }

    cool

    Where do you put this?

    Thread Starter Anonymous User

    (@anonymized-1391468)

    I put it into a shortcode using the Shortcode Exec PHP plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display EOT on front end excluding grace period’ is closed to new replies.