After the upgrade to 3.03 I had to re-install this hack and, as an outcome, here are the instructions for the countdown:
Install the hack
Add the following code to includes/functions.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';
}
Create a custom bb code function like this:
title: countdown
handle: fetch_countdown_timer
description: whatever you want
include file: [leave blank]
Update upon page refresh?: yes
Then create a custom bb code:
title: countdown
tag: countdown
function: countdown
replacement: [leave blank]
example: [countdown]1088859600[/countdown] (choose any unix timestamp here)
description: [whatever you want]
use parameter: no
button image: [any image you want]
Now, to make this usable to your users:
Add a link to a calculation script like this one (I did this on the editor toolbars):
http://www.php4scripte.de/umrechner/
it converts a real time into a unix timestamp which can then be used within the BB Code.
I'd really appreciate if one could help me to avoid the conversion between realtime and unix timestamp... so the function can work with realtime formats