Sebastien Lemery 10 лет назад
Родитель
Сommit
c72082aa35
1 измененных файлов с 48 добавлено и 17 удалено
  1. 48 17
      scripts/Cleaner Index/index.php

+ 48 - 17
scripts/Cleaner Index/index.php

@@ -1,36 +1,67 @@
-;You need to edit line 5 and 9. Don't edit line 34, unless you hate us, then.. go ahead.
+<?php
+
+$cache = file_get_contents("index-cache.txt") or die("Cache file not found!");
+$json = json_decode($cache, true);
+
+?>
 <!DOCTYPE html>
 <html>
 <head>
-	<title>Stats generated by #YOURCHANNEL</title>
+	<title>Stats generated by #pisg @ freenode</title>
 	<link rel="stylesheet" type="text/css" href="dark-style.css">
+	<style type="text/css">
+		table {
+			width: 480px;
+			margin: 0 auto;
+		}
+
+		@media (max-width: 640px) {
+			table {
+				width: 100%;
+			}
+		}
+
+		body {
+			text-align: center;
+		}
+
+		footer {
+			position: absolute;
+			right: 0;
+			bottom: 0;
+			left: 0;
+			padding: 1rem;
+			text-align: center;
+		}
+
+		h6 {
+			margin: 0;
+		}
+	</style>
 </head>
 <body>
-<h1 class="center">Stats generated by #YOURCHANNEL</h1>
+<h1>Stats generated by #pisg @ freenode</h1>
+<h4>Last updated: <?php echo $json["refresh_date"] ?></h4>
 <table>
 <tr>
 	<th>Channel</th>
-	<th>Last updated</th>
 	<th>Users</th>
 </tr>
 <?php
 
-$cache = file_get_contents("index-cache.txt") or die("Cache file not found!");
-$channels = explode("\n", $cache);
-
-foreach ($channels as $channel) {
-	$data = explode("\001", $channel);
-	echo '<tr onclick="document.location = \'' . $data[0] . '\'">';
-	echo '<td>' . $data[1] . '</td>';
-	echo '<td>' . $data[2] . '</td>';
-	echo '<td>' . $data[3] . '</td>';
-	echo '</tr>';
+foreach ($json as $channel => $data) {
+	if ($channel === "refresh_date")
+		continue;
+        echo '<tr onclick="document.location = \'' . $data["file"] . '\'">';
+        echo '<td>' . $channel . '</td>';
+        echo '<td>' . $data["users"] . '</td>';
+        echo '</tr>';
 }
 
 ?>
-
 </table>
-
-<h6 class="center">pisg!stats@pisg/stats/bot @ freenode | Generated by <a href="https://github.com/PISG/pisg">PISG</a> | All rights reserved</h6>
+<footer>
+<h6>pisg!stats@pisg/stats/bot @ freenode | Generated by <a href="https://github.com/PISG/pisg">PISG</a> | All rights reserved | This magic is created by OverCoder</h6>
+</footer>
 </body>
 </html>