View Single Post
Old 19-03-2005, 12:46   #1
Richard M
Inactive
 
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Help with something that should be obvious...

Hi guys, I'm having one of those moments where I'm so deep in code that I can't work out what should be obvious in this case.

The following is a bit of PHP code which executes a certain function depending on if the timestamp $userlastsync is less than 1 or 2 weeks ago.
I've set $warn_time to 10 minutes for debugging purposes because it appears to be executing both functions for no apparent reason.

Both $userlastsync and $warn_time are returned as Unix timestamps.

PHP Code:
$warn_time = strtotime("-10 minutes");
$alert_time = strtotime("-2 weeks");
if (
$alert_time > $userlastsync)
    {
        
do_alert();
    }
elseif (
$warn_time > $userlastsync )
    {
        
do_warn();
    } 
If this code right?
It looks right to me, that's the problem.
Because I've set the warn level to -10 minutes it should only be executing do_warn() based on the time given in the image in my sig.
Richard M is offline   Reply With Quote