Quote:
Originally Posted by Dean C
You can't default the variables to 0, that'll make it TIMENOW - 0 when you multiply anything by it.
|
Exactly, Dean. That's what you want to happen.
And, no Saber. That's not what I was saying
My board is down right now so I can't test this, but I imagine it would look like this:
Code:
else
{
$_REQUEST['do'] = 'getdaily';
if (($days < 1)AND(!$hours)AND(!$minutes)AND(!$seconds))
{
$days = 1;
$hours = 0;
$minutes = 0;
$seconds = 0;
}
elseif($days < 1) {
$days = 0;
}
$datecut = TIMENOW - (($days*24*60*60) + ($hours*60*60) + ($minutes*60) + $seconds);
}
Doing it this way doesn't mess up the original usage - if no variables are set, it should default to 1 day. If any combination of days, hours or minutes are set though, it should work.
Within that elseif block, you should check to see if the hours, minutes and seconds are properly set and initialize them to 0 if not.