Frage zur Status.inc für Homepage

09/18/2016 18:32 jonny1988#1
Nabend,

kann mir jemand einmal erklären was ich schreiben muss damit die status.inc mir folgendes anzeigt:

Registrierte Accounts
Registrierte Gilden
Yang Gesamt
09/19/2016 22:37 </nQQpls>#2
Zeig uns doch mal Deine aktuelle status.inc.php - Dann erweitere ich sie Dir eben.
09/20/2016 16:46 jonny1988#3
Quote:
Originally Posted by _nQQpls View Post
Zeig uns doch mal Deine aktuelle status.inc.php - Dann erweitere ich sie Dir eben.
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<?php

$serverip = "xxx.xxx.xx.xxx";
$ip = gethostbyname($serverip);
$portlist=array(15001,25001,23070,3306); // Ports
$status=array("Login Server:", "Char Server:", "World Server:", "Mysql Server:"); // Bezeichnung
$i=0;

echo '<table style="border-spacing:0px;border-collapse:inherit;"><tbody>';

foreach ($portlist as $port){

$online = @[Only registered and activated users can see links. Click Here To Register...]ckopen($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>';
}
@[Only registered and activated users can see links. Click Here To Register...]ose($online);
$i++;
}

$result1 = mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 5 MINUTE) < last_play"));
$result2 = mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 24 HOUR) < last_play"));

echo '<tr style="height:20px;line-height:20px;"><td>Spieler online:</td><td>'.$result1['count'].'</td>';
echo '<tr style="height:20px;line-height:20px;"><td>Spieler online: (24h):</td><td>'.$result2['count'].'</td>';
echo '<tr style="height:20px;line-height:20px;"><td>Accounts Gesamt:</td><td>'.$result3['count'].'</td>';
echo '<tr style="height:20px;line-height:20px;"><td>Chars Gesamt:</td><td>'.$result4['count'].'</td>';
echo '<tr style="height:20px;line-height:20px;"><td>Gilden Gesamt:</td><td>'.$result5['count'].'</td>';
echo '<tr style="height:20px;line-height:20px;"><td>Yang Gesamt:</td><td>'.$result6['count'].'</td>';

?>



ANzeigen tut er aufgrund dessen das ich nicht weiß wie ich das abfrage nur Spieler Online und Spieler Online letzte 24h

Ich hab unter Accounts gesamt schon versucht die Tabelle Accounts.Accounts aus zu lesen aber leider erfolglos.
09/20/2016 19:47 </nQQpls>#4
Bin am Handy und werde es Dir deshalb nicht einrücken oder gar aufräumen, aber hier:

PHP Code:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<?php

$serverip 
"xxx.xxx.xx.xxx";
$ip gethostbyname($serverip);
$portlist=array(15001,25001,23070,3306); // Ports
$status=array("Login Server:""Char Server:""World Server:""Mysql Server:"); // Bezeichnung
$i=0;

echo 
'<table style="border-spacing:0px;border-collapse:inherit;"><tbody>';

foreach (
$portlist as $port){

$online = [MENTION=4006698]fso[/MENTION]ckopen($ip$port$errno$errstr1);
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>';
}  [
MENTION=1573946]fcl[/MENTION]ose($online);
$i++;
}

$result1 mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 5 MINUTE) < last_play"));
$result2 mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 24 HOUR) < last_play"));
$result3 mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM account.account"));
$result4 mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player"));
$result5 mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.guild"));
$result6 mysql_fetch_assoc(mysql_query("SELECT SUM(gold) AS count FROM player.player"));

echo 
'<tr style="height:20px;line-height:20px;"><td>Spieler online:</td><td>'.$result1['count'].'</td>';
echo 
'<tr style="height:20px;line-height:20px;"><td>Spieler online: (24h):</td><td>'.$result2['count'].'</td>';
echo 
'<tr style="height:20px;line-height:20px;"><td>Accounts Gesamt:</td><td>'.$result3['count'].'</td>';
echo 
'<tr style="height:20px;line-height:20px;"><td>Chars Gesamt:</td><td>'.$result4['count'].'</td>';
echo 
'<tr style="height:20px;line-height:20px;"><td>Gilden Gesamt:</td><td>'.$result5['count'].'</td>';
echo 
'<tr style="height:20px;line-height:20px;"><td>Yang Gesamt:</td><td>'.$result6['count'].'</td>';

?>
Und nutze bitte nächstes mal die passendes Tags, damit man es wenigstens ordentlich auslesen oder kopieren kann :-)
09/21/2016 00:43 jonny1988#5
Oooj sry, ja schreibe vom Handy da sieht man das nicht immer, aber THX Klappt wunderbar