1. <center>Witam drodzy</center>

Mam problem ze statusem :/ działa ale po odświeżeniu 2 do 3 razy wyskakuje error:
Kod
Fatal error: Call to undefined function: simplexml_load_string() in c:\usr\apache\httpd\html\index.php on line 299
Kod w pliku index:
  1. if(!is_file('online_data.xml') OR (time()-filemtime('online_data.xml')) > $SummaryTime)
  2. {
  3. $info = chr(6).chr(0).chr(255).chr(255).'info';
  4. $sock = @fsockopen($ip_serwera, $port, $errno, $errstr, 1);
  5.  
  6. if ($sock)
  7. {
  8. fwrite($sock, $info);
  9. $data='';
  10.  
  11. while (!feof($sock))
  12. $data .= fgets($sock, 1024);
  13. fclose($sock);
  14.  
  15. preg_match('/players online="(\d+)" max="(\d+)" peak="(\d+)"/', $data, $matches);
  16. $CacheHTML .= '<font color=silver size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Status: </font><i><font color=green size=5>Online</font></i></center>';
  17. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graczy: </b><font color=silver size=1>';
  18. $CacheHTML .= $matches[1] . '/' . $matches[2];
  19.  
  20. preg_match('/uptime="(\d+)"/', $data, $matches);
  21. $h = floor($matches[1] / 3600);
  22. $m = floor(($matches[1] - $h*3600) / 60);
  23.  
  24.  
  25.  
  26. $SI = getServerInfo();
  27. $CacheHTML .= '<font color=silver size=2><br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Potwory:</b><font color=silver size=1> '. $SI['monsters'] . '';
  28.  
  29.  
  30. $iloscdomkow = count(glob("$data_folder/houses/*.*"));
  31.  
  32. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Houses:</b><font color=silver size=1> '. $iloscdomkow . '';
  33. $CacheHTML .= "<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Uptime:</b><font color=silver size=1> $h " . ($h==1? 'h' : ($h==2||$h==3||$h==4? 'h' : 'h'));
  34. $CacheHTML .= " $m " . ($m==1? 'min' : ($m==12||$m==13||$m==14? 'min' : ($m%10==2||$m%10==3||$m%10==4? 'min' : 'min'))) . '</font></font></font></font></font></font></font></font></font></font>';
  35.  
  36. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IP:</b><font color=silver size=1> '.$ip_serwera;'</font></font>';
  37. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Port:</b><font color=silver size=1> '.$port;'</font></font>';
  38. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;World type:</b><font color=silver size=1> '.$server_type;'</font></font>';
  39. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Experience:</font></b><font color=silver size=1> '.$expinfo; '</font></font>';
  40. $CacheHTML .= '</font></font><br><br>';
  41.  
  42.  
  43.  
  44.  
  45.  
  46. }
  47. else {
  48. $CacheHTML .= '<font color=silver size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Status: <font color=red size=3><i>Ofline</i></center></font><br>';
  49.  
  50. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IP:</b><font color=silver size=1> '.$ip_serwera;'</font></font>';
  51. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Port:</b><font color=silver size=1> '.$port;'</font></font>';
  52. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;World type:</b><font color=silver size=1> '.$server_type;'</font></font>';
  53. $CacheHTML .= '<br><font color=silver size=2><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Experience:</b></font><font color=silver size=1> '.$expinfo; '</font></font>';
  54. $CacheHTML .= '</font></font><br><br>';
  55. }
  56.  
  57. echo $CacheHTML;
  58.  
  59.  
  60.  
  61. $fp = fopen('online_data.xml', 'w');
  62. fwrite($fp, '<?xml version="1.0"?><otserv><base64>' .base64_encode($CacheHTML). '</base64></otserv>');
  63. fclose($fp);
  64. } else {
  65. $CacheContent = file_get_contents('online_data.xml');
  66. $CacheXML = simplexml_load_string($CacheContent);
  67. echo base64_decode($CacheXML->base64);
  68. }
  69. ?>