PageRenderTime 52ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/patches/Servicios/sbin/www/videolist.php

https://github.com/frisco82/HMR600.com-Firmware
PHP | 803 lines | 525 code | 137 blank | 141 comment | 107 complexity | 10837bc626743427eb9b17e81478ad8d MD5 | raw file
  1. <?php
  2. session_start();
  3. error_reporting(0);
  4. $_SESSION['redirect'] = $_SERVER['REQUEST_URI'];
  5. include "chooselang.php";
  6. include '/tmp/lang.php';
  7. //$root = "/tmp/usbmounts";
  8. $id = $_POST['user_id'];
  9. $pass = $_POST['user_pass'];
  10. $filetypes = array (
  11. 'mpg' => 'video.gif',
  12. 'mkv' => 'video.gif',
  13. 'mpeg' => 'video.gif',
  14. 'mov' => 'video.gif',
  15. 'wmv' => 'video.gif',
  16. 'avi' => 'video.gif',
  17. );
  18. $Netshare_path = substr($_GET['dir'],0,12);
  19. if ($Netshare_path == "/tmp/myshare"){
  20. $mydir = $_GET['dir'];
  21. $mediapath = stripslashes($_GET['dir']);
  22. if ($mydir != "/tmp/myshare"){
  23. $uplink = substr_replace($_GET['dir'],'',strlen($_GET['dir'])-strlen(strrchr( $_GET['dir'],'/')));
  24. //check whether already mounted?
  25. $mydir1 = $mydir;
  26. $mydir1 = str_replace("(", "\(", $mydir1);
  27. $mydir1 = str_replace(")", "\)", $mydir1);
  28. $mydir1 = str_replace(" ", "\ ", $mydir1);
  29. $cmd = "mount |grep ".$mydir1;
  30. exec($cmd, $output1, $result1);
  31. if((substr($mydir, -4) == ".smb") || (substr($mydir, -4) == ".nfs") and ($output1[0] == "")){
  32. $ShareName = '/tmp/myshare/.cmd'.strrchr( $mydir,'/');
  33. $ShareName = str_replace("(", "\(", $ShareName);
  34. $ShareName = str_replace(")", "\)", $ShareName);
  35. $ShareName = str_replace(" ", "\ ", $ShareName);
  36. //mount
  37. $cmd = $ShareName . ' ' . $id . ' ' . $pass;
  38. exec($cmd, $output, $result);
  39. if ($result != 0){
  40. //$share = strrchr( $mydir,'/');
  41. //$cmd = $ShareName . " " . $id . " " . $pass;
  42. //echo "<script>alert('Can not mount $share');</script>";
  43. echo "<script>window.open('smblogin.php?dir=$mydir', 'All', 'width=350,height=150');</script>";
  44. //exec($cmd, $output, $result);
  45. //echo "<script>alert('mydirectory.....$cmd');</script>";
  46. echo "<script>location.href='videolist.php?dir=$uplink';</script>";
  47. }else if($id != ''){
  48. echo "<script>location.href='videolist.php?dir=$mydir';</script>";
  49. }
  50. }
  51. $files = myscan($mydir);
  52. sort($files);
  53. //$mydir = str_replace("(", "\(", $mydir);
  54. //$mydir = str_replace(")", "\)", $mydir);
  55. $command = 'cd ' .$mydir1.';ls -alh > /tmp/aaa' ;
  56. shell_exec($command);
  57. $file1 = "/tmp/aaa";
  58. $fp1 = fopen($file1, 'r');
  59. //$fileData1 = fread($fp1, filesize($file1));
  60. $j=0;
  61. while (!feof($fp1)) {
  62. $line1[$j++] = fgets($fp1, 4096);
  63. }
  64. fclose($fp1);
  65. }else{
  66. $file = "/tmp/myshare/share.list";
  67. $fp = fopen($file, 'r');
  68. //$fileData = fread($fp, filesize($file));
  69. $j=0;
  70. while (!feof($fp)) {
  71. $files[$j++] = fgets($fp, 4096);
  72. }
  73. fclose($fp);
  74. }
  75. //echo "<script>alert('val of J ......$j');</script>";
  76. //$files = explode("\n", $fileData);
  77. //$files = explode("\n", $fileData);
  78. }else{
  79. $root = "/tmp/usbmounts";
  80. if ((substr($_GET['dir'],0,2) != '/.') and (substr($_GET['dir'],0,1) != '.') and ($_GET['dir'] != '')) {
  81. $mydir = $root . $_GET['dir'];
  82. $mediapath = stripslashes($_GET['dir']);
  83. }else{
  84. $mydir = $root;
  85. }
  86. //echo "<script>alert('$mydir');</script>";
  87. $uplink = substr_replace($_GET['dir'],'',strlen($_GET['dir'])-strlen(strrchr( $_GET['dir'],'/')));
  88. $files = myscan($mydir);
  89. sort($files);
  90. $mydir1 = $mydir;
  91. $mydir1 = str_replace("(", "\(", $mydir1);
  92. $mydir1 = str_replace(")", "\)", $mydir1);
  93. $command = 'cd ' .str_replace(" ", "\ ", $mydir1).';ls -alh > /tmp/aaa' ;
  94. shell_exec($command);
  95. $file1 = "/tmp/aaa";
  96. $fp1 = fopen($file1, 'r');
  97. //$fileData1 = fread($fp1, filesize($file1));
  98. $j=0;
  99. while (!feof($fp1)) {
  100. $line1[$j++] = fgets($fp1, 4096);
  101. }
  102. fclose($fp1);
  103. }
  104. function myscan($dir) {
  105. $arrfiles = array();
  106. $arrfiles = opendir(stripslashes($dir));
  107. while (false !== ($filename = readdir($arrfiles))) {
  108. $files[] = $filename;
  109. }
  110. return $files;
  111. }
  112. $HDDInfo = shell_exec("df -h|grep /dev/scsi/host0/bus0/target0/lun0/part1");
  113. sscanf($HDDInfo,"%s %s %s %s", $aaa,$HDDTotal, $HDDUsed, $HDDFree);
  114. ?>
  115. <HTML>
  116. <head>
  117. <script language=javascript>
  118. function goto(form){
  119. var index=form.File_Manager.selectedIndex
  120. if (form.File_Manager.options[index].value != "") {
  121. if (form.File_Manager.options[index].value == "creatfolder.php?dir=<?echo $mediapath;?>") {
  122. window.open(form.File_Manager.options[index].value,'New_folder','height=200,width=550,left=150,top=200');
  123. }else if (form.File_Manager.options[index].value == "copy.php?dir=<?echo $mediapath;?>") {
  124. window.open(form.File_Manager.options[index].value,'copy','height=635,width=987,left=50,top=50');
  125. }else{
  126. window.open(form.File_Manager.options[index].value,'FileManager','height=630,width=550,left=220,top=50');
  127. }
  128. }
  129. }
  130. function newwindow(w,h,webaddress, name){
  131. //alert(webaddress);
  132. var viewimageWin = window.open(webaddress,name,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width="+w+",height="+h);
  133. viewimageWin.moveTo(screen.availWidth/2-(w/2),screen.availHeight/2-(h/2));
  134. }
  135. function PlayFolder(value){
  136. alert(value);
  137. document.folderPlay.target = 'gframe';
  138. document.folderPlay.action = value;
  139. document.folderPlay.submit();
  140. }
  141. function PlayFile(value){
  142. alert(value);
  143. document.filePlay.target = 'gframe';
  144. document.filePlay.action = value;
  145. document.filePlay.submit();
  146. }
  147. /*function MM_controlSound(x, _sndObj, sndFile) { //v3.0
  148. var i, method = "", sndObj = eval(_sndObj);
  149. if (sndObj != null) {
  150. if (navigator.appName == 'Netscape') method = "play";
  151. else {
  152. if (window.MM_WMP == null) {
  153. window.MM_WMP = false;
  154. for(i in sndObj) if (i == "ActiveMovie") {
  155. window.MM_WMP = true; break;
  156. } }
  157. if (window.MM_WMP) method = "play";
  158. else if (sndObj.FileName) method = "run";
  159. } }
  160. if (method) eval(_sndObj+"."+method+"()");
  161. else window.location = sndFile;
  162. }
  163. function copy(text) {
  164. if (window.clipboardData) {
  165. window.clipboardData.setData("Text",text);
  166. }else{
  167. }
  168. }*/
  169. function alertUser(){
  170. alert('<?echo $STR_Link_Copied_To_Clipboard;?>');
  171. }
  172. </script>
  173. <!--embed name='CS1022563046202' src='dlf/click.wav' loop=false
  174. autostart=false MASTERSOUND hidden=true width=0 height=0>
  175. </embed-->
  176. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  177. <title><?echo $STR_Title;?></title>
  178. <link rel="stylesheet" type="text/css" href="dlf/styles.css" />
  179. </head>
  180. <body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 oncontextmenu="return false;">
  181. <div id="container">
  182. <center>
  183. <table width="996" cellspacing="0" cellpadding="0" border="0">
  184. <!--tr>
  185. <td width="940" align="right" valign="middle"><font face="Arial" color="#748e94" size="1"><a href="logout.php"><font face="Arial" color="#748e94" size="1"><?echo $STR_Logout;?></a> | <a href="register_form.php"><font face="Arial" color="#748e94" size="1"><?echo $STR_Setup;?></a> </font></td>
  186. </tr-->
  187. <tr>
  188. <td align="center"><table height="94" background="dlf/top_menu.jpg" width="996" border="0" cellspacing="0" cellpadding="0">
  189. <tr>
  190. <td width="189"><img src="dlf/icon_video.jpg" width="189" height="94" /><td>
  191. <td valign="bottom">
  192. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  193. <tr>
  194. <td width="5" valign="middle">&nbsp;</td>
  195. <td colspan="9" valign="middle"><font face="arial" color="#ff0000"><h2><?echo $STR_Video_title;?></h2></font></td>
  196. </tr>
  197. <tr>
  198. <td width="5" valign="bottom">&nbsp;</td>
  199. <!--td height="30" width="40" valign="bottom"><font face="arial" color="white" size="2">
  200. <a href="index.php"><?echo $STR_Home;?></a></td-->
  201. <td height="30" width="40" valign="bottom" align="middle">
  202. <a href="videolist.php?dir=<?echo $mediapath;?>">
  203. <font face="arial" color="#ff0000" size="2"><u><?echo $STR_Video;?></u></font></a></td>
  204. <td height="30" width="65" valign="bottom" align="middle"><font face="arial" color="white" size="2">
  205. <a href="audiolist.php?dir=<?echo $mediapath;?>"><?echo $STR_Audio;?></a></td>
  206. <td height="30" width="40" valign="bottom" align="middle"><font face="arial" color="white" size="2">
  207. <a href ="imagelist.php?dir=<?echo $mediapath;?>"><?echo $STR_Photo;?></a></td>
  208. <td height="30" width="65" valign="bottom" align="middle"><font face="arial" color="white" size="2">
  209. <a href="otherlist.php?dir=<?echo $mediapath;?>"><?echo $STR_All;?></a>&nbsp&nbsp|
  210. <td height="30" width="30" valign="bottom">
  211. <?
  212. //Mylist
  213. if (($Netshare_path != "/tmp/myshare")){
  214. echo"<input type='button' class='btn_1' onMouseOver='this.style.color= \"#ff0000\"' onMouseOut='this.style.color=\"#FFFFFF\"' name='add' value='".$STR_Mylist."' onclick=\"newwindow(987, 675, 'm3uVideo.php', 'videolist');\";>";
  215. }
  216. echo '</td><td height="30" width="40" valign="bottom">';
  217. //Upload
  218. //if (($mediapath != '') and (strncmp($mediapath, '/Media_Library', 14))){
  219. if ($mediapath != ''){
  220. echo"<input type='button' class='btn_1' onMouseOver='this.style.color= \"#ff0000\"' onMouseOut='this.style.color=\"#FFFFFF\"' name='upload' value='".$STR_Upload."' onclick=\"newwindow(467, 600, 'upload.php?dir=$mediapath', 'upload');\";>";
  221. }
  222. echo '</td><td height="30" width="40" valign="bottom">';
  223. //Filemanager
  224. //if (($mediapath != '') and (strncmp($mediapath, '/Media_Library', 14))){
  225. if ($mediapath != ''){ ?>
  226. <FORM NAME="FileManager">
  227. <select name="File_Manager" class="listbox" ONCHANGE="goto(this.form)" >
  228. <option value=""><?echo $STR_Filemanager;?></option>
  229. <option value="creatfolder.php?dir=<?echo $mediapath;?>"><?echo $STR_NewFolder;?></option>
  230. <option value="rename.php?dir=<?echo $mediapath;?>"><?echo $STR_Rename;?></option>
  231. <option value="copy.php?dir=<?echo $mediapath;?>"><?echo $STR_CopyMove;?></option>
  232. <option value="delete.php?dir=<?echo $mediapath;?>"><?echo $STR_Delete;?></option>
  233. <option value="zip.php?dir=<?echo $mediapath;?>">Archive</option>
  234. </select>
  235. </FORM>
  236. <?
  237. }
  238. ?>
  239. </font></td>
  240. </tr>
  241. </table>
  242. </td>
  243. <td width="300" valign="bottom"><a href="index.php"><img src="dlf/mvix_logo.png" width="300" height="72"></td>
  244. </tr>
  245. <tr><td>
  246. <!--div style="border:solid 1px black; width:60px; height:20px;">
  247. <object width="60" height="20">
  248. <PARAM NAME=FlashVars VALUE="txtToCopy=Raju.Lia.com&js=alertUser()">
  249. <param name="movie" value="copyButton.swf">
  250. <embed src="copyButton.swf" flashvars="txtToCopy=Raju.Lia.com&js=alertUser()" width="60" height="20">
  251. </embed>
  252. </object>
  253. </div-->
  254. </td></tr></table>
  255. </td>
  256. </tr>
  257. <tr height="12"><td></td></tr>
  258. <tr>
  259. <td height=100% align='center' valign='bottom'>
  260. <div id="listingcontainer">
  261. <table><tr height=12><td></td></tr></table>
  262. <div id="listing">
  263. <?
  264. echo "<div>";
  265. if(!$_GET["dir"]==''){
  266. echo '<table width="846" height="27" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'" style="border-bottom:1px solid #000000;"><tr><td>';
  267. echo "<table><tr><td><img src='dlf/dirup.png' align='center'>";
  268. echo "<td colspan='250'><a href='" . $_SERVER['PHP_SELF'] . "?dir=" . $uplink ."'>" . $STR_ParentDirectory . "</a></td></tr></table>";
  269. echo "</td></tr></table>";
  270. }
  271. /*
  272. $mydir = str_replace("(", "\(", $mydir);
  273. $mydir = str_replace(")", "\)", $mydir);
  274. $command = 'cd ' .str_replace(" ", "\ ", $mydir).';ls -alh > /tmp/aaa' ;
  275. shell_exec($command);
  276. $file1 = "/tmp/aaa";
  277. $fp1 = fopen($file1, 'r');
  278. //$fileData1 = fread($fp1, filesize($file1));
  279. $i=0;
  280. while (!feof($fp1)) {
  281. $line1[$i++] = fgets($fp1, 4096);
  282. }
  283. fclose($fp1);
  284. */
  285. //$line1 = preg_split("/\n/", $fileData1);
  286. if ($Netshare_path == "/tmp/myshare"){
  287. for ($x=0; $x<($j-1); $x++) {
  288. if ($mydir == "/tmp/myshare"){
  289. echo '<table width="846" height="27" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'" style="border-bottom:1px solid #000000;">';
  290. echo '<tr><td width=400>';
  291. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  292. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files[$x] . "</td>";
  293. echo "</tr></table>";
  294. echo "</td></tr></table>";
  295. }else if(substr($line1[$x],0,1) == 'd'){
  296. if (($files[$x] != '.') and ($files[$x] != "..") and ($files[$x] != "Recycled") and ($files[$x] != "System Volume Information") and (substr($files[$x],0,1) != ".") and ($files[$x] != "lost+found")){
  297. echo '<table width="846" height="27" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'" style="border-bottom:1px solid #000000;">';
  298. echo '<tr><td width=400>';
  299. if (strlen($files[$x]) > 40) {
  300. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  301. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . substr($files[$x],0,40) . "...</td>";
  302. echo "</tr></table>";
  303. }else{
  304. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  305. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files[$x] . "</td>";
  306. echo "</tr></table>";
  307. }
  308. /* echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  309. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files[$x] . "</td>";
  310. echo "</tr></table>";*/
  311. //if ($mediapath != ""){
  312. echo "</td><td width='20'>";
  313. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  314. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Video $mediapath&file=$files[$x]/', 'play');\"; href='#'><img src='dlf/video_tv.png' width='20' height='20' title='$STR_Play_Video'></td>";
  315. echo "</tr></table>";
  316. echo "</td><td width='20'>";
  317. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  318. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Audio $mediapath&file=$files[$x]/' , 'play');\"; href='#'><img src='dlf/audio_tv.png' width='20' height='20' title='$STR_Play_Audio'></td>";
  319. echo "</tr></table>";
  320. echo "</td><td width='20'>";
  321. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  322. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Photo $mediapath&file=$files[$x]/', 'play');\"; href='#'><img src='dlf/photo_tv.png' width='20' height='20' title='$STR_Play_Photo'></td>";
  323. echo "</tr></table>";
  324. //}
  325. echo "</td>";
  326. echo "<td width='370'></td>";
  327. echo "</tr></table>";
  328. }
  329. }
  330. }
  331. }else{
  332. for ($x=0; $x<($j-1); $x++) {
  333. if (($files[$x] != '.') and ($files[$x] != "..") and ($files[$x] != "Recycled") and ($files[$x] != "System Volume Information") and (substr($files[$x],0,1) != ".") and ($files[$x] != "lost+found")){
  334. //echo "<div>";
  335. //if(is_dir($mydir . "/" . $files[$x])) {
  336. // $path = $mydir . "/" . $files[$x];
  337. //if(substr(exec("ls -dl '$path'"),0,1) == 'd'){
  338. if (substr($line1[$x],0,1) == 'd'){
  339. $files1[$x] = $files[$x];
  340. if ($aaa!= ""){
  341. $files1[$x] = str_replace("sda", "HDD", $files1[$x]);
  342. $files1[$x] = str_replace("sdb1", "USB1", $files1[$x]);
  343. $files1[$x] = str_replace("sdc1", "USB2", $files1[$x]);
  344. $files1[$x] = str_replace("sdd1", "USB3", $files1[$x]);
  345. $files1[$x] = str_replace("sdb", "USB", $files1[$x]);
  346. $files1[$x] = str_replace("sdc", "USB", $files1[$x]);
  347. }else{
  348. $files1[$x] = str_replace("sda1", "USB1", $files1[$x]);
  349. $files1[$x] = str_replace("sdb1", "USB2", $files1[$x]);
  350. $files1[$x] = str_replace("sdc1", "USB3", $files1[$x]);
  351. $files1[$x] = str_replace("sdd1", "USB4", $files1[$x]);
  352. $files1[$x] = str_replace("sdb", "USB", $files1[$x]);
  353. $files1[$x] = str_replace("sdc", "USB", $files1[$x]);
  354. }
  355. //echo '<table width="846" height="3" cellspacing="0" cellpadding="0" border="0" onMouseOver="MM_controlSound(\'play\',\'document.CS1022563046202\',\'dlf/click.wav\')" onMouseOut="MM_controlSound(\'play\',\'document.CS1022563046202\',\'dlf/click.wav\')">';
  356. echo '<table width="846" height="27" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'" style="border-bottom:1px solid #000000;">';
  357. echo '<tr><td width=400>';
  358. if (strlen($files[$x]) > 40) {
  359. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  360. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . substr($files1[$x],0,40) . "...</td>";
  361. echo "</tr></table>";
  362. }else{
  363. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  364. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files1[$x] . "</td>";
  365. echo "</tr></table>";
  366. }
  367. if ($mediapath != ""){
  368. echo "</td><td width='20'>";
  369. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  370. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Video $mediapath&file=$files[$x]/', 'play');\"; href='#'><img src='dlf/video_tv.png' width='20' height='20' title='$STR_Play_Video'></td>";
  371. echo "</tr></table>";
  372. echo "</td><td width='20'>";
  373. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  374. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Audio $mediapath&file=$files[$x]/' , 'play');\"; href='#'><img src='dlf/audio_tv.png' width='20' height='20' title='$STR_Play_Audio'></td>";
  375. echo "</tr></table>";
  376. echo "</td><td width='20'>";
  377. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  378. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Photo $mediapath&file=$files[$x]/', 'play');\"; href='#'><img src='dlf/photo_tv.png' width='20' height='20' title='$STR_Play_Photo'></td>";
  379. echo "</tr></table>";
  380. }
  381. echo "</td>";
  382. echo "<td width='370'></td>";
  383. echo "</tr>";
  384. echo "</table>";
  385. $line1[$x] = NULL;
  386. }
  387. }
  388. }
  389. }
  390. //for NetShares
  391. if (($mediapath == "") and ($Netshare_path != "/tmp/myshare")){
  392. echo '<table width="846" height="27" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'" style="border-bottom:1px solid #000000;">';
  393. echo '<tr><td width=400>';
  394. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  395. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=/tmp/myshare\" class='rollover'>Network Shares</td>";
  396. //echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>Network Shares</td>";
  397. echo "</tr></table>";
  398. echo "</td>";
  399. echo "<td width='370'></td>";
  400. echo "</tr></table>";
  401. }
  402. //for NetShares
  403. for ($x=0; $x<($j-1); $x++) {
  404. //if (($files[$x] != '.') and ($files[$x] != "..")) {
  405. // echo "<div>";
  406. //if(!is_dir($mydir . "/" . $files[$x])) {
  407. if($line1[$x] == NULL)
  408. continue;
  409. if (substr($line1[$x],0,1) != 'd'){
  410. if ((strtolower(strrchr($files[$x],'.')) == ".wmv")||(strtolower(strrchr($files[$x],'.')) == ".mpg")|| (strtolower(strrchr($files[$x],'.')) == ".avi") ||(strtolower(strrchr($files[$x],'.')) == ".dat")||(strtolower(strrchr($files[$x],'.')) == ".mpeg")||(strtolower(strrchr($files[$x],'.')) == ".divx")||(strtolower(strrchr($files[$x],'.')) == ".xvid")||(strtolower(strrchr($files[$x],'.')) == ".mkv")||(strtolower(strrchr($files[$x],'.')) == ".mov")||(strtolower(strrchr($files[$x],'.')) == ".asf")||(strtolower(strrchr($files[$x],'.')) == ".ts")||(strtolower(strrchr($files[$x],'.')) == ".ogm")||(strtolower(strrchr($files[$x],'.')) == ".mp4") ||(strtolower(strrchr($files[$x],'.')) == ".vob")||(strtolower(strrchr($files[$x],'.')) == ".flv") ||(strtolower(strrchr($files[$x],'.')) == ".m4v"))
  411. {
  412. if ($Netshare_path == "/tmp/myshare"){
  413. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media3" . substr($mediapath,12) .'/'.$files[$x];
  414. }else{
  415. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  416. }
  417. //$file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  418. $file1 = urlencode(str_replace(' ', '%20', $file));
  419. $ext = strtolower(substr($files[$x], strrpos($files[$x], '.')+1));
  420. if($filetypes[$ext]) {
  421. $icon = $filetypes[$ext];
  422. } else {
  423. $icon = 'unknown.png';
  424. }
  425. echo '<table width="846" height="27" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'" style="border-bottom:1px solid #000000;">';
  426. echo '<tr><td>';
  427. echo "<table width='390' cellspacing='0' cellpadding='0' border='0'> <tr>";
  428. if (strlen($files[$x]) > 40) {
  429. echo "<table><tr><td > <img src='dlf/video.png' align='center'>";
  430. echo "<td width='380'><a href='$file'><font color= 'white' face='Arial' size='2'>" . substr($files[$x],0,40) . "...</td>";
  431. //echo "<td width='380'><a href='$file'>" . substr($files[$x],0,40) . "...</td>";}
  432. echo "<td>";
  433. ?>
  434. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  435. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  436. <param name="movie" value="dlf/copyButton.swf">
  437. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  438. </embed>
  439. </object>
  440. <?
  441. echo "</td>";
  442. }else {
  443. echo "<table><tr><td> <img src='dlf/video.png' align='center'></td>";
  444. echo "<td width='380'><a href='$file'><font color= 'white' face='Arial' size='2'>" . $files[$x] . "</td>";
  445. //echo "<td width='380'><a href='$file'>" . $files[$x] . "</td>";
  446. echo "<td>";
  447. ?>
  448. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  449. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  450. <param name="movie" value="dlf/copyButton.swf">
  451. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  452. </embed>
  453. </object>
  454. <?
  455. echo "</td>";
  456. }
  457. echo "</tr></table>";
  458. echo "<td>";
  459. echo "<table width='20' height='16' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  460. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Video $mediapath&file=$files[$x]', 'play');\"; href='#'><img src='dlf/play.png' width='16' height='16' title='$STR_Play'></td>";
  461. echo "</tr></table>";
  462. echo "</td>";
  463. echo "<td>";
  464. echo "<table width='22' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  465. echo "<td><a onClick=\"newwindow(600, 600, 'gomplay.php?dir=$mediapath&file=$files[$x]', 'gom');\"; href='#'><img src='dlf/gom.png' width='18' height='17' title='Gom Player'></td>";
  466. echo "</tr></table>";
  467. echo "</td>";
  468. echo "<td>";
  469. echo "<table width='20' height='2' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  470. echo "<td><a onClick=\"newwindow(707, 545, 'vlc.php?dir=$mediapath&file=$files[$x]', 'vlc');\"; href='#'><img src='dlf/vlc.png' width='15' height='17' title='VLC Player'></td>";
  471. echo "</tr></table>";
  472. echo "</td>";
  473. echo "<td>";
  474. echo "<table width='35' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  475. if ((strtolower(strrchr($files[$x],'.')) == ".wmv")||(strtolower(strrchr($files[$x],'.')) == ".mpg")|| (strtolower(strrchr($files[$x],'.')) == ".dat")||(strtolower(strrchr($files[$x],'.')) == ".mpeg")||(strtolower(strrchr($files[$x],'.')) == ".asf") ||(strtolower(strrchr($files[$x],'.')) == ".m4v"))
  476. {
  477. echo "<td><a onClick=\"newwindow(600, 600, 'winplay.php?dir=$mediapath&file=$files[$x]', 'WMP');\"; href='#'><img src='dlf/winmedia.png' width='16' height='17' title='Windows Media Player'></td>";
  478. }
  479. echo "</tr></table>";
  480. echo "</td>";
  481. echo "</a>";
  482. echo "<td>";
  483. echo "<table width='90' height='2' cellspacing='0' cellpadding='0' border='0' > <tr><td>";
  484. ?>
  485. <font color= "white" face="Arial" size="2">
  486. <?
  487. //$i = 0;
  488. //while ($i < sizeof($line1)) {
  489. // if($line1[$i] == NULL) {
  490. // $i++;
  491. // continue;
  492. // }
  493. sscanf($line1[$x],"%s %s %s %s %s %s %s %s", $a,$b, $c, $d, $Size, $mnth, $day, $time);
  494. // $Name = substr(strstr($line1[$i],$time),strlen($time)+1);
  495. // if ($Name == $files[$x]) {
  496. echo $Size;
  497. echo "</td></tr> </table>";
  498. echo "</td>";
  499. echo "<td>";
  500. echo "<table width='170' height='2' cellspacing='0' cellpadding='0' border='0'> <tr><td>";
  501. echo '<font color= "white" face="Arial" size="2">';
  502. echo $mnth. ' ' .$day. ' ' .$time;
  503. //$line1[$i] = NULL;
  504. //break;
  505. // }
  506. // $i++;
  507. //}
  508. //echo "</td></tr> </table>";
  509. //echo "</td>";
  510. //echo "<td>";
  511. //echo "<table width='170' height='2' cellspacing='0' cellpadding='0' border='0'> <tr><td>";
  512. //$date= date("M d Y h:i:s A", filemtime($mydir . "/" . $files[$x]));
  513. //printf("%s", $date);
  514. //echo "<td colspan=\"25\">" . date("M d Y h:i:s A", filemtime($mydir . "/" . $files[$x])) . "</td>";
  515. echo "</td></tr> </table>";
  516. echo "</td>";
  517. echo "<td>";
  518. echo '<table width="80" height="3" cellspacing="0" cellpadding="0" border="0">';
  519. echo '<tr><td>';
  520. echo "<table cellspacing='0' cellpadding='0' cellspacing='0' cellpadding='0' border='0'><tr><td width='20'>
  521. <a href=\"download.php?dir=$mediapath&file=$files[$x]\";><img src='dlf/download_icon.png' align='center'>$nsbp$nsbp";
  522. echo "<td><a href=\"download.php?dir=$mediapath&file=$files[$x]\"; class='g'>Download</td></tr></table>";
  523. echo "</td></tr></table>";
  524. echo "</font>";
  525. echo "</td>";
  526. echo "</tr>";
  527. echo "</table>";
  528. }
  529. }
  530. // echo "</div>";
  531. //}
  532. }
  533. ?>
  534. </td>
  535. </tr>
  536. </table>
  537. </div>
  538. </div>
  539. </div>
  540. <center>
  541. <table cellspacing='0' cellpadding='0' border='0' width=996 valign="center">
  542. <tr height="5"><td></td></tr>
  543. <tr><td width=70></td><td width=700>
  544. <?
  545. $mediapath1 = $mediapath;
  546. if ($aaa!= ""){
  547. $mediapath1 = str_replace("sda", "HDD", $mediapath1);
  548. $mediapath1 = str_replace("sdb1", "USB1", $mediapath1);
  549. $mediapath1 = str_replace("sdc1", "USB2", $mediapath1);
  550. $mediapath1 = str_replace("sdd1", "USB3", $mediapath1);
  551. $mediapath1 = str_replace("sdb", "USB", $mediapath1);
  552. $mediapath1 = str_replace("sdc", "USB", $mediapath1);
  553. $mediapath1 = str_replace("/tmp/myshare", "/NetShare", $mediapath1);
  554. }else{
  555. $mediapath1 = str_replace("sda1", "USB1", $mediapath1);
  556. $mediapath1 = str_replace("sdb1", "USB2", $mediapath1);
  557. $mediapath1 = str_replace("sdc1", "USB3", $mediapath1);
  558. $mediapath1 = str_replace("sdd1", "USB4", $mediapath1);
  559. $mediapath1 = str_replace("sdb", "USB", $mediapath1);
  560. $mediapath1 = str_replace("sdc", "USB", $mediapath1);
  561. $mediapath1 = str_replace("/tmp/myshare", "/NetShare", $mediapath1);
  562. }
  563. if (strlen($mediapath) > 90) {
  564. echo "<font face='Arial' color='white' size='2'>" . substr($mediapath1,0,90)."...</font>";
  565. }else{
  566. echo "<font face='Arial' color='white' size='2'>$mediapath1</font>";
  567. }
  568. ?>
  569. </td>
  570. <td>
  571. <? if (($mediapath != '') && ($aaa!= "") && (substr($mediapath, 0, 4) == "/sda")){
  572. echo '<table cellspacing="0" cellpadding="0" border="0"><tr>';
  573. echo '<td width=25><font face="Arial" color="White" size="1">HDD</font></td>';
  574. echo '<td width=50><font face="Arial" color="White" size="1">'. $STR_HDDUsed .'</font></td>';
  575. echo '<td width=50><font face="Arial" color="White" size="1">'. $STR_HDDFree .'</font></td>';
  576. echo '<td width=50><font face="Arial" color="White" size="1">'. $STR_HDDTotal .'</font></td>';
  577. echo '</tr>';
  578. echo '<tr>';
  579. echo '<td width=25></td>';
  580. echo '<td ><font face="Arial" color="White" size="1">';
  581. //$HDDInfo = shell_exec("df -h|grep /dev/ide/host0/bus0/target0/lun0/part1");
  582. //$HDDInfo = shell_exec("df -h|grep /dev/scsi/host1/bus0/target0/lun0/part1");
  583. //$HDDUsed = strstr($HDDUsed, ' ');
  584. //sscanf($HDDInfo,"%s %s %s %s", $aaa,$HDDTotal, $HDDUsed, $HDDFree);
  585. echo "$HDDUsed";
  586. echo '</td>';
  587. echo '<td><font face="Arial" color="White" size="1">';
  588. // $HDDFree = shell_exec("df -h|grep /dev/ide/host0/bus0/target0/lun0/part1|cut -f15 -d' '");
  589. echo "$HDDFree";
  590. echo '</td>';
  591. echo '<td><font face="Arial" color="White" size="1">';
  592. // $HDDTotal = shell_exec("df -h|grep /dev/ide/host0/bus0/target0/lun0/part1|cut -f5 -d' '");
  593. echo "$HDDTotal";
  594. echo '</td>';
  595. echo '</tr>';
  596. echo '</table>';
  597. /* }else if($mediapath != ''){
  598. echo '<table cellspacing="0" cellpadding="0" border="0"><tr>';
  599. echo '<td width=25><font face="Arial" color="#748e94" size="1">HDD</font></td>';
  600. echo '<td width=50><font face="Arial" color="#748e94" size="1">'. $STR_HDDUsed .'</font></td>';
  601. echo '<td width=50><font face="Arial" color="#748e94" size="1">'. $STR_HDDFree .'</font></td>';
  602. echo '<td width=50><font face="Arial" color="#748e94" size="1">'. $STR_HDDTotal .'</font></td>';
  603. echo '</tr>';
  604. echo '<tr>';
  605. echo '<td width=25></td>';
  606. echo '<td ><font face="Arial" color="#748e94" size="1">';
  607. $HDDInfo = shell_exec("df -h|grep /dev/ide/host0/bus0/target0/lun0/part7");
  608. sscanf($HDDInfo,"%s %s %s %s", $aaa,$HDDTotal, $HDDUsed, $HDDFree);
  609. echo "$HDDUsed";
  610. echo '</td>';
  611. echo '<td><font face="Arial" color="#748e94" size="1">';
  612. // $HDDFree = shell_exec("df -h|grep /dev/ide/host0/bus0/target0/lun0/part7|cut -f15 -d' '");
  613. echo "$HDDFree";
  614. echo '</td>';
  615. echo '<td><font face="Arial" color="#748e94" size="1">';
  616. // $HDDTotal = shell_exec("df -h|grep /dev/ide/host0/bus0/target0/lun0/part7|cut -f5 -d' '");
  617. echo "$HDDTotal";
  618. echo '</td>';
  619. echo '</tr>';
  620. echo '</table>'; */
  621. }
  622. ?>
  623. </td>
  624. </tr>
  625. </table>
  626. <iframe name='gframe' width=0 height=0 style="display:none"></iframe>
  627. <table width="700" border="0" cellspacing="0" cellpadding="0">
  628. <tr height=4><td></td></tr>
  629. <tr>
  630. <td align="right" valign="top" style="border-top:solid 1px; border-top-color:#FFFFFF"><table width="900" border="0" cellspacing="0" cellpadding="0">
  631. <tr><td width=20></td>
  632. <td width=440 valign="middle"><font face="Arial" color="#748e94" size="2"><a href="index.php"><?echo $STR_Home;?></a> | <a href="register_form.php"><?echo $STR_Setup;?></a>
  633. | <a href="#" onclick="newwindow(318, 356, 'rc', 'rc_1');";>RC</a>
  634. | <a href="#" onclick="newwindow(250, 680, 'rc2', 'rc_2');";>RC2</a>
  635. <?if (file_exists("/tmp/usbmounts/sda1/scripts/xJukebox/index.php")){?>
  636. | <a href="jukebox">Jukebox</a>
  637. <?}?>
  638. | <a href="logout.php"><?echo $STR_Logout;?></a></font></td>
  639. <td align=right>
  640. <table><tr><!--td align=right><font face="Arial" color="#000000" size="1"><b><?echo date('M, d Y | h:i A');?></td--></tr>
  641. <tr><td align=right><font face="Arial" color="#000000" size="1"><b>Copyright 2009 Xtreamer.net, All right reserved.</td></tr>
  642. </table>
  643. </td>
  644. <td align=right><img src="dlf/footer.png" width="175" height="51" usemap="#planetmap">
  645. <map name="planetmap">
  646. <area shape="rect" coords="05,100,135,2" href='#' onclick="window.open('http://xtreamer.net/','MyVideo','height=675,width=987,left=100,top=100, toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no');";/>
  647. </map>
  648. </td>
  649. </tr>
  650. </table>
  651. </td>
  652. </tr>
  653. </table>
  654. </center>
  655. </body>
  656. </HTML>