Guest User

Untitled

a guest
Jan 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>StatsGrabber Test</title>
  4. </head>
  5. <body>
  6.  
  7. <?php
  8. function printPlayer($resultobj){
  9. echo('<b>'.$resultobj->player.'</b><br/>');
  10. echo('Last Login: '.$resultobj->stats->lastlogin.'<br/>');
  11. echo('Last Logout: '.$resultobj->stats->lastlogout.'<br/>');
  12. echo('Played For: ' .$resultobj->stats->playedfor.'<br/>');
  13. echo('Kill / Death Ratio: '.$resultobj->stats->killdeathratio.'<br/>');
  14. echo('Player Kill / Death Ratio: '.$resultobj->stats->playerkilldeathratio.'<br/><br/>');
  15. }
  16. ?>
  17.  
  18. <h2>StatsGrabber Test</h2>
  19.  
  20. <h3>Get statistics for player <tt>Tehbeard</tt>:</h3>
  21. <pre>
  22. QUERY: "player='Tehbeard'"<br/><br/>
  23. <?php
  24. include('statsGrabber.php');
  25. $sg = new StatsGrabber('localhost', 'root', '', 'stats');
  26. $result = $sg->getStats("player='Tehbeard'");
  27. foreach($result as $resultobj)
  28. printPlayer($resultobj);
  29. ?>
  30. </pre>
  31.  
  32. <h3>Get statistic for all players who have played at least 35 hours:</h3>
  33. <pre>
  34. QUERY: "category='stats' AND stat='playedfor' AND value > 126000"<br/><br/>
  35. <?php
  36. $result = $sg->getStats("category='stats' AND stat='playedfor' AND value > 126000");
  37. foreach($result as $resultobj)
  38. printPlayer($resultobj);
  39. ?>
  40. </pre>
  41.  
  42. </body>
  43. </html>
Add Comment
Please, Sign In to add comment