Register for your free account! | Forgot your password?

You last visited: Today at 00:14

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Status.PhP -.-

Discussion on Status.PhP -.- within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2012
Posts: 854
Received Thanks: 635
Status.PhP -.-

Kann mir mal jemand die ports da richtig einstellen irgend wie klapps net eqal
was ich mach xD..


PHP Code:
<?PHP
$ip 
'***.**.*.**';
$portlist=array(11002);
$i=0;
foreach  (
$portlist as $port){
 
$online = @fsockopen($ip$port$errno$errstr1);
 if (!
$online)
 {
  echo 
'Test: <font color="#FF0000">offline</font>';
  $
$onliner[$i] = "1";
 }
 else
 {
  echo 
'Test: <font color="#00CC00">online</font>';
  $
$onliner[$i] = "0";
 }
 @
fclose($online);
$i++;
}
?><br>
<?PHP
$ip 
'***.**.*.**';
$portlist=array(3306);
$i=0;
foreach  (
$portlist as $port){
 
$online = @fsockopen($ip$port$errno$errstr1);
 if (!
$online)
 {
  echo 
'Mysql: <font color="#FF0000">offline</font>';
  $
$onliner[$i] = "1";
 }
 else
 {
  echo 
'Mysql: <font color="#00CC00">online</font>';
  $
$onliner[$i] = "0";
 }
 @
fclose($online);
$i++;
}
?>
<br>
<?PHP
$ip 
'***.**.*.**';
$portlist=array(13001);
$i=0;
foreach  (
$portlist as $port){
 
$online = @fsockopen($ip$port$errno$errstr1);
 if (!
$online)
 {
  echo 
'Login: <font color="#FF0000">offline</font>';
  $
$onliner[$i] = "1";
 }
 else
 {
  echo 
'Login: <font color="#00CC00">online</font>';
  $
$onliner[$i] = "0";
 }
 @
fclose($online);
$i++;
}
?>
<br>
<?PHP
$ip 
'***.**.*.**';
$portlist=array(13001);
$i=0;
foreach  (
$portlist as $port){
 
$online = @fsockopen($ip$port$errno$errstr1);
 if (!
$online)
 {
  echo 
'Char: <font color="#FF0000">offline</font>';
  $
$onliner[$i] = "1";
 }
 else
 {
  echo 
'Char: <font color="#00CC00">online</font>';
  $
$onliner[$i] = "0";
 }
 @
fclose($online);
$i++;
}
?>
<br>
<?PHP
$ip 
'***.**.*.**';
$portlist=array(13003);
$i=0;
foreach  (
$portlist as $port){
 
$online = @fsockopen($ip$port$errno$errstr1);
 if (!
$online)
 {
  echo 
'World: <font color="#FF0000">offline</font>';
  $
$onliner[$i] = "1";
 }
 else
 {
  echo 
'World: <font color="#00CC00">online</font>';
  $
$onliner[$i] = "0";
 }
 @
fclose($online);
$i++;
}
?>
EDIT: Daroo files..
.SonGoku™ is offline  
Thanks
1 User
Old 04/14/2012, 23:28   #2
 
xllMethoXx's Avatar
 
elite*gold: 14
Join Date: Dec 2011
Posts: 728
Received Thanks: 646
PHP Code:
<h2>News</h2>
<?PHP

