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™

Time Expire Fix [HELP]

s2Member Plugin. A Membership plugin for WordPress®.

Time Expire Fix [HELP]

Postby bakinblack » September 27th, 2011, 6:34 pm

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
User avatar
bakinblack
Registered User
Registered User
 
Posts: 7
Joined: September 2, 2011

Re: Time Expire Fix [HELP]

Postby Cristián Lávaque » September 29th, 2011, 11:33 pm

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Time Expire Fix [HELP]

Postby bakinblack » September 29th, 2011, 11:43 pm

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.
User avatar
bakinblack
Registered User
Registered User
 
Posts: 7
Joined: September 2, 2011

Re: Time Expire Fix [HELP]

Postby Cristián Lávaque » October 1st, 2011, 5:06 am

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';
}
 
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron