index.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. $CONFIG = array(
  3. "paths" => array(
  4. "/media/Serien",
  5. "/media/Filme"
  6. )
  7. );
  8. if(!isset($_GET['path']) || !$_GET['path']) {
  9. foreach($CONFIG['paths'] as $path) {
  10. echo "<h2>" . $path . "</h2>";
  11. $list = scandir($path);
  12. $list = array_diff($list, array('.'));
  13. foreach($list as $object) {
  14. echo "<a href=\"?path=" . $path . "/" . $object . "\">" . $object . "</a><br>";
  15. }
  16. }
  17. } else {
  18. echo "<h2>" . $_GET['path'] . "</h2>";
  19. if(is_dir($_GET['path'])) {
  20. $list = scandir($_GET['path']);
  21. $list = array_diff($list, array('.'));
  22. foreach($list as $object) {
  23. echo "<a href=\"?path=" . $_GET['path'] . "/" . $object . "\">" . $object . "</a><br>";
  24. }
  25. } else {
  26. echo "<video width=\"auto\" height=\"auto\" controls>";
  27. echo "<source src=\"readfile.php?file=" . $_GET['path'] . "\" type=\"video/mp4\">";
  28. echo "Your browser does not support the video tag.";
  29. echo "</video>";
  30. }
  31. }
  32. ?>