daily pastebin goal
62%
SHARE
TWEET

Minecraft BW stats for the Plugin: BedWars

a guest Apr 27th, 2016 622 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?PHP
  2.  
  3. /* SETTINGS     */
  4. /*________________________________________________________________________________________________________________*/
  5.  
  6. $_db_host = "YOUR_HOST";                /*      MYSQL host              */
  7. $_db_username = "YOUR_ROOT";                 /*      MYSQL username          */
  8. $_db_password = "YOUR_PASSWORD";            /*      MYSQL password          */
  9. $_db_database = "YOUR_DATABASE";                   /*      Mysql database          */
  10. $_db_table = "bw_stats";                /*  Database table              */    
  11.  
  12. $sort = "wins";                         /*      Default sort (wins, games, kills, deaths, beds) */
  13.  
  14. /*________________________________________________________________________________________________________________*/                                                  
  15.  
  16. /* DO NOT EDIT */
  17. if(@$_GET['order']){
  18.   $order = @$_GET['order'];
  19. }else{
  20.   $order = @$_GET['order'] = $sort;
  21. }
  22. if($order!="wins" && $order!="games" && $order!="kills" && $order!="deaths" && $order!="beds")
  23.   $order=$sort;
  24. $_link = mysql_connect($_db_host, $_db_username, $_db_password);
  25. mysql_select_db($_db_database, $_link);
  26. $_sql = "SELECT * FROM `$_db_table` ORDER BY `$order` DESC";
  27. $_resultat = mysql_query($_sql, $_link);
  28. ?>
  29. <html>
  30. <head>
  31.   <link rel="stylesheet" href="https://bootswatch.com/readable/bootstrap.css" media="screen">
  32.   <link rel="stylesheet" href="https://bootswatch.com/assets/css/bootswatch.min.css">
  33.   <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
  34.   <title>Bedwars Statistiken</title>
  35. </head>
  36. <body>
  37.   <div class="container well" style="background: white;">
  38.     <table class="table table-striped">
  39.       <thead>
  40.         <tr>
  41.           <th>Player</th>
  42.           <th><a href="?order=wins">Wins <?PHP if(@$_GET['order'] == 'wins'){ echo "<i class=\"fa fa-arrow-up\"></i>"; }?></a></th>
  43.           <th><a href="?order=games">Played Games <?PHP if(@$_GET['order'] == 'games'){ echo "<i class=\"fa fa-arrow-up\"></i>"; }?></a></th>
  44.           <th><a href="?order=kills">Kills <?PHP if(@$_GET['order'] == 'kills'){ echo "<i class=\"fa fa-arrow-up\"></i>"; }?></a></th>
  45.           <th><a href="?order=deaths">Deaths <?PHP if(@$_GET['order'] == 'deaths'){ echo "<i class=\"fa fa-arrow-up\"></i>"; }?></a></th>
  46.           <th>K/D</th>
  47.           <th><a href="?order=beds">Beds <?PHP if(@$_GET['order'] == 'beds'){ echo "<i class=\"fa fa-arrow-up\"></i>"; }?></a></th>
  48.         </tr>
  49.       </thead>
  50.       <tbody>
  51.         <?PHP while ($row = @mysql_fetch_array( $_resultat, MYSQL_ASSOC)) {?>
  52.         <tr>
  53.           <td><img src="http://cravatar.eu/helmhead/<?php echo $row['PName']; ?>/35.png"> <?php echo $row['PName']; ?></td>
  54.           <td><?php echo $row['Wins']; ?></td>
  55.           <td><?php echo $row['Games']; ?></td>
  56.           <td><?php echo $row['Kills']; ?></td>
  57.           <td><?php echo $row['Deaths']; ?></td>
  58.           <td><?php if($row['Deaths']==0) echo $row['Kills']; else echo round($row['Kills'] /  $row['Deaths'],2); ?></td>
  59.           <td><?php echo $row['Beds']; ?></td>
  60.         </tr>
  61.         <?PHP } ?>
  62.       </tbody>
  63.     </table>
  64.   </div>    
  65. </body>
  66. </head>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top