%VideoFileName%
%FileInfo%
/// Empty Playlist ///
",$templateC); } //Check for external storage devices if (file_exists("/media/")){ //This system have media directory and check for mounting points $extstorages = glob("/media/storage*"); foreach ($extstorages as $storage){ if (file_exists("$storage/Video/")){ $unsorted = glob("$storage/Video/*.mp4"); $box = str_replace("%PlayListName%","External Storage ($storage)",$templateA); if (count($unsorted) != 0){ $box = str_replace("%PlayPlayList%","vidPlay.php?src=../SystemAOB/functions/extDiskAccess.php?file=".$unsorted[0]."&playlist=$storage/Video/&isExt=true",$box); }else{ $box = str_replace(' Play playlist',' Empty playlist / Not Plugged In',$box); } echo $box; foreach ($unsorted as $video){ $filedata = explode('/',$video); $fullFileName = array_pop($filedata); $filename = str_replace(".mp4","",$fullFileName); //$filename = basename($video,".mp4"); if (strpos($filename,"inith") !== false){ $decodedName = hex2bin(str_replace("inith","",$filename)); }else{ $decodedName = $filename; } $box = str_replace("%VideoPlayPath%","vidPlay.php?src=../SystemAOB/functions/extDiskAccess.php?file=".$video,$templateB); $box = str_replace("%VideoFileName%",$decodedName,$box); $box = str_replace("%DownloadPath%","download.php?download=".$video,$box); $box = str_replace("%FileInfo%",formatBytes(filesize($video)) . " [".pathinfo($video, PATHINFO_EXTENSION)."]",$box); echo $box; } if (count($unsorted) != 0){ echo str_replace("%PlayPlayList%","vidPlay.php?src=../SystemAOB/functions/extDiskAccess.php?file=".$unsorted[0]."&playlist=$storage/Video/&isExt=true",$templateC); }else{ echo str_replace('View Playlist',"/// Empty Playlist ///
",$templateC); } } } } //scan for external playlist. This won't show if nothing is found. if (file_exists("/media/")){ //This system have media directory and check for mounting points $extstorages = glob("/media/storage*"); foreach ($extstorages as $storage){ if (file_exists("$storage/Video/")){ $playlists = glob( $storage . '/Video/*'); foreach($playlists as $playlist){ if (is_dir($playlist)){ $unsorted = glob($playlist . "/*.mp4"); //basename in traiditional mode to prevent utf-8 encoding error $tmp_1 = explode("/",$playlist); $basename = array_pop($tmp_1); if (ctype_xdigit($basename) && strlen($basename) % 2 == 0) { $playlistName = hex2bin($basename); } else { $playlistName = $basename; } $box = str_replace("%PlayListName%", $playlistName . " - ($storage)",$templateA); $box = str_replace('layout icon','disk outline icon',$box); if (count($unsorted) != 0){ $box = str_replace("%PlayPlayList%","vidPlay.php?src=../SystemAOB/functions/extDiskAccess.php?file=".$unsorted[0]."&playlist=$storage/Video/$basename&isExt=true",$box); }else{ //$box = str_replace(' Play playlist',' Empty playlist / Not Plugged In',$box); } echo $box; foreach ($unsorted as $video){ $filedata = explode('/',$video); $fullFileName = array_pop($filedata); $filename = str_replace(".mp4","",$fullFileName); if (strpos($filename,"inith") !== false){ $decodedName = hex2bin(str_replace("inith","",$filename)); }else{ $decodedName = $filename; } $box = str_replace("%VideoPlayPath%","vidPlay.php?src=../SystemAOB/functions/extDiskAccess.php?file=".$video,$templateB); $box = str_replace("%VideoFileName%",$decodedName,$box); $box = str_replace("%DownloadPath%","download.php?download=".$video,$box); $box = str_replace("%FileInfo%",formatBytes(filesize($video)) . " [".pathinfo($video, PATHINFO_EXTENSION)."]",$box); echo $box; } if (count($unsorted) != 0){ echo str_replace("%PlayPlayList%","vidPlay.php?src=../SystemAOB/functions/extDiskAccess.php?file=".$unsorted[0]."&playlist=$playlist&isExt=true",$templateC); }else{ echo str_replace('View Playlist',"/// Empty Playlist ///
",$templateC); } } } } } } ?>