BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

privatefooter.php 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. declare(strict_types=1);
  3. $ENV = ENV::go();
  4. $Sep = '&emsp;';
  5. # End <div#content>, begin <footer>
  6. # This needs to be <main>, in each page
  7. echo $HTML = '</div></main><footer class="halfwide">';
  8. # Disclaimer
  9. #if (!empty($Options['disclaimer'])) {
  10. echo $HTML = <<<HTML
  11. <p>
  12. No data are hosted on $ENV->SITE_NAME's servers.
  13. All torrents are user-generated content.
  14. Torrents without a specified license may be protected by copyright.
  15. </p>
  16. HTML;
  17. #}
  18. # Sessions
  19. if (count($UserSessions) > 1) {
  20. foreach ($UserSessions as $ThisSessionID => $Session) {
  21. if ($ThisSessionID !== $SessionID) {
  22. $LastActive = $Session;
  23. break;
  24. }
  25. }
  26. }
  27. # User meta
  28. $LastUpdate = time_diff($LastActive['LastUpdate']);
  29. $IP = (apcu_exists('DBKEY') && $LastActive['IP'] && $LastActive['IP'] !== '0.0.0.0'
  30. ? (Crypto::decrypt($LastActive['IP']))
  31. : '[Encrypted]');
  32. if (!empty($LastActive)) {
  33. echo $HTML = <<<HTML
  34. <p>
  35. <a href="user.php?action=sessions">
  36. <span class="tooltip" title="Manage sessions">
  37. Last activity:
  38. </span>
  39. $LastUpdate
  40. <span class="tooltip" title="Manage sessions">
  41. from
  42. $IP
  43. </span>
  44. </a>
  45. </p>
  46. HTML;
  47. }
  48. # Site meta
  49. $Year = date('Y');
  50. $Load = sys_getloadavg();
  51. echo $HTML = <<<HTML
  52. <p>
  53. &copy;
  54. $Year
  55. $ENV->SITE_NAME
  56. $Sep
  57. <a href='/sections/legal/canary.txt'>Warrant Canary</a>
  58. </p>
  59. HTML;
  60. # Script meta
  61. $MicroTime = number_format(((microtime(true) - $ScriptStartTime) * 1000), 5);
  62. $Used = Format::get_size(memory_get_usage(true));
  63. $Load = number_format($Load[0], 2).' '.number_format($Load[1], 2).' '.number_format($Load[2], 2);
  64. $Date = date('M d Y');
  65. $Time = date('H:i');
  66. echo $HTML = <<<HTML
  67. <p>
  68. <strong>Time:</strong>
  69. $MicroTime ms
  70. $Sep
  71. <!--
  72. <strong>Used:</strong>
  73. $Used
  74. $Sep
  75. -->
  76. <strong>Load:</strong>
  77. $Load
  78. $Sep
  79. <strong>Date:</strong>
  80. $Date,
  81. $Time
  82. </p>
  83. HTML;
  84. # Start debug
  85. if (DEBUG_MODE || check_perms('site_debug')) {
  86. echo $HTML = <<<HTML
  87. <div id="site_debug">
  88. HTML;
  89. $Debug->perf_table();
  90. $Debug->flag_table();
  91. $Debug->error_table();
  92. $Debug->sphinx_table();
  93. $Debug->query_table();
  94. $Debug->cache_table();
  95. $Debug->vars_table();
  96. $Debug->ocelot_table();
  97. echo $HTML = <<<HTML
  98. </div>
  99. HTML;
  100. }
  101. # End debug
  102. global $NotificationSpans;
  103. if (!empty($NotificationSpans)) {
  104. foreach ($NotificationSpans as $Notification) {
  105. echo "$Notification\n";
  106. }
  107. }
  108. echo $HTML = <<<HTML
  109. </footer>
  110. <script src="$ENV->STATIC_SERVER/functions/vendor/instantpage.js" type="module"></script>
  111. </body>
  112. </html>
  113. HTML;