index.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /*
  3. * Copyright (C) 2021 Echedey López Romero <elr@disroot.org>
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // Show errors in screen
  19. ini_set('display_errors', '1');
  20. ini_set('display_startup_errors', '1');
  21. error_reporting(E_ALL);
  22. // Repair output with Tidy
  23. ini_set('tidy.clean_output', '1');
  24. // Empty web browser cache
  25. header('Cache-Control: no-cache');
  26. header('Pragma: no-cache');
  27. // Load classes
  28. spl_autoload_register(function ($ClassName) {
  29. require './classes/' . $ClassName . '.php';
  30. });
  31. // Load variables
  32. require './variables.php';
  33. // Main functionality
  34. if ((isset($_GET) && count($_GET) === 0) || !isset($_GET) || isset($_GET['XDEBUG_SESSION_START'])) {
  35. $Type = 0;
  36. } else if (isset($_GET) && count($_GET) > 1) {
  37. header('Location:.');
  38. } else {
  39. if (isset($_GET['search'])) {
  40. $Search = $_GET['search'];
  41. $Data = $Search;
  42. $Type = 1;
  43. } else if (isset($_GET['movie'])) {
  44. $Data = $_GET['movie'];
  45. $Type = 2;
  46. } else if (isset($_GET['person'])) {
  47. $Data = $_GET['person'];
  48. $Type = 3;
  49. } else {
  50. $Type = -1;
  51. }
  52. }
  53. $PagePrinter = PagePrinter::GetInstance($Data, $Type, $BaseURL, $APIKey,
  54. $ImageURL, $DefaultPoster, $DefaultProfile);
  55. $Page = $PagePrinter->Render();
  56. // Load view
  57. require './view.php';