Raised This Month: $ Target: $400
 0% 

Best method to use ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 04-10-2011 , 10:55   Best method to use ?
Reply With Quote #1

What is the best method to use Time if I would like to add hours/days to the Current time, and how could I check is the time expired ? Something like a BAN System with MySql...
reinert is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-10-2011 , 11:05   Re: Best method to use ?
Reply With Quote #2

get_systime()
Nyuszy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-10-2011 , 20:52   Re: Best method to use ?
Reply With Quote #3

When you ban them you need to store the "expiration" time:

get_systime() + bantime_in_seconds

Then, when you check to see if they are still banned you do:

Code:
if( get_user_ban_expiration(id) > get_systime() )
{
    // User is still banned
}
__________________
fysiks is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 04-11-2011 , 00:16   Re: Best method to use ?
Reply With Quote #4

Thanks,
reinert is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode