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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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>';
  8. # Disclaimer
  9. #if (!empty($Options['disclaimer'])) {
  10. echo $HTML = <<<HTML
  11. <div id="disclaimer">
  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. </div>
  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. Site and design
  54. &copy;
  55. $Year
  56. $ENV->SITE_NAME
  57. $Sep
  58. <a href='/sections/legal/canary.txt'>Warrant Canary</a>
  59. </p>
  60. HTML;
  61. # Script meta
  62. $MicroTime = number_format(((microtime(true) - $ScriptStartTime) * 1000), 5);
  63. $Used = Format::get_size(memory_get_usage(true));
  64. $Load = number_format($Load[0], 2).' '.number_format($Load[1], 2).' '.number_format($Load[2], 2);
  65. $Date = date('M d Y');
  66. $Time = date('H:i');
  67. echo $HTML = <<<HTML
  68. <p>
  69. <strong>Time:</strong>
  70. $MicroTime ms
  71. $Sep
  72. <!--
  73. <strong>Used:</strong>
  74. $Used
  75. $Sep
  76. -->
  77. <strong>Load:</strong>
  78. $Load
  79. $Sep
  80. <strong>Date:</strong>
  81. $Date,
  82. $Time
  83. </p>
  84. HTML;
  85. # Start debug
  86. if (DEBUG_MODE || check_perms('site_debug')) {
  87. echo $HTML = <<<HTML
  88. <div id="site_debug">
  89. HTML;
  90. $Debug->perf_table();
  91. $Debug->flag_table();
  92. $Debug->error_table();
  93. $Debug->sphinx_table();
  94. $Debug->query_table();
  95. $Debug->cache_table();
  96. $Debug->vars_table();
  97. $Debug->ocelot_table();
  98. echo $HTML = <<<HTML
  99. </div>
  100. HTML;
  101. }
  102. # End debug
  103. global $NotificationSpans;
  104. if (!empty($NotificationSpans)) {
  105. foreach ($NotificationSpans as $Notification) {
  106. echo "$Notification\n";
  107. }
  108. }
  109. echo $HTML = '</footer></body></html>';