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!
(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!