Page 1 of 1

outputting end of term

PostPosted: October 10th, 2011, 10:04 am
by halifaxious
My site has both automatic EOTs from PayPal and manual EOTs from people paying by cheque. So far as I can determine, these values are kept in different fields and I'm not clear exactly which fields are the most appropriate to use. Right now I've made this shortcode:

Code: Select all
function ASH_expiry_func( $atts ) {
   $ts=get_user_field ("s2member_auto_eot_time");//EOT set manually
   if(!$ts){
      $ts=get_user_field(s2member_last_payment_time);//user paid by PayPal
      if(current_user_can('administrator')){//admin will have no $ts
         return 'n/a';
      } else{
         $eot=new DateTime("@$ts");
         $eot->modify('+1 year');
      }
   } else {
      $eot = date_create("@$ts");
   }
   
   return $eot->format('Y-m-d');
}
add_shortcode( 'ASH_expiry', 'ASH_expiry_func' );


But I have a feeling that s2member has something that already does the above. I just can't find it. Is there such a thing, and if there is not, am I using the correct fields in my function?

Thanks,
Jen

Re: outputting end of term

PostPosted: October 10th, 2011, 2:29 pm
by Eduan
I don't know if this helps but you can find the automatic EOT's configuration file under s2member folder\s2member\includes\classes -> in the file auto-eots.inc.php.

And here's the link to the s2Member codex documentation about automatic EOT's:
viewtopic.php?f=40&t=12484&src_doc_v=111003
viewtopic.php?f=40&t=12481&src_doc_v=111003

Hope this helps :) .