PDA

View Full Version : Countdown


Sinclair
07-01-2002, 10:00 PM
German user please read after the english instructions!

(sorry for my terrible english ;))
This hack allow the users to show an personal countdown.
Tag: year,month,day,hour,minute,second.

how to install this hack? :

admin/functions.php

return censortext($bbcode);

}

before that add:
preg_match("/(\[)(countdown)(])(\r\n)*([^\"]*)(\[\/countdown\])/siU", $bbcode, $datum1);
$bbcode = preg_replace("/(\[)(countdown)(])(\r\n)*([^\"]*)(\[\/countdown\])/siU", countdowndate($datum1[0]), $bbcode);

find:
// ###################### Start show_nopermission #######################
function show_nopermission() {

before that add:
// ##### Countdown Hack by Sinclair (jeff@star-trek-forum.net) ######
function countdowndate($date2) {

$date=explode(",",$date2);

$date[0]=str_replace("[countdown]", "", $date[0]);
$jahr=intval($date[0]);
$monat=intval($date[1]);
$tag=intval($date[2]);
$stunde=intval($date[3]);
$minute=intval($date[4]);
$sekunde=intval($date[5]);

$target = mktime($stunde,$minute,$sekunde,$monat,$tag,$jahr) ;
$diff = $target - time();

$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;

$out= "$days days, $hours hours, $minutes minutes, $seconds seconds";

return $out;

}

Thats all!

########### german ###########

Mit diesem Hack k?nnen eure User einen individuellen Countdown einblenden.
Der Tag lautet: Jahr,Monat,Tag,Stunde,Minute,Sekunde

Installation:

admin/functions.php

Finde:
return censortext($bbcode);

}

Dar?ber f?ge folgendes ein:
preg_match("/(\[)(countdown)(])(\r\n)*([^\"]*)(\[\/countdown\])/siU", $bbcode, $datum1);
$bbcode = preg_replace("/(\[)(countdown)(])(\r\n)*([^\"]*)(\[\/countdown\])/siU", countdowndate($datum1[0]), $bbcode);

Finde:
// ###################### Start show_nopermission #######################
function show_nopermission() {

Dar?ber f?ge folgendes ein:
// ##### Countdown Hack by Sinclair (jeff@star-trek-forum.net) ######
function countdowndate($date2) {

$date=explode(",",$date2);

$date[0]=str_replace("[countdown]", "", $date[0]);
$jahr=intval($date[0]);
$monat=intval($date[1]);
$tag=intval($date[2]);
$stunde=intval($date[3]);
$minute=intval($date[4]);
$sekunde=intval($date[5]);

$target = mktime($stunde,$minute,$sekunde,$monat,$tag,$jahr) ;
$diff = $target - time();

$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;

$out= "$days Tage, $hours Stunden, $minutes Minuten, $seconds Sekunden";

return $out;

}

F?r weitere Fragen stehe ich in diesem Thread zur Verf?gung!

MrLister
07-02-2002, 01:55 PM
screenshot maybe?

firewars
07-02-2002, 05:48 PM
This, for example, didn't work for me:


2002,07,18,12,00,00

Velocd
07-02-2002, 06:34 PM
I could have sworn this was released...but I'm too lazy to search for it ^_^

Chris M
07-02-2002, 06:47 PM
It has been before...

Satan

KevinG
07-03-2002, 01:19 AM
I made one here (https://vborg.vbsupport.ru/showthread.php?s=&threadid=38179) back on May3, 2002.
Maybe that's the one you remember seeing. :disappointed:

Sinclair
07-06-2002, 09:36 AM
Ops...
@Mods
please remove this thread....

jamoss
09-16-2007, 08:39 PM
I have updated this to work as a plug-in for later versions of vbull:

https://vborg.vbsupport.ru/showthread.php?p=1340377