index.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. $cache = file_get_contents("index-cache.txt") or die("Cache file not found!");
  3. $json = json_decode($cache, true);
  4. ?>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title>Stats generated by #pisg @ freenode</title>
  9. <link rel="stylesheet" type="text/css" href="dark-style.css">
  10. <style type="text/css">
  11. table {
  12. width: 480px;
  13. margin: 0 auto;
  14. }
  15. @media (max-width: 640px) {
  16. table {
  17. width: 100%;
  18. }
  19. }
  20. body {
  21. text-align: center;
  22. }
  23. footer {
  24. position: absolute;
  25. right: 0;
  26. bottom: 0;
  27. left: 0;
  28. padding: 1rem;
  29. text-align: center;
  30. }
  31. h6 {
  32. margin: 0;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <h1>Stats generated by #pisg @ freenode</h1>
  38. <h4>Last updated: <?php echo $json["refresh_date"] ?></h4>
  39. <table>
  40. <tr>
  41. <th>Channel</th>
  42. <th>Users</th>
  43. </tr>
  44. <?php
  45. foreach ($json as $channel => $data) {
  46. if ($channel === "refresh_date")
  47. continue;
  48. echo '<tr onclick="document.location = \'' . $data["file"] . '\'">';
  49. echo '<td>' . $channel . '</td>';
  50. echo '<td>' . $data["users"] . '</td>';
  51. echo '</tr>';
  52. }
  53. ?>
  54. </table>
  55. <footer>
  56. <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>
  57. </footer>
  58. </body>
  59. </html>