Ich versuche Online anzeige einzubauen aber mir werden keine zahlen angezeigt was mache ich falsch bitte um hilfe
Bitte melden Sie sich an, um diesen Link zu sehen.
PHP
- <<!-- Online/Offline Status -->
- <div class="online-status">
- <?php
- $serverip = "Extra raus genommen";
- $ip = gethostbyname($serverip);
- $portlist=array(23070,24070,25070,26070,3306,3306); // Den port den ihr sehen wollt
- $status=array("Channel 1:", "Channel 2:","Channel 3:","Channel 4:", "Datenbank:", "Teamspeak3:",); // Bezeichnung
- $i=0;
- echo '<table style="border-spacing:0px;border-collapse:inherit;"><tbody>';
- foreach ($portlist as $port){
- $online = @fsockopen($ip, $port, $errno, $errstr, 1);
- if ($online)
- {
- echo '<tr style="height:20px;line-height:20px;"><td>'.$status[$i].'</td><td><span style="color:green;">Online</span></td></tr>';
- }
- else
- {
- echo '<tr style="height:20px;line-height:20px;"><td>'.$status[$i].'</td><td><span style="color:red;">Offline</span></td></tr>';
- }
- @fclose($online);
- $i++;
- }
- $result1 = mysqli_fetch_assoc(mysqli_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 30 MINUTE) < last_play"));
- $result2 = mysqli_fetch_assoc(mysqli_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 24 HOUR) < last_play"));
- $result3 = mysqli_fetch_assoc(mysqli_query("SELECT COUNT(id) AS count FROM account.account"));
- $result4 = mysqli_fetch_assoc(mysqli_query("SELECT COUNT(id) AS count FROM player.player"));
- $result5 = mysqli_fetch_assoc(mysqli_query("SELECT COUNT(id) AS count FROM player.guild"));
- echo '<tr style="height:20px;line-height:20px;"><td>Spieler online:</td><td><span style="color:green;">'.$result1['count'].'</td>';
- echo '<tr style="height:20px;line-height:20px;"><td>Spieler online (24h):</td><td><span style="color:green;">'.$result2['count'].'</td>';
- echo '<tr style="height:20px;line-height:20px;"><td>Accounts Gesamt:</td><td><span style="color:green;">'.$result3['count'].'</td>';
- echo '<tr style="height:20px;line-height:20px;"><td>Chars Gesamt:</td><td><span style="color:green;">'.$result4['count'].'</td>';
- echo '<tr style="height:20px;line-height:20px;"><td>Gilden Gesamt:</td><td><span style="color:green;">'.$result5['count'].'</td>';
- echo '</table></tbody>';
- ?>
- </div><div class="clear"></div>