Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>X-Ray Investigation Tool</title>
- <style type="text/css">
- body {
- font: 100% Verdana, Arial, Helvetica, sans-serif;
- }
- tr.d0 td {
- background-color: #FFFFFF; color: black;
- }
- tr.d1 td {
- background-color: #CCCCCC; color: black;
- }
- tr.dred td {
- background-color: #EE2C2C; color: black;
- }
- tr.dyellow td {
- background-color: #FBEC5D; color: black;
- }
- tr.dblack td {
- background-color: #000000; color: white;
- }
- tr.dtop td {
- font-weight: bolder;
- }
- </style>
- </head>
- <body>
- <h1>X-Ray Investigation Tool</h1>
- 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.
- <h2>Logblock Usage:</h2>
- <?php
- $lbworld = "lb-world";
- ## $banfile = "/home/jigabot/roxbot/banned-players.txt";
- $banfile = "banned-players.txt";
- $dbhost = "IPADDRESS";
- $dbname = "DATABASENAME";
- $dbuser = "USERNAME";
- $dbpass = "PASSWORD";
- mysql_connect($dbhost, $dbuser, $dbpass) or
- die("Could not connect: " . mysql_error());
- mysql_select_db($dbname);
- $result = mysql_query("SELECT playername, SUM(total) AS total, SUM(diamonds) AS diamonds, SUM(diamonds)/SUM(total)*100 AS percentage
- FROM (
- (
- SELECT playerid, count(type) AS total, 0 AS diamonds
- FROM `" . $lbworld . "` WHERE replaced > 0 AND type != replaced AND DATEDIFF(NOW(), date) <= 7
- GROUP BY playerid
- ) UNION (
- SELECT playerid, 0 AS total, count(replaced) AS diamonds
- FROM `" . $lbworld . "` WHERE replaced = 56 AND type != replaced AND DATEDIFF(NOW(), date) <= 7
- GROUP BY playerid
- )
- ) AS t
- INNER JOIN `lb-players` USING (playerid)
- GROUP BY playerid
- ORDER BY percentage DESC") or die(mysql_error());
- print("/lb player <playername> destroyed block diamond_ore coords <br />");
- print("/lb tp 1<br />");
- print("/lb tp 2<br />");
- print("/lb page 5<br />");
- print("/lb tp 62<br />");
- print("<table>");
- print("<tr class='dtop'>");
- print("<td> Player Name</td><td> All Blocks</td><td> Diamonds</td><td>Percentage</td>");
- print("</tr>");
- $i = 0;
- $banlist = implode('', file($banfile));
- while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
- if($row["percentage"] > 0){
- $i++;
- if(strpos($banlist,strtolower($row["playername"])) !== false){
- print("<tr class=\"dblack\">");
- } elseif($row["percentage"] >= 5){
- print("<tr class=\"dred\">");
- } elseif($row["percentage"] >= 3){
- print("<tr class=\"dyellow\">");
- } else {
- print("<tr class=\"d".($i & 1)."\">");
- }
- print("<td>" . $row["playername"] ."</td><td> ". $row["total"] ."</td><td> ". $row["diamonds"] ."</td><td> ". $row["percentage"] ."</td>");
- print("</tr>");
- }
- }
- print("</table>");
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment