| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <?php
- require('functions.php');
- ?>
- <!DOCTYPE html>
- <html lang="de">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>WebVideoViewer</title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
- <style>
- .col-sm-3 > div > a > img {
- width: 100%;
- }
- .col-sm-3 {
- padding-bottom: 15px;
- }
- .image-zoom {
- overflow: hidden;
- }
- .image-zoom img {
- -webkit-transition: all 1s ease; /* Safari and Chrome */
- -moz-transition: all 1s ease; /* Firefox */
- -ms-transition: all 1s ease; /* IE 9 */
- -o-transition: all 1s ease; /* Opera */
- transition: all 1s ease;
- }
- .image-zoom:hover img {
- -webkit-transform:scale(1.15); /* Safari and Chrome */
- -moz-transform:scale(1.15); /* Firefox */
- -ms-transform:scale(1.15); /* IE 9 */
- -o-transform:scale(1.15); /* Opera */
- transform:scale(1.15);
- }
- </style>
- </head>
- <body>
- <div class="container-fluid">
- <?php
- $CONFIG = array(
- "paths" => array(
- "/media/Serien",
- "/media/Filme"
- )
- );
- if(!isset($_GET['path']) || !$_GET['path']) {
- foreach($CONFIG['paths'] as $path) {
- $folderName = split('/', $path);
- echo "<h1>" . $folderName[sizeof($folderName) - 1] . "</h1>";
- $list = scandir($path);
- $list = array_diff($list, array('.', '..'));
- echo "<div class=\"row\">";
- foreach($list as $object) {
- echo "<div class=\"col-sm-3\"><div class=\"image-zoom\">";
- echo "<a href=\"?path=" . $path . "/" . $object . "\">" . "<img src=\"" . getImageByName($object) . "\" alt=\"" . $object . "\">" . "</a><br>";
- echo "</div></div>";
- }
- echo "</div>";
- }
- } else {
- $_GET['path'] = str_replace('/..', '', $_GET['path']);
- $_GET['path'] = str_replace('../', '', $_GET['path']);
- $_GET['path'] = str_replace('..', '', $_GET['path']);
- echo "<h1>" . $_GET['path'] . "</h1>";
- if(is_dir($_GET['path'])) {
- $list = scandir($_GET['path']);
- $list = array_diff($list, array('.'));
- foreach($list as $object) {
- if($object == "..") {
- if(in_array($_GET['path'], $CONFIG['paths'])) {
- echo "<a href=\"?path=\">Home</a><br>";
- } else {
- $paths = explode('/', $_GET['path']);
- $paths = array_diff($paths, array($paths[sizeof($paths) - 1]));
- $pathv = "";
- foreach($paths as $key => $path) {
- if($key == sizeof($paths) - 1) {
- $pathv .= $path;
- } else {
- $pathv .= $path . "/";
- }
- }
- echo "<a href=\"?path=" . $pathv . "\">" . $object . "</a><br>";
- }
- } else {
- echo "<a href=\"?path=" . $_GET['path'] . "/" . $object . "\">" . $object . "</a><br>";
- }
- }
- } else {
- $paths = explode('/', $_GET['path']);
- $paths = array_diff($paths, array($paths[sizeof($paths) - 1]));
- $pathv = "";
- foreach($paths as $key => $path) {
- if($key == sizeof($paths) - 1) {
- $pathv .= $path;
- } else {
- $pathv .= $path . "/";
- }
- }
- $mime = explode(';', finfo_file(finfo_open(FILEINFO_MIME), $_GET['path']));
- echo "<a href=\"?path=" . $pathv . "\">Back</a> | <a href=\"readfile.php?file=" . $_GET['path'] . "\">Download</a><br>";
- echo "<video width=\"auto\" height=\"auto\" controls>";
- echo "<source src=\"readfile.php?file=" . $_GET['path'] . "\" type=\"" . $mime[0] . "\">";
- echo "Your browser does not support the video tag.";
- echo "</video>";
- }
- }
- ?>
- </div>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
- </body>
- </html>
|