index.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. header("Content-type: text/html; charset=utf-8");
  3. // Script start
  4. $rustart = getrusage();
  5. include_once 'utils/utils.php';
  6. include_once 'utils/bdd.php';
  7. include_once 'themes/theme.php';
  8. switch (auth_user()) {
  9. case AUTH_NOT_USER:
  10. include_once 'view/unknown_ip.php';
  11. break;
  12. case AUTH_USER_INVALID_IP:
  13. if (isset($_POST['action'])) {
  14. include_once './utils/valid_action.php';
  15. }else{
  16. include_once 'view/head.php';
  17. include_once 'view/valid_ip.php';
  18. }
  19. break;
  20. case AUTH_USER_VALID_IP:
  21. if (!isset($_GET['script'])) {
  22. include_once 'view/head.php';
  23. include_once 'view/header.php';
  24. ?>
  25. <script>
  26. function loadNowPlaying(){
  27. $("#body").load("index.php?page_id=<?php echo $_GET['page_id']; ?>&psub_id=<?php echo $_GET['psub_id']; ?>&script=1");
  28. }
  29. setInterval(function(){loadNowPlaying()}, 30000);
  30. </script>
  31. <?php
  32. }
  33. if (isMaintenance()) {
  34. include_once 'view/maintenance.php';
  35. } else {
  36. if (isset($_GET['page_id'])) {
  37. switch ($_GET['page_id']) {
  38. case 0:
  39. include_once 'view/main.php';
  40. break;
  41. case 1:
  42. include_once 'view/show_desc.php';
  43. break;
  44. case 2:
  45. include_once 'view/episode_desc.php';
  46. break;
  47. case 3:
  48. include_once 'view/user.php';
  49. break;
  50. case 4:
  51. include_once 'view/manually_add.php';
  52. break;
  53. case 5:
  54. include_once 'view/show_list.php';
  55. break;
  56. case 6:
  57. include_once 'view/about.php';
  58. break;
  59. case 7:
  60. if (isSAdmin()) {
  61. include_once 'view/movies.php';
  62. }
  63. break;
  64. case 43:
  65. if (isAdmin()) {
  66. include_once 'admin/admin.php';
  67. }
  68. break;
  69. default:
  70. include_once 'view/main.php';
  71. break;
  72. }
  73. } else {
  74. echo '<div class="modal" onClick="this.style.display = \'none\';"></div>';
  75. include_once 'view/main.php';
  76. }
  77. if (!isset($_GET['script'])) {
  78. include_once 'view/footer.php';
  79. }
  80. }
  81. break;
  82. default:
  83. break;
  84. }
  85. ?>