I have installed this hack so far since I was looking for something that enables me to use php functions in bbcodes...
But I'm fiddling around and it's not working....
Here's the function to include:
PHP Code:
<?php
// ###################### 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';
}
?>
Now I added a function like this:
Title: countdown
Handle: fetch_countdown_timer
Include File: countdown.php (containing above code)
Also I added a bbcode 'countdown' and have choosen the function in there....
It's just not working, what am I doing wrong?
As an example I used
[countdown]03, July 2004[/countdown] and the function returns something like -13h -40m instead of 11d and something....
How do I pass the date of interest to the function?