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™

outputting end of term

s2Member Plugin. A Membership plugin for WordPress®.

outputting end of term

Postby halifaxious » October 10th, 2011, 10:04 am

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
User avatar
halifaxious
Registered User
Registered User
 
Posts: 11
Joined: May 13, 2011

Re: outputting end of term

Postby Eduan » October 10th, 2011, 2:29 pm

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 :) .
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron