PHP Code:
// ###################### Start fetch_countdown_timer ######################
// returns the time left untill $dateline
function fetch_countdown_timer($dateline) {
global $vboptions;
$diff = $dateline - (time() - $vboptions['hourdiff']);
$days = ($diff - ($diff % 86400)) / 86400;
$diff = $diff - ($days * 86400);
$hours = ($diff - ($diff % 3600)) / 3600;
$diff = $diff - ($hours * 3600);
$minutes = ($diff - ($diff % 60)) / 60;
$diff = $diff - ($minutes * 60);
$seconds = ($diff - ($diff % 1)) / 1;
return iif($days > 0, $days.'d ', '').iif("$hours > 0 && $days != 0", $hours.'h ', '').$minutes.'m';
}
Add that to functions.php somewhere sensible, like before the end "downloaded" comment then do something like:
PHP Code:
$futureevent = fetch_countdown_timer(strtotime('June 24, 2002'));
Then $futureevent will contain a string like '5d 21h 32m'.