<?php $root = "/tmp/usbmounts/"; $aMovieFolder = array(); $aMovieFiles = array(); $moviepage = $_GET["page"]; if ("" == $moviepage) { echo "<title>Movie HDD Browser</title>\n"; unset($aMovieFolder); scanfolder($root); printfolder($root); } else { $moviepage = str_replace("%20", " ", $moviepage); echo "<title>.." . substr($moviepage, strlen($root)) . "</title>\n"; unset($aMovieFolder); scanfolder($moviepage); printfolder($moviepage); printfiles($moviepage); } function checkForMoviefolder($folder) { $moviefolder = ""; if ($dh = opendir($folder)) { while (false !== ($file = readdir($dh))) { if ("." != $file && ".." != $file && is_dir($folder . "/" . $file)) { break; } else { if (is_file($folder . "/" . $file)) { if (substr($file, 0, strlen($file) - 4) == basename($folder)) { $moviefolder = $folder . "/" . $file; break; }
$moviepage = str_replace("%20", " ", $moviepage); $title = strtoupper(basename($moviepage)); echo "<title>{$title}</title>\n"; if (file_exists($moviedb)) { $moviedbcontent = unserialize(file_get_contents($moviedb)); } if ($root == $moviepage) { $allowedscanpath = file($moviefolderscfg); $pages = array(); foreach ($allowedscanpath as $page) { scanfolder(trim($page), $moviedbcontent, true); } } else { scanfolder($moviepage, $moviedbcontent); } printfolder(); printfiles(); } } /******************************************************* * FUNCTIONS *******************************************************/ /******************************************************* * entermainmenu - first menu entry. */ function entermainmenu() { global $scriptfile, $moviedb, $root; printitem("Browse HDD", $scriptfile . '?page=' . $root, "http://xtreamer-web-sdk.googlecode.com/svn/trunk/rss/scripts/image/X.png"); $sFirstLetter = ""; if (file_exists($moviedb)) {