Guest User

Untitled

a guest
Sep 21st, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.92 KB | None | 0 0
  1. <html lang="en">
  2.  
  3. <head>
  4.     <meta charset="utf-8" />
  5.     <title>X-Ray Investigation Tool</title>
  6.     <style type="text/css">
  7.     body {
  8.     font: 100% Verdana, Arial, Helvetica, sans-serif;
  9.     }
  10.     tr.d0 td {
  11.         background-color: #FFFFFF; color: black;
  12.     }
  13.     tr.d1 td {
  14.         background-color: #CCCCCC; color: black;
  15.     }
  16.     tr.dred td {
  17.         background-color: #EE2C2C; color: black;
  18.     }
  19.     tr.dyellow td {
  20.         background-color: #FBEC5D; color: black;
  21.     }
  22.     tr.dblack td {
  23.         background-color: #000000; color: white;
  24.     }
  25.     tr.dtop td {
  26.         font-weight: bolder;
  27.     }
  28.    
  29.     </style>
  30. </head>
  31.  
  32.  
  33. <body>
  34. <h1>X-Ray Investigation Tool</h1>
  35. Diamond rates for players over the last 7 days. Moderators, please investigate all players in red and take care in interpreting what you find. For best results use logblock to teleport to where they have been mining and examine the area. Please note that if the area has been filled back in you will not be able to teleport directly.
  36.  
  37. <h2>Logblock Usage:</h2>
  38.  
  39. <?php
  40.  
  41. $lbworld = "lb-world";
  42. ## $banfile = "/home/jigabot/roxbot/banned-players.txt";
  43. $banfile = "banned-players.txt";
  44.  
  45. $dbhost = "IPADDRESS";
  46. $dbname = "DATABASENAME";
  47. $dbuser = "USERNAME";
  48. $dbpass = "PASSWORD";
  49.  
  50. mysql_connect($dbhost, $dbuser, $dbpass) or
  51.     die("Could not connect: " . mysql_error());
  52. mysql_select_db($dbname);
  53.  
  54. $result = mysql_query("SELECT playername, SUM(total) AS total, SUM(diamonds) AS diamonds, SUM(diamonds)/SUM(total)*100 AS percentage
  55.         FROM (
  56.         (
  57.         SELECT playerid, count(type) AS total, 0 AS diamonds
  58.         FROM `" . $lbworld . "` WHERE replaced > 0 AND type != replaced AND DATEDIFF(NOW(), date) <= 7
  59.         GROUP BY playerid
  60.         ) UNION (
  61.         SELECT playerid, 0 AS total, count(replaced) AS diamonds
  62.         FROM `" . $lbworld . "` WHERE replaced = 56 AND type != replaced AND DATEDIFF(NOW(), date) <= 7
  63.         GROUP BY playerid
  64.         )
  65.         ) AS t
  66.         INNER JOIN `lb-players` USING (playerid)
  67.         GROUP BY playerid
  68.         ORDER BY percentage DESC") or die(mysql_error());
  69.  
  70. print("/lb player <playername> destroyed block diamond_ore coords <br />");
  71. print("/lb tp 1<br />");
  72. print("/lb tp 2<br />");
  73. print("/lb page 5<br />");
  74. print("/lb tp 62<br />");
  75.  
  76.  
  77.  
  78. print("<table>");
  79.     print("<tr class='dtop'>");
  80.         print("<td> Player Name</td><td> All Blocks</td><td> Diamonds</td><td>Percentage</td>");
  81.     print("</tr>");
  82.     $i = 0;
  83. $banlist = implode('', file($banfile));
  84. while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  85.     if($row["percentage"] > 0){
  86.     $i++;
  87.     if(strpos($banlist,strtolower($row["playername"])) !== false){
  88.     print("<tr class=\"dblack\">");
  89.     } elseif($row["percentage"] >= 5){
  90.     print("<tr class=\"dred\">");
  91.     } elseif($row["percentage"] >= 3){
  92.     print("<tr class=\"dyellow\">");
  93.     } else {   
  94.     print("<tr class=\"d".($i & 1)."\">");
  95.     }
  96.     print("<td>" . $row["playername"] ."</td><td> ". $row["total"] ."</td><td> ". $row["diamonds"] ."</td><td> ". $row["percentage"] ."</td>");
  97.     print("</tr>");
  98.     }
  99. }
  100. print("</table>");
  101. ?>
  102. </body>
  103.  
  104. </html>
Add Comment
Please, Sign In to add comment