Ist es möglich den counter also die Tabelle mit der Class: "counterposition" auf eine andere Seite zu bringen?
Ich bräuchte das nämlich auf der Startseite meines Forums.
FERTIG - Counter extern verwenden?
- axi92
- Erledigt
Ich habe einen Blog Artikel verfasst - Wie benutze ich die Suche richtig - Bitte diesen beachten und auch umsetzen bevor Ihr ein Neues Thema eröffnet!
-
-
Dann musst du den gesamten Code des Counters, inkl. Datenbankzugriff auf die neue Seite bringen.
-
Wo finde ich diesen denn?
-
Der dürfte in der index.php sein. Wenn ich mich nicht irre. Dazu die CSS-Klassen.
-
Wenn ich die index.php kopiere und auf index1.php umbenenne und diese aufrufe springt er mir immer wieder in die index.php warum?
[edit]
Ich habe hier etwas gefunden womit man Files includen kann ohne den Inhalt auszugeben sprich ich bekomme die vars.
http://stackoverflow.com/quest…t-displaying-its-contentsAber beim Aufruf der neuen php wo die index.php included ist spricht er gleich zur index.php...
[/edit] -
Warum erstellst du eine neue Index? Du willst doch nur den Counter in dein Forum kopieren.
-
Ja aber ich weiß nicht was ich alles brauche an includes?
So dachte ich mir ich nehme einfach alles dann fehlt nichts -
Das kann ich dir aus dem Stehgreif auch nicht sagen. Da ist ein DIV für den Countdown, das du brauchst. Und ein Javascript für das Herunterzählen. Dann die Datenbank-Verbindung und ein paar Variablen, die gesetzt werden müssen. Mustt di mal die index.php in Ruhe genauer angucken und alle Teile herausschreiben.
-
Ist das JS in jquery.js drinnen?
-
-
Wo wird denn die DB verbindung hergestellt?
Ja logisch poste ich es wenn ich fertig bin =)[edit]Habt ihr nicht einen TS3 Server dann würde ich schneller voran kommen [/edit]
-
Hier das Fertige ist nicht sauber aber für meinen Zweck tut es =)
PHP- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <?php
- error_reporting(-1);
- header('content-type: text/html; charset=utf-8');
- //ob_start();
- require_once "include/inc.config.php";
- require_once "include/inc.functions.php";
- require_once "include/inc.functions.admin.php";
- require_once "include/inc.content.php";
- require_once "xajax/xajax_core/xajax.inc.php";
- mysql_connect($CONFIG['MYSQL']['SERVER'], $CONFIG['MYSQL']['USER'], $CONFIG['MYSQL']['PASS']);
- mysql_select_db($CONFIG['MYSQL']['DATENBANK']);
- // Spielinfos für Countdown auslesen
- $sql = mysql_query("SELECT * FROM ". $CONFIG['MYSQL']['PREFIX'] ."spiele WHERE date > UNIX_TIMESTAMP() ORDER BY date ASC LIMIT 1")
- OR die("Error: Spielinfos: <br>".mysql_error());
- $row = mysql_fetch_array($sql);
- $Eurozeit = $row['date'];
- $Heim = getTeamName($row['heim'],"short");
- $Gast = getTeamName($row['gast'],"short");
- $HeimName = getTeamName($row['heim']);
- $GastName = getTeamName($row['gast']);
- $HeimID = getTeamID($row['heim']);
- $GastID = getTeamID($row['gast']);
- $SpielID = $row['id'];
- $query = "SELECT date, id FROM ". $CONFIG['MYSQL']['PREFIX'] ."spiele WHERE date >= ". $Eurozeit ." AND id <> ". $SpielID ." ORDER BY date ASC LIMIT 1";
- $Eurozeit2 = mysql_result(mysql_query($query), 0);
- $query = "SELECT id FROM ". $CONFIG['MYSQL']['PREFIX'] ."spiele WHERE date >= UNIX_TIMESTAMP() AND id <> ". $SpielID ." ORDER BY date ASC LIMIT 1";
- $SpieleID2 = mysql_result(mysql_query($query), 0);
- $query = "SELECT short, name FROM ". $CONFIG['MYSQL']['PREFIX'] ."spiele, ". $CONFIG['MYSQL']['PREFIX'] ."teams WHERE ". $CONFIG['MYSQL']['PREFIX'] ."spiele.heim = ". $CONFIG['MYSQL']['PREFIX'] ."teams.id AND ". $CONFIG['MYSQL']['PREFIX'] ."spiele.id = '$SpieleID2'";
- $Heim2Row = mysql_fetch_row(mysql_query($query));
- $Heim2 = $Heim2Row[0];
- $Heim2Name = $Heim2Row[1];
- $query = "SELECT short,name FROM ". $CONFIG['MYSQL']['PREFIX'] ."spiele, ". $CONFIG['MYSQL']['PREFIX'] ."teams WHERE ". $CONFIG['MYSQL']['PREFIX'] ."spiele.gast = ". $CONFIG['MYSQL']['PREFIX'] ."teams.id AND ". $CONFIG['MYSQL']['PREFIX'] ."spiele.id = '$SpieleID2'";
- $Gast2Row = mysql_fetch_row(mysql_query($query));
- $Gast2 = $Gast2Row[0];
- $Gast2Name = $Gast2Row[1];
- ?>
- <!-- Serverzeit -->
- <script type="text/javascript">
- <?php echo "var timeoffset = ". ((($CONFIG['TIME']['OFFSET']['HOURS'] *60) + $CONFIG['TIME']['OFFSET']['MINUTES']) *60) .";"; ?>
- </script>
- <script src="include/scripts/inc.servertime.php" type="text/javascript"></script>
- <script src="include/scripts/serverzeit.js" type="text/javascript"></script>
- <script type="text/javascript">
- // Spielzeit für Countdown an Javascript übergeben
- var Eurozeit = new Date("<?php echo $Eurozeit; ?>" * 1000);
- // Dynamische Uhrzeit und Spiel-Countdown aufrufen
- function UhrzeitAnzeigen()
- {
- if (!document.all && !document.getElementById)
- {
- return;
- }
- CountDown();
- ServerZeit();
- // Aufruf jede Sekunde (1000 Millisekunden) - Hier kann etwas Feintuning am Wert (1000) die Zeitanzeige optimieren (langsamer/schneller)
- setTimeout("UhrzeitAnzeigen()", 1000);
- }
- function CountDown()
- {
- if (Eurozeit.getTime() - tss.getTime() > 0)
- {
- var diff = new Date();
- diff.setTime(Eurozeit.getTime() - tss.getTime());
- var timediff = diff.getTime();
- var tage = Math.floor(timediff / (1000 * 60 * 60 * 24));
- timediff -= tage * (1000 * 60 * 60 * 24);
- var stunden = Math.floor(timediff / (1000 * 60 * 60));
- timediff -= stunden * (1000 * 60 * 60);
- var minuten = Math.floor(timediff / (1000 * 60));
- timediff -= minuten * (1000 * 60);
- var sekunden = Math.floor(timediff / 1000);
- timediff -= sekunden * 1000;
- var a = new Array('tage', 'stunden', 'minuten', 'sekunden');
- for (var i = 0; i < a.length; i++)
- {
- var el = document.getElementById('countdown_' + a[i]);
- if (!el) continue;
- eval("var val = " + a[i] + ";");
- if ((i > 0) && (val < 10))
- val = '0' + val;
- if ((i < 2) && (val == 0))
- val = '0';
- if (val != el.innerHTML)
- el.innerHTML = val;
- }
- }
- }
- </script>
- <style>
- #servertime
- {
- display: none;
- }
- </style>
- </head>
- <body onload="UhrzeitAnzeigen();">
- <div id="center">
- <div id="countdowninput">
- <table class="counterposition" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td>
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td class="countertext" colspan="5" style="text-align:center;"><b> SPIEL COUNTDOWN</b></td>
- </tr>
- <?php
- $NameH = $HeimName;
- $ShortNameH = $Heim;
- $NameG = $GastName;
- $ShortNameG = $Gast;
- if ($Eurozeit == $Eurozeit2)
- {
- $NameH2 = $Heim2Name;
- $ShortNameH2 = $Heim2;
- $NameG2 = $Gast2Name;
- $ShortNameG2 = $Gast2;
- }
- // Turnierwoche des Spiels ermitteln
- $SpielWoche = 1;
- $ar = getDateList();
- foreach ($ar as $i => $val)
- {
- if ($Eurozeit <= $val['ende'])
- {
- $SpielWoche = $i;
- break;
- }
- }
- ?>
- <tr width="100%">
- <td class="countercountrytext" style="font-weight:bold; text-align:right; padding-right:5px;"
- onClick="location.href='<?php echo $CONFIG['PATH'].gLink() ."statistik/teams/". strtoupper($ShortNameH); ?>'"
- onMouseOver="this.style.cursor='pointer';" onMouseOut="this.style.cursor='auto';">
- <?php echo $NameH; ?>
- </td>
- <td style="padding-right:10px;">
- <a href="<?php echo $CONFIG['PATH'].gLink() ."statistik/teams/". strtoupper($ShortNameH); ?>">
- <img src="img/tflags/<?php echo $ShortNameH; ?>.png"
- alt="Flagge <?php echo $NameH; ?>" title="Link zur Teamstatistik von <?php echo $NameH; ?>"
- height="11px" width="22px" style="border:1px solid #aaaaaa;" />
- </a>
- </td>
- <td>
- <a href="<?php echo $CONFIG['PATH'].gLink() ."tippen/wochen/". $SpielWoche; ?>">
- <img src="img/goal.gif"
- alt="vs" title="Link zur Tippabgabe des Spiels <?php echo $NameH;?> gegen <?php echo $NameG; ?>"
- height="17" width="17" style="border:0px;" />
- </a>
- </td>
- <td style="padding-left:10px;">
- <a href="<?php echo $CONFIG['PATH'].gLink() ."statistik/teams/". strtoupper($ShortNameG); ?>">
- <img src="img/tflags/<?php echo $ShortNameG; ?>.png"
- alt="Flagge <?php echo $NameG; ?>" title="Link zur Teamstatistik von <?php echo $NameG; ?>"
- height="11px" width="22px" style="border:1px solid #aaaaaa;" />
- </a>
- </td>
- <td class="countercountrytext" style="font-weight:bold; text-align:left; padding-left:5px;"
- onClick="location.href='<?php echo $CONFIG['PATH'].gLink() ."statistik/teams/". strtoupper($ShortNameG); ?>'"
- onMouseOver="this.style.cursor='pointer';" onMouseOut="this.style.cursor='auto';">
- <?php echo $NameG; ?>
- </td>
- </tr>
- <?php
- if ($Eurozeit == $Eurozeit2)
- {
- ?>
- <tr width="100%">
- <td class="countercountrytext" style="font-weight:bold; text-align:right; padding-right:5px;"
- onClick="location.href='<?php echo $CONFIG['PATH'].gLink() ."statistik/teams/". strtoupper($ShortNameH2); ?>'"
- onMouseOver="this.style.cursor='pointer';" onMouseOut="this.style.cursor='auto';">
- <?php echo $NameH2; ?>
- </td>
- <td style="padding-right:10px;">
- <a href="<?php echo $CONFIG['PATH'].gLink() ."statistik/teams/". strtoupper($ShortNameH2); ?>">
- <img src="img/tflags/<?php echo $ShortNameH2; ?>.png"
- alt="Flagge <?php echo $NameH2; ?>" title="Link zur Teamstatistik von <?php echo $NameH2; ?>"
- height="11px" width="22px" style="border:1px solid #aaaaaa;" />
- </a>
- </td>
- <td>
- <a href="<?php echo $CONFIG['PATH'].gLink() ."tippen/wochen/". $SpielWoche; ?>">
- <img src="img/goal.gif"
- alt="vs" title="Link zur Tippabgabe des Spiels <?php echo $NameH2;?> gegen <?php echo $NameG2; ?>"
- height="17" width="17" style="border:0px;" />
- </a>
- </td>
- <td style="padding-left:10px;">
- <a href="<?php echo $CONFIG['PATH'].gLink() ."statistik/teams/". strtoupper($ShortNameG2); ?>">
- <img src="img/tflags/<?php echo $ShortNameG2; ?>.png"
- alt="Flagge <?php echo $NameG2; ?>" title="Link zur Teamstatistik von <?php echo $NameG2; ?>"
- height="11px" width="22px" style="border:1px solid #aaaaaa;" />
- </a>
- </td>
- <td class="countercountrytext" style="font-weight:bold; text-align:left; padding-left:5px;"
- onClick="location.href='<?php echo $CONFIG['PATH'].gLink() ."statistik/teams/". strtoupper($ShortNameG2); ?>'"
- onMouseOver="this.style.cursor='pointer';" onMouseOut="this.style.cursor='auto';">
- <?php echo $NameG2; ?>
- </td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- <center>
- <table cellpadding="0" cellspacing="0" style="padding-right:20px;">
- <tbody>
- <tr>
- <td class="counter">
- <div id="countdown_tage" style="display:block; float:left; width:30px;"></div>
- </td>
- <td class="space"></td>
- <td class="counter">
- <div id="countdown_stunden" style="display:block; float:left; width:20px;"></div>
- </td>
- <td class="space">:</td>
- <td class="counter">
- <div id="countdown_minuten" style="display:block; float:left; width:20px;"></div>
- </td>
- <td class="space">:</td>
- <td class="counter">
- <div id="countdown_sekunden" style="display:block; float:left; width:20px;"></div>
- </td>
- </tr>
- <tr>
- <td class="txt" style="text-align:right;">TAGE</td>
- <td style="WIDTH: 20px"></td>
- <td class="txt"> STD</td>
- <td style="WIDTH: 10px"></td>
- <td class="txt"> MIN</td>
- <td style="WIDTH: 10px"></td>
- <td class="txt"> SEK</td>
- </tr>
- </tbody>
- </table>
- </center>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div id="servertime" class="cont">
- <span id="Uhrzeit"></span>
- </div>
- </body>
- </html>
- <?php
- //ob_end_flush()
- ?>