if(isset($_GET['id']) && checkInt($_GET['id']))
{
  
$sqlNews "SELECT * FROM ".SQL_HP_DB.".news WHERE anzeigen>0 AND id='".mysql_real_escape_string($_GET['id'])."' LIMIT 1";
  
$qryNews mysql_query($sqlNews,$sqlHp);
  if(
mysql_num_rows($qryNews)>0)
  {
    while(
$getNews mysql_fetch_object($qryNews))
    {
      echo
'<div class="newsblock">';
      echo
'<h3>['.$newsKategorien[$getNews->kategorie].'] <b>'.$getNews->titel.'</b></h3>';
      echo
'<p>'.x_nl2br($getNews->inhalt).'</p>';
      if(
$newsKategorien[$getNews->kategorie]=='Event')
      {
        echo
'<p class="footer">Geplant am <b>'.getDatum($getNews->datum).'</b> um <b>'.getZeit($getNews->datum).' Uhr</b></p>';
      }
      else
      {
        echo
'<p class="footer">Verfasst am <b>'.getDatum($getNews->datum).'</b> um <b>'.getZeit($getNews->datum).' Uhr</b></p>';
      }
      echo
'</div>';
    }
  }
  else 
  {
    echo
'<p class="meldung">Die ID existiert nicht.</p>';
  }
  echo
'<p><a href="index.php?s=news">zurück</a></p>';
}
else
{
  
$sqlNews "SELECT * FROM ".SQL_HP_DB.".news WHERE anzeigen>0 AND kategorie!=2 ORDER BY datum DESC LIMIT 10";
  
$qryNews mysql_query($sqlNews,$sqlHp);
  
  while(
$getNews mysql_fetch_object($qryNews))
  {
    
$newsText = (strlen($getNews->inhalt)>400) ? substr($getNews->inhalt,0,strpos($getNews->inhalt,' ',400)).'... <a href="index.php?s=news&id='.$getNews->id.'">mehr lesen</a>' $getNews->inhalt;
    echo
'<div class="newsblock">';
    echo
'<h3>['.$newsKategorien[$getNews->kategorie].'] <b><a href="index.php?s=news&id='.$getNews->id.'">'.$getNews->titel.'</a></b></h3>';
    echo
'<p>'.x_nl2br($newsText).'</p>';
    echo
'<p class="footer">Verfasst am <b>'.getDatum($getNews->datum).'</b> um <b>'.getZeit($getNews->datum).' Uhr</b></p>';
    echo
'</div>';
  }
}

?>
<?php
$query 
"SELECT id FROM account.account";
    
$result mysql_query($query,$sqlServ);
    
$account_rows mysql_num_rows($result);
    
$query "SELECT * FROM player.guild";
    
$result mysql_query($query,$sqlServ);
    
$guild_rows mysql_num_rows($result);
    
$query "SELECT name FROM player.player";
    
$result mysql_query($query,$sqlServ);
    
$player_rows mysql_num_rows($result);
    
mysql_select_db("player");
$output mysql_query("SELECT COUNT(*) as count FROM player WHERE DATE_SUB(NOW(), INTERVAL 25 MINUTE) < last_play;");
$online_count mysql_fetch_object($output)->count;

?>
<?php
include "./inc/dbsettings.php";
$ip gethostbyname($serverip);
$portlist=array(13000);
$onliner=array("Channel1");
$server=array("Channel1");
$i=0;
foreach  (
$portlist as $port){
    
$online = @fsockopen($ip$port$errno$errstr1);
    if (!
$online)
    {
        
$ch1 "<span style='color: green'>Online</span>";
    }
    else
    {
        
$ch1 "<span style='color: red'Offline</span>";
    }
    @
fclose($online);
$i++;
}
?>
<?php
include "./inc/dbsettings.php";
$ip gethostbyname($serverip);
$portlist=array(16000);
$onliner=array("Channel2");
$server=array("Channel2");
$i=0;
foreach  (
$portlist as $port){
    
$online = @fsockopen($ip$port$errno$errstr1);
    if (!
$online)
    {
        
$ch2 "<span style='color: green'>Online</span>";
    }
    else
    {
        
$ch2 "<span style='color: red'Offline</span>";
    }
    @
fclose($online);
$i++;
}

?>

<table cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td>Channel 1</td>
                                <td><?php echo $ch1?></td>                                
                            </tr>
                            <tr class="border">
                                <td>Channel 2</td>
                                <td><?php echo $ch2?></td>                                
                            </tr>
                            <tr>
                                <td>Spieler Online</td>
                                <td><?php echo $online_count?></td>                                
                            </tr>
                            <tr class="border">
                                <td>Accounts</td>
                                <td><?php echo $account_rows?></td>                                
                            </tr>
                            <tr>
                                <td>Charaktere</td>
                                <td><?php echo $player_rows?></td>                                
                            </tr>
                            <tr>
                                <td>Erstellte Gilden</td>
                                <td><?php echo $guild_rows?></td>                                
                            </tr>
                            <tr style="line-height: 5px;"><td>&nbsp;</td><td>&nbsp;</td></tr>
                        </tbody>
                    </table>
Ändere die Ports & es passt
xllMethoXx is offline  
Old 04/14/2012, 23:46   #3


 
.Marcel''s Avatar
 
elite*gold: 100
Join Date: Sep 2009
Posts: 8,143
Received Thanks: 2,763
Seit wann speichert man in einem Array 1 Wert? total sinnfrei...

Um deinen Serverstatus anzeigen zu lassen kannste auch das hier nehmen:

PHP Code:
$serverip         =     'SERVERIP';
$selectip         =     gethostbyname($serverip);
$portliste         =    array(
    
'PORT',
    
'PORT',
    
'PORT'
); 
$server            =    array(
    
'Login Server:',
    
'Char Server:',
    
'World Server:'
);
$i                =    0;
foreach(
$portliste as $port){
    echo 
$server[$i].'<br />';
    
$online        =    fsockopen($selectip$port);
    if(!
$online){
        echo    
'<td><img src=offline.png /></td>';
    }else{
        echo    
'<td><img src=img/online.png /><br /></td>';
    }
    
$i++;
    
$close fclose($online);

.Marcel' is offline  
Old 04/14/2012, 23:59   #4


 
Whoknowsit's Avatar
 
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
Ausgehend von deinem Script, hier mal mein "Korrekturvorschlag":

PHP Code:
<?php
$ip 
'***.**.*.**'
$portlist = array(
    
'Test' => 11002,
    
'MySQL' => 3306,
    
'Login' => 13001,
    
'Char' => 13001,
    
'World' => 13003
);

$i 0;

foreach  (
$portlist as $service => $port){ 
    
$online = @fsockopen($ip$port$errno$errstr1);
    echo 
$service.': '.($online === FALSE '<font color="#FF0000">Offline</font>' '<font color="#00CC00">Online</font>').'<br />';
    @
fclose($online); 
    
$i++; 
}
Whoknowsit is offline  
Old 04/15/2012, 15:30   #5
 
elite*gold: 0
Join Date: Jan 2012
Posts: 854
Received Thanks: 635
Danke euch mal
.SonGoku™ is offline  
Thanks
1 User
Old 04/15/2012, 15:37   #6
 
elite*gold: 7
Join Date: Apr 2012
Posts: 1,935
Received Thanks: 621
Code:
<h2>News</h2>
<?PHP

if(isset($_GET['id']) && checkInt($_GET['id']))
{
  $sqlNews = "SELECT * FROM ".SQL_HP_DB.".news WHERE anzeigen>0 AND id='".mysql_real_escape_string($_GET['id'])."' LIMIT 1";
  $qryNews = mysql_query($sqlNews,$sqlHp);
  if(mysql_num_rows($qryNews)>0)
  {
    while($getNews = mysql_fetch_object($qryNews))
    {
      echo'<div class="newsblock">';
      echo'<h3>['.$newsKategorien[$getNews->kategorie].'] <b>'.$getNews->titel.'</b></h3>';
      echo'<p>'.x_nl2br($getNews->inhalt).'</p>';
      if($newsKategorien[$getNews->kategorie]=='Event')
      {
        echo'<p class="footer">Geplant am <b>'.getDatum($getNews->datum).'</b> um <b>'.getZeit($getNews->datum).' Uhr</b></p>';
      }
      else
      {
        echo'<p class="footer">Verfasst am <b>'.getDatum($getNews->datum).'</b> um <b>'.getZeit($getNews->datum).' Uhr</b></p>';
      }
      echo'</div>';
    }
  }
  else 
  {
    echo'<p class="meldung">Die ID existiert nicht.</p>';
  }
  echo'<p><a href="index.php?s=news">zurück</a></p>';
}
else
{
  $sqlNews = "SELECT * FROM ".SQL_HP_DB.".news WHERE anzeigen>0 AND kategorie!=2 ORDER BY datum DESC LIMIT 10";
  $qryNews = mysql_query($sqlNews,$sqlHp);
  
  while($getNews = mysql_fetch_object($qryNews))
  {
    $newsText = (strlen($getNews->inhalt)>400) ? substr($getNews->inhalt,0,strpos($getNews->inhalt,' ',400)).'... <a href="index.php?s=news&id='.$getNews->id.'">mehr lesen</a>' : $getNews->inhalt;
    echo'<div class="newsblock">';
    echo'<h3>['.$newsKategorien[$getNews->kategorie].'] <b><a href="index.php?s=news&id='.$getNews->id.'">'.$getNews->titel.'</a></b></h3>';
    echo'<p>'.x_nl2br($newsText).'</p>';
    echo'<p class="footer">Verfasst am <b>'.getDatum($getNews->datum).'</b> um <b>'.getZeit($getNews->datum).' Uhr</b></p>';
    echo'</div>';
  }
}

?>
<?php
$query = "SELECT id FROM account.account";
    $result = mysql_query($query,$sqlServ);
    $account_rows = mysql_num_rows($result);
    $query = "SELECT * FROM player.guild";
    $result = mysql_query($query,$sqlServ);
    $guild_rows = mysql_num_rows($result);
    $query = "SELECT name FROM player.player";
    $result = mysql_query($query,$sqlServ);
    $player_rows = mysql_num_rows($result);
    
mysql_select_db("player");
$output = mysql_query("SELECT COUNT(*) as count FROM player WHERE DATE_SUB(NOW(), INTERVAL 25 MINUTE) < last_play;");
$online_count = mysql_fetch_object($output)->count;

?>
<?php
include "./inc/dbsettings.php";
$ip = gethostbyname($serverip);
$portlist=array(13000);
$onliner=array("Channel1");
$server=array("Channel1");
$i=0;
foreach  ($portlist as $port){
    $online = @fsockopen($ip, $port, $errno, $errstr, 1);
    if (!$online)
    {
        $ch1 = "<span style='color: green'>Online</span>";
    }
    else
    {
        $ch1 = "<span style='color: red'Offline</span>";
    }
    @fclose($online);
$i++;
}
?>
<?php
include "./inc/dbsettings.php";
$ip = gethostbyname($serverip);
$portlist=array(16000);
$onliner=array("Channel2");
$server=array("Channel2");
$i=0;
foreach  ($portlist as $port){
    $online = @fsockopen($ip, $port, $errno, $errstr, 1);
    if (!$online)
    {
        $ch2 = "<span style='color: green'>Online</span>";
    }
    else
    {
        $ch2 = "<span style='color: red'Offline</span>";
    }
    @fclose($online);
$i++;
}

?>

<table cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td>Channel 1</td>
                                <td><?php echo $ch1; ?></td>                                
                            </tr>
                            <tr class="border">
                                <td>Channel 2</td>
                                <td><?php echo $ch2; ?></td>                                
                            </tr>
                            <tr>
                                <td>Spieler Online</td>
                                <td><?php echo $online_count; ?></td>                                
                            </tr>
                            <tr class="border">
                                <td>Accounts</td>
                                <td><?php echo $account_rows; ?></td>                                
                            </tr>
                            <tr>
                                <td>Charaktere</td>
                                <td><?php echo $player_rows; ?></td>                                
                            </tr>
                            <tr>
                                <td>Erstellte Gilden</td>
                                <td><?php echo $guild_rows; ?></td>                                
                            </tr>
                            <tr style="line-height: 5px;"><td>&nbsp;</td><td>&nbsp;</td></tr>
                        </tbody>
                    </table>
Was ist das Problem ? Du musst doch nur die paar Ports anpassen & dann ist alles in Ordnung. Am Script fehlt an sich ja nichts.
.Avent is offline  
Old 04/15/2012, 15:45   #7
 
elite*gold: 0
Join Date: Jan 2012
Posts: 854
Received Thanks: 635
Jojo wenn jemand so nett ist und noch nen GM ziehcne für IG macht mit den namen : TopLight2 währe topp <3
.SonGoku™ is offline  
Thanks
1 User
Reply




All times are GMT +1. The time now is 00:16.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.