Artikel »
Tutorials »
Countdown Navbox als Content |
Countdown Navbox als Content
12.12.2006 von WEBI
Ihr wollt die Countdown Navbox von BooGT (Kit-Help) als Content in eure Startseite einbauen? Und wisst nicht wie? Das wird euch nun in diesem Tutorial erklärt.
Als erstes erstellt ihr mit einem Editor eine Datei Namens countdown.php.
In dieser Datei kommt nun folgender Inhalt:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | | PHP-Quelltext <?php
/////// Konfiguration
$hour = 16; // Stunden 0 ... 24
$minute = 0; // Minuten 0 ... 60
$second = 0; // Sekunden 0 ... 60
$month = 01; // Monate 1 ... 12
$day = 02; // Tage 1 ... 28/29/30/31
$year = 2007; // Jahr (vierstellig)
/////// Ab hier nichts mehr verändern
$secdiff = mktime($hour,$minute,$second,$month,$day,$year) - time();
$a = floor ($secdiff/86400);
$b = floor ($secdiff%86400/3600);
$c = floor ($secdiff%86400%3600/60);
$d = floor ($secdiff%86400%3600%60);
$text1 = "Noch "; $text2 = "Tage "; $text3 = "Stunden ";
$text4 = "Minuten "; $text5 = "und "; $text6 = "Sekunden "; $text7 = "bis zum Countdown Ende!";
if ($a < 2) $text2 = " Tag ";
if ($a < 1) $a = " " . $text2 = " ";
if ($b < 2) $text3 = " Stunde ";
if ($b < 1) $b = " " . $text3 = " ";
if ($c < 2) $text4 = " Minute ";
if ($c < 1) $c = " " . $text4 = " ";
if ($d < 2) $text6 = " Sekunde ";
if ($d < 1) $d = " " . $text6 = " ";
if ($d == 0) $text5 = " ";
if ($secdiff > 0)
eval ("\$site_body.= \"".getTemplate("countdown/countdown")."\";");
else
eval ("\$site_body.= \"".getTemplate("countdown/countdownend")."\";");
?> | |  |
Nun müssen 2 Templates erstellt werden:
1.) countdownend.htm
2.) countdown.htm
In das Template countdown.htm kommt nun folgender Inhalt:
| Quellcode <table class="standard" cellspacing="1" cellpadding="3" width="100%">
<tr>
<td class="heads"><b>Countdown</b></td>
</tr>
<tr>
<td class="standard" align="center"><b>$text1 $a $text2 $b $text3 $c $text4 $text5 $d $text6 $text7</b></td>
</tr>
</table> | |
und in das Template countdownend.htm dieser Inhalt:
| Quellcode <table class="standard" cellspacing="1" cellpadding="3" width="100%">
<tr>
<td class="heads"><b>Countdown</b></td>
</tr>
<tr>
<td class="standard" align="center"><b>Dein Text beim Ablauf</b></td>
</tr>
</table> | |
Nun erstellt im Ordner templates/ eures FTP einen Unterordner Namens countdown, in diesen Unterordner müssen nun die Beiden Templates geladen werden.
Die countdown.php kommt in das Root Verzeichniss, dort wo auch die include.php liegt.
Nun geht ihr in euer Admin Menü, unter Einstellungen > Startseite und fügt countdown.php hinzu, speichert dieses ab, und schon könnt ihr den Countdown auf eurer Startseite begutachten.
Falls etwas unklar sein sollte, oder es zu Komplikationen kommen sollte, so nutzt bitte unser Support Forum.
|
|