Page 1 of 1

Time Expire Fix [HELP]

PostPosted: September 27th, 2011, 6:34 pm
by bakinblack
I have in the footer of my site showing users the time that thier accounts will expire. I am having a issues trying to figure out how to show users that have unlimited time that there is no expire date.

this is the code I am using

Code: Select all
<?php  if (is_user_logged_in()) {
          $user = wp_get_current_user();
          echo ' <strong>'.$user->display_name.'</strong>, ';
                        } else { ?>
                 Please <strong>
                  <?php wp_loginout(); ?>
                  </strong>
                 or <a href="<?php echo get_option('home'); ?>/wp-login.php?action=register"><strong>Register</strong></a>
                 <?php } ?>
                 </strong></font>
                
                 <font size="3" face="arial" color="black">You're time will expire on:</font> <br />
                
                 <font size="3" face="arial" color="black"><?php echo date('l F jS, Y', get_user_option('wp_s2member_auto_eot_time', $user_id));  ?></font>
               


This will echo to the user....

Billy, You're time will expire on:
Thursday January 1st, 1970

Users that have unlimted time see the "Thursday January 1st, 1970" I want that to be replaced with text just saying "Unlimited"


It would be so great if I can get some help on this. Thanks

Re: Time Expire Fix [HELP]

PostPosted: September 29th, 2011, 11:33 pm
by Cristián Lávaque
How would you know they have access forever? Do you give them a different level or just no EOT time? The problem with no EOT time would be that if you sell subscriptions, those users don't have an EOT time set until they actually end it (refund, no payment, etc.) Or do you only sell Buy Now access? In that case they would have an EOT time set since they purchase.

Re: Time Expire Fix [HELP]

PostPosted: September 29th, 2011, 11:43 pm
by bakinblack
What I mean to have is when users time have expired and they go to Subscriber they have no EOT I do not want them to see the Thurday, January 1st 1970 I want that replaced with a text saying "No Time Added" or something of that sort.

Re: Time Expire Fix [HELP]

PostPosted: October 1st, 2011, 5:06 am
by Cristián Lávaque
Ah, then you'd check for the Level 0 role in the condition for that. WP Admin -> s2Member -> API / Scripting -> Advanced/PHP Conditionals

Code: Select all
if (current_user_is('s2member_level0')) { 
   echo 
'No Time Added';
}