Guest User

Untitled

a guest
Apr 10th, 2014
455
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $str = file_get_contents('rcon/online');
  2. $reg = '(\\d+)\\s+\\"([^"]+)"\\s+(\\d+)\\s+(\\d+)\\w\\s+([0-9.]+)\\s*';
  3. $reg = str_replace("/", "\/", $reg);
  4. preg_match_all("/$reg/", $str, $words, PREG_SET_ORDER);
  5.  
  6. echo "<div class='entry-content'>";
  7. echo "<table width='100%'>";
  8. echo   "<tr>";
  9. echo    "<td><center>№</center></td>";
  10. echo    "<td>Ник</td>";
  11. echo    "<td width='58'><center>Online</center></td>";
  12. echo   "</tr>";
  13.  
  14. $i = 0;
  15. for ($i = 0; $i <= 200; $i++)
  16.     {
  17.         if($words[$i][4] / 60 != 0)
  18.             { $time = number_format($words[$i][4] / 60,0,",","."); }
  19.         else
  20.             { $time = $words[$i][4]; }
  21.            
  22.         if(!empty($words[$i][1]))
  23.                 {
  24.                 $n = $i + 1;
  25.                 echo   "<tr class='steamRow'>";
  26.                 echo    "<td><center>". $n ."</center></td>";
  27.                 echo    "<td class='steamUrl'><a href=http://steamcommunity.com/profiles/" .$words[$i][1].">" .$words[$i][2]."</td>";
  28.                 echo    "<td><center>".$time." min.</center></td>";
  29.                 echo   "</tr>";
  30.                 }
  31.     }
  32. echo "</table>";
  33. echo "</div>";
RAW Paste Data