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.

publicheader.php 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. global $LoggedUser;
  3. define('FOOTER_FILE', SERVER_ROOT.'/design/publicfooter.php');
  4. ?>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title><?=display_str($PageTitle)?>
  9. </title>
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12. <meta name="theme-color" content="#461640">
  13. <link rel="shortcut icon"
  14. href="static/common/icon.png?v=<?=md5_file('static/common/icon.png');?>">
  15. <link rel="manifest" href="/manifest.php">
  16. <link
  17. href="<?=STATIC_SERVER ?>styles/public/style.css?v=<?=filemtime(SERVER_ROOT.'/static/styles/public/style.css')?>"
  18. rel="stylesheet" type="text/css">
  19. <?php
  20. $Scripts = ['jquery', 'global', 'ajax.class', 'cookie.class', 'storage.class', 'public', 'u2f'];
  21. foreach ($Scripts as $Script) {
  22. if (($ScriptStats = G::$Cache->get_value("script_stats_$Script")) === false || $ScriptStats['mtime'] != filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js")) {
  23. $ScriptStats['mtime'] = filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js");
  24. $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, SERVER_ROOT.STATIC_SERVER."functions/$Script.js", true));
  25. $ScriptStats['algo'] = INTEGRITY_ALGO;
  26. G::$Cache->cache_value("script_stats_$Script", $ScriptStats);
  27. } ?>
  28. <script src="<?=STATIC_SERVER."functions/$Script.js?v=$ScriptStats[mtime]"?>"
  29. type="text/javascript"
  30. integrity="<?="$ScriptStats[algo]-$ScriptStats[hash]"?>"></script>
  31. <?php
  32. }
  33. $img = array_diff(scandir(SERVER_ROOT.'/misc/bg', 1), array('.', '..')); ?>
  34. <meta name="bg_data" content="<?=$img[rand(0, count($img)-1)]?>">
  35. </head>
  36. <body>
  37. <div id="head"><span>
  38. <a href="login.php">Log In</a>
  39. <?php if (OPEN_REGISTRATION) { ?>
  40. | <a href="register.php">Register</a>
  41. <?php } ?>
  42. | <a
  43. href="mailto:support@biotorrents.de?subject=[TxID <?= strtoupper(bin2hex(random_bytes(2))) ?>] Vague subject lines ignored">Support</a>
  44. </span></div>
  45. <div id="content">
  46. <!-- todo: Put index page stats here -->
  47. <?php #include('/sections/login/stats.php');?>
  48. <table class="layout" id="maincontent">
  49. <tr>
  50. <td class="centered">
  51. <a href="/">
  52. <div id="logo"></div>
  53. </a>
  54. <?php