PageRenderTime 52ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/patches/Servicios/sbin/www/audiolist.php

https://github.com/frisco82/HMR600.com-Firmware
PHP | 754 lines | 517 code | 127 blank | 110 comment | 103 complexity | 1e7e2f435aad047958c622a69801f1a6 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. 'wma' => 'audio.jpg',
  12. 'mp3' => 'audio.jpg',
  13. 'wav' => 'audio.jpg',
  14. );
  15. $Netshare_path = substr($_GET['dir'],0,12);
  16. if ($Netshare_path == "/tmp/myshare"){
  17. $mydir = $_GET['dir'];
  18. $mediapath = stripslashes($_GET['dir']);
  19. if ($mydir != "/tmp/myshare"){
  20. $uplink = substr_replace($_GET['dir'],'',strlen($_GET['dir'])-strlen(strrchr( $_GET['dir'],'/')));
  21. //check whether already mounted?
  22. $mydir1 = $mydir;
  23. $mydir1 = str_replace("(", "\(", $mydir1);
  24. $mydir1 = str_replace(")", "\)", $mydir1);
  25. $mydir1 = str_replace(" ", "\ ", $mydir1);
  26. $cmd = "mount |grep ".$mydir1;
  27. exec($cmd, $output1, $result1);
  28. if((substr($mydir, -4) == ".smb") || (substr($mydir, -4) == ".nfs") and ($output1[0] == "")){
  29. $ShareName = '/tmp/myshare/.cmd'.strrchr( $mydir,'/');
  30. $ShareName = str_replace("(", "\(", $ShareName);
  31. $ShareName = str_replace(")", "\)", $ShareName);
  32. $ShareName = str_replace(" ", "\ ", $ShareName);
  33. //mount
  34. $cmd = $ShareName . ' ' . $id . ' ' . $pass;
  35. exec($cmd, $output, $result);
  36. if ($result != 0){
  37. //$share = strrchr( $mydir,'/');
  38. //$cmd = $ShareName . " " . $id . " " . $pass;
  39. //echo "<script>alert('Can not mount $share');</script>";
  40. echo "<script>window.open('smblogin.php?dir=$mydir', 'All', 'width=350,height=150');</script>";
  41. //exec($cmd, $output, $result);
  42. //echo "<script>alert('mydirectory.....$cmd');</script>";
  43. echo "<script>location.href='audiolist.php?dir=$uplink';</script>";
  44. }else if($id != ''){
  45. echo "<script>location.href='audiolist.php?dir=$mydir';</script>";
  46. }
  47. }
  48. $files = myscan($mydir);
  49. sort($files);
  50. //$mydir = str_replace("(", "\(", $mydir);
  51. //$mydir = str_replace(")", "\)", $mydir);
  52. $command = 'cd ' .$mydir1.';ls -alh > /tmp/aaa' ;
  53. shell_exec($command);
  54. $file1 = "/tmp/aaa";
  55. $fp1 = fopen($file1, 'r');
  56. //$fileData1 = fread($fp1, filesize($file1));
  57. $j=0;
  58. while (!feof($fp1)) {
  59. $line1[$j++] = fgets($fp1, 4096);
  60. }
  61. fclose($fp1);
  62. }else{
  63. $file = "/tmp/myshare/share.list";
  64. $fp = fopen($file, 'r');
  65. //$fileData = fread($fp, filesize($file));
  66. $j=0;
  67. while (!feof($fp)) {
  68. $files[$j++] = fgets($fp, 4096);
  69. }
  70. fclose($fp);
  71. }
  72. //echo "<script>alert('val of J ......$j');</script>";
  73. //$files = explode("\n", $fileData);
  74. //$files = explode("\n", $fileData);
  75. }else{
  76. $root = "/tmp/usbmounts";
  77. if ((substr($_GET['dir'],0,2) != '/.') and (substr($_GET['dir'],0,1) != '.') and ($_GET['dir'] != '')) {
  78. $mydir = $root . $_GET['dir'];
  79. $mediapath = stripslashes($_GET['dir']);
  80. }else{
  81. $mydir = $root;
  82. }
  83. //echo "<script>alert('$mydir');</script>";
  84. $uplink = substr_replace($_GET['dir'],'',strlen($_GET['dir'])-strlen(strrchr( $_GET['dir'],'/')));
  85. $files = myscan($mydir);
  86. sort($files);
  87. $mydir1 = $mydir;
  88. $mydir1 = str_replace("(", "\(", $mydir1);
  89. $mydir1 = str_replace(")", "\)", $mydir1);
  90. $command = 'cd ' .str_replace(" ", "\ ", $mydir1).';ls -alh > /tmp/aaa' ;
  91. shell_exec($command);
  92. $file1 = "/tmp/aaa";
  93. $fp1 = fopen($file1, 'r');
  94. //$fileData1 = fread($fp1, filesize($file1));
  95. $j=0;
  96. while (!feof($fp1)) {
  97. $line1[$j++] = fgets($fp1, 4096);
  98. }
  99. fclose($fp1);
  100. }
  101. function myscan($dir) {
  102. $arrfiles = array();
  103. $arrfiles = opendir(stripslashes($dir));
  104. while (false !== ($filename = readdir($arrfiles))) {
  105. $files[] = $filename;
  106. }
  107. return $files;
  108. }
  109. $HDDInfo = shell_exec("df -h|grep /dev/scsi/host0/bus0/target0/lun0/part1");
  110. sscanf($HDDInfo,"%s %s %s %s", $aaa,$HDDTotal, $HDDUsed, $HDDFree);
  111. ?>
  112. <HTML>
  113. <head>
  114. <script language=javascript>
  115. //window.onload = function() {
  116. // myScroll = new iScroll('listingcontainer', {vScrollBar: true, hScrollBar: true});
  117. //}
  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 setPng24(obj) {
  148. obj.width=obj.height=1;
  149. obj.className=obj.className.replace(/\bpng24\b/i,'');
  150. obj.style.filter =
  151. "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
  152. obj.src='';
  153. return '';
  154. }
  155. /*
  156. for iPod div scrolling function by one finger
  157. ref: http://chris-barr.com/entry/scrolling_a_overflowauto_element_on_a_touch_screen_device/
  158. function isTouchDevice(){
  159. try{
  160. document.createEvent("TouchEvent");
  161. return true;
  162. }catch(e){
  163. return false;
  164. }
  165. }
  166. function touchScroll(id){
  167. if(isTouchDevice){ //if touch events exist...
  168. var el=document.getElementById(id);
  169. var scrollStartPos=0;
  170. document.getElementById(id).addEventListener("touchstart", function(event) {
  171. scrollStartPos=this.scrollTop+event.touches[0].pageY;
  172. event.preventDefault();
  173. },false);
  174. document.getElementById(id).addEventListener("touchmove", function(event) {
  175. this.scrollTop=scrollStartPos-event.touches[0].pageY;
  176. event.preventDefault();
  177. },false);
  178. }
  179. }
  180. */
  181. function alertUser(){
  182. alert('<?echo $STR_Link_Copied_To_Clipboard;?>');
  183. }
  184. </script>
  185. <!--embed name='CS1022563046202' src='dlf/click.wav' loop=false
  186. autostart=false MASTERSOUND hidden=true width=0 height=0>
  187. </embed-->
  188. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  189. <title><?echo $STR_Title;?></title>
  190. <link rel="stylesheet" type="text/css" href="dlf/styles.css" />
  191. </head>
  192. <!--body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 oncontextmenu="return false;" onload="touchScroll('listing')" for iPod div scrilling-->
  193. <body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 oncontextmenu="return false;" onload="touchScroll('listing')">
  194. <div id="container">
  195. <center>
  196. <table width="996" cellspacing="0" cellpadding="0" border="0" valign="middle">
  197. <!--tr>
  198. <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>
  199. </tr-->
  200. <tr>
  201. <td align="center"><table height="94" background="dlf/top_menu.jpg" width="996" border="0" cellspacing="0" cellpadding="0">
  202. <tr>
  203. <td width="189"><img src="dlf/icon_music.jpg" width="189" height="94" /><td>
  204. <td valign="bottom">
  205. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  206. <tr>
  207. <td width="5" valign="middle">&nbsp;</td>
  208. <td colspan="9" valign="middle"><font face="arial" color="#ff0000"><h2><?echo $STR_Audio_title;?></h2></font></td>
  209. </tr>
  210. <tr>
  211. <td width="5" valign="bottom">&nbsp;</td>
  212. <!--td height="30" width="40" valign="bottom"><font face="arial" color="white" size="2">
  213. <a href="index.php"><?echo $STR_Home;?></a></td-->
  214. <td height="30" width="40" valign="bottom" align="middle"><font face="arial" color="white" size="2">
  215. <a href="videolist.php?dir=<?echo $mediapath;?>"><?echo $STR_Video;?></a></td>
  216. <td height="30" width="65" valign="bottom" align="middle">
  217. <a href="audiolist.php?dir=<?echo $mediapath;?>">
  218. <font face="arial" color="#ff0000" size="2"><u><?echo $STR_Audio;?></u></font></a></td>
  219. <td height="30" width="40" valign="bottom" align="middle"><font face="arial" color="white" size="2">
  220. <a href ="imagelist.php?dir=<?echo $mediapath;?>"><?echo $STR_Photo;?></a></td>
  221. <td height="30" width="65"valign="bottom" align="middle"><font face="arial" color="white" size="2">
  222. <a href="otherlist.php?dir=<?echo $mediapath;?>"><?echo $STR_All;?></a>&nbsp&nbsp|
  223. <td height="30" width="30" valign="bottom">
  224. <?
  225. //Mylist
  226. if (($Netshare_path != "/tmp/myshare")){
  227. 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, 'm3uMusic.php', 'musiclist');\";>";
  228. }
  229. echo '</td><td height="30" width="40" valign="bottom">';
  230. //Upload
  231. //if (($mediapath != '') and (strncmp($mediapath, '/Media_Library', 14))){
  232. if ($mediapath != ''){
  233. //echo"<input type='button' class='btn_1' name='upload' value='".$STR_Upload."' onclick=\"window.open('upload.php?dir=$mediapath','MyVideo','height=570,width=467,left=430,top=270');\";>";
  234. 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');\";>";
  235. }
  236. echo '</td><td height="30" width="40" valign="bottom">';
  237. //Filemanager
  238. //if (($mediapath != '') and (strncmp($mediapath, '/Media_Library', 14))){
  239. if ($mediapath != ''){ ?>
  240. <FORM NAME="FileManager">
  241. <select name="File_Manager" class="listbox" ONCHANGE="goto(this.form)">
  242. <option value=""><?echo $STR_Filemanager;?></option>
  243. <option value="creatfolder.php?dir=<?echo $mediapath;?>"><?echo $STR_NewFolder;?></option>
  244. <option value="rename.php?dir=<?echo $mediapath;?>"><?echo $STR_Rename;?></option>
  245. <option value="copy.php?dir=<?echo $mediapath;?>"><?echo $STR_CopyMove;?></option>
  246. <option value="delete.php?dir=<?echo $mediapath;?>"><?echo $STR_Delete;?></option>
  247. <option value="zip.php?dir=<?echo $mediapath;?>">Archive</option>
  248. </select>
  249. </FORM>
  250. <?
  251. }
  252. ?>
  253. </font></td>
  254. </tr>
  255. </table>
  256. </td>
  257. <td width="300" valign="bottom"><a href="index.php"><img src="dlf/mvix_logo.png" width="300" height="72"></td>
  258. </tr></table>
  259. </td>
  260. </tr>
  261. <tr height="12"><td></td></tr>
  262. <tr>
  263. <td height=100% align='center' valign='bottom'>
  264. <!--div style='width: 996; height: 405; overflow: scroll; border: none ; background: transparent; background-image:url("dlf/list_image.png") '-->
  265. <div id="listingcontainer">
  266. <table><tr height=12><td></td></tr></table>
  267. <div id="listing">
  268. <?
  269. echo "<div>";
  270. if(!$_GET["dir"]==''){
  271. 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>';
  272. echo "<table><tr><td><img src='dlf/dirup.png' align='center'>";
  273. echo "<td colspan='250'><a href='" . $_SERVER['PHP_SELF'] . "?dir=" . $uplink ."'>" . $STR_ParentDirectory . "</a></td></tr></table>";
  274. echo "</td></tr></table>";
  275. }
  276. /*
  277. $mydir = str_replace("(", "\(", $mydir);
  278. $mydir = str_replace(")", "\)", $mydir);
  279. $command = 'cd ' .str_replace(" ", "\ ", $mydir).';ls -alh > /tmp/aaa' ;
  280. shell_exec($command);
  281. $file1 = "/tmp/aaa";
  282. $fp1 = fopen($file1, 'r');
  283. //$fileData1 = fread($fp1, filesize($file1));
  284. $i=0;
  285. while (!feof($fp1)) {
  286. $line1[$i++] = fgets($fp1, 4096);
  287. }
  288. fclose($fp1);
  289. */
  290. //$line1 = preg_split("/\n/", $fileData1);
  291. if ($Netshare_path == "/tmp/myshare"){
  292. for ($x=0; $x<($j-1); $x++) {
  293. if ($mydir == "/tmp/myshare"){
  294. 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;">';
  295. echo '<tr><td width=400>';
  296. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  297. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files[$x] . "</td>";
  298. echo "</tr></table>";
  299. echo "</td></tr></table>";
  300. }else if(substr($line1[$x],0,1) == 'd'){
  301. 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")){
  302. 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;">';
  303. echo '<tr><td width=400>';
  304. if (strlen($files[$x]) > 40) {
  305. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  306. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . substr($files[$x],0,40) . "...</td>";
  307. echo "</tr></table>";
  308. }else{
  309. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  310. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files[$x] . "</td>";
  311. echo "</tr></table>";
  312. }
  313. //if ($mediapath != ""){
  314. echo "</td><td width='20'>";
  315. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  316. 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>";
  317. echo "</tr></table>";
  318. echo "</td><td width='20'>";
  319. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  320. 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>";
  321. echo "</tr></table>";
  322. echo "</td><td width='20'>";
  323. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  324. 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>";
  325. echo "</tr></table>";
  326. //}
  327. echo "</td>";
  328. echo "<td width='370'></td>";
  329. echo "</tr></table>";
  330. }
  331. }
  332. }
  333. }else{
  334. for ($x=0; $x<($j-1); $x++) {
  335. 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")){
  336. //echo "<div>";
  337. //if(is_dir($mydir . "/" . $files[$x])) {
  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("sda", "USB", $files1[$x]);
  353. $files1[$x] = str_replace("sdb", "USB", $files1[$x]);
  354. $files1[$x] = str_replace("sdc", "USB", $files1[$x]);
  355. $files1[$x] = str_replace("sdd", "USB", $files1[$x]);
  356. }
  357. 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;">';
  358. echo '<tr><td width=400>';
  359. if (strlen($files[$x]) > 40) {
  360. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  361. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . substr($files1[$x],0,40) . "...</td>";
  362. echo "</tr></table>";
  363. }else{
  364. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  365. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files1[$x] . "</td>";
  366. echo "</tr></table>";
  367. }
  368. if ($mediapath != ""){
  369. echo "</td><td width='20'>";
  370. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  371. 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>";
  372. echo "</tr></table>";
  373. echo "</td><td width='20'>";
  374. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  375. 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>";
  376. echo "</tr></table>";
  377. echo "</td><td width='20'>";
  378. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  379. 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>";
  380. echo "</tr></table>";
  381. }
  382. echo "</td>";
  383. echo "<td width='360'></td>";
  384. echo "</tr></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],'.')) == ".wma")||(strtolower(strrchr($files[$x],'.')) == ".mp3")||(strtolower(strrchr($files[$x],'.')) == ".wav")||(strtolower(strrchr($files[$x],'.')) == ".mp2")||(strtolower(strrchr($files[$x],'.')) == ".aac")||(strtolower(strrchr($files[$x],'.')) == ".ac3") ||(strtolower(strrchr($files[$x],'.')) == ".ogg") ||(strtolower(strrchr($files[$x],'.')) == ".dts") ||(strtolower(strrchr($files[$x],'.')) == ".flac") ||(strtolower(strrchr($files[$x],'.')) == ".m3u")
  411. ||(strtolower(strrchr($files[$x],'.')) == ".m3u8") ||(strtolower(strrchr($files[$x],'.')) == ".pls"))
  412. {
  413. if ($Netshare_path == "/tmp/myshare"){
  414. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media3" . substr($mediapath,12) .'/'.$files[$x];
  415. }else{
  416. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  417. }
  418. //$file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  419. $file1 = urlencode(str_replace(' ', '%20', $file));
  420. $ext = strtolower(substr($files[$x], strrpos($files[$x], '.')+1));
  421. if($filetypes[$ext]) {
  422. $icon = $filetypes[$ext];
  423. } else {
  424. $icon = 'unknown.png';
  425. }
  426. 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;">';
  427. echo '<tr ><td>';
  428. echo "<table width='390' cellspacing='0' cellpadding='0' border='0'> <tr>";
  429. if (strlen($files[$x]) > 40) {
  430. echo "<table><tr><td><img src='dlf/audio.png' align='center'>";
  431. echo "<td width='380'><a href='$file'><font color= 'white' face='Arial' size='2'>" . 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/audio.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>";
  446. ?>
  447. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  448. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  449. <param name="movie" value="dlf/copyButton.swf">
  450. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  451. </embed>
  452. </object>
  453. <?
  454. echo "</td>";
  455. }
  456. echo "</tr></table>";
  457. echo "<td>";
  458. echo "<table width='20' height='16' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  459. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Audio $mediapath&file=$files[$x]', 'play');\"; href='#'><img src='dlf/play.png' width='16' height='16' title='$STR_Play'></td>";
  460. echo "</tr></table>";
  461. echo "</td>";
  462. echo "<td>";
  463. echo "<table width='15' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  464. 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>";
  465. echo "</tr></table>";
  466. echo "</td>";
  467. echo "<td>";
  468. echo "<table width='15' height='2' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  469. echo "<td><a onClick=\"newwindow(700, 545, 'vlc.php?dir=$mediapath&file=$files[$x]', 'vlc');\"; class='g' href='#'>&nbsp&nbsp<img src='dlf/vlc.png' width='15' height='17' title='VLC Player'></td>";
  470. echo "</tr></table>";
  471. echo "</td>";
  472. echo "<td>";
  473. echo "<table width='35' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  474. if ((strtolower(strrchr($files[$x],'.')) == ".wma")||(strtolower(strrchr($files[$x],'.')) == ".mp3")||(strtolower(strrchr($files[$x],'.')) == ".wav")||(strtolower(strrchr($files[$x],'.')) == ".mp2") ||(strtolower(strrchr($files[$x],'.')) == ".flac"))
  475. {
  476. echo "<td><a onClick=\"newwindow(600, 600, 'winplay.php?dir=$mediapath&file=$files[$x]', 'WMP');\"; href='#'>&nbsp&nbsp<img src='dlf/winmedia.png' width='16' height='17' title='Windows Media Player'></td>";
  477. }
  478. echo "</tr></table>";
  479. echo "</td>";
  480. echo "</a>";
  481. echo "<td>";
  482. echo "<table width='90' height='2' cellspacing='0' cellpadding='0' border='0' > <tr><td>";
  483. ?>
  484. <font color= "white" face="Arial" size="2">
  485. <?
  486. //$i = 0;
  487. //while ($i < sizeof($line1)) {
  488. // if($line1[$i] == NULL)
  489. // continue;
  490. sscanf($line1[$x],"%s %s %s %s %s %s %s %s", $a,$b, $c, $d, $Size, $mnth, $day, $time);
  491. // $Name = substr(strstr($line1[$i],$time),strlen($time)+1);
  492. // if ($Name == $files[$x]) {
  493. echo $Size;
  494. echo "</td></tr> </table>";
  495. echo "</td>";
  496. echo "<td>";
  497. echo "<table width='170' height='2' cellspacing='0' cellpadding='0' border='0'> <tr><td>";
  498. echo '<font color= "white" face="Arial" size="2">';
  499. echo $mnth. ' ' .$day. ' ' .$time;
  500. // $line1[$i] = NULL;
  501. // break;
  502. // }
  503. // $i++;
  504. //}
  505. echo "</td></tr> </table>";
  506. echo "</td>";
  507. echo "<td>";
  508. echo '<table width="80" height="3" cellspacing="0" cellpadding="0" border="0">';
  509. echo '<tr><td>';
  510. echo "<table cellspacing='0' cellpadding='0' cellspacing='0' cellpadding='0' border='0'><tr><td width='20'>
  511. <a href=\"download.php?dir=$mediapath&file=$files[$x]\";><img src='dlf/download_icon.png' align='center'>$nsbp$nsbp";
  512. echo "<td><a href=\"download.php?dir=$mediapath&file=$files[$x]\"; class='g'>Download</td></tr></table>";
  513. echo "</td></tr></table>";
  514. echo "</font>";
  515. echo "</td>";
  516. echo "</tr>";
  517. echo "</table>";
  518. }
  519. }
  520. // echo "</div>";
  521. //}
  522. }
  523. ?>
  524. </td>
  525. </tr>
  526. </table>
  527. </div>
  528. </div>
  529. </div>
  530. <center>
  531. <table cellspacing='0' cellpadding='0' border='0' width=996 valign="center">
  532. <tr height="5"><td></td></tr>
  533. <tr><td width=70></td><td width=700>
  534. <?
  535. $mediapath1 = $mediapath;
  536. if ($aaa!= ""){
  537. $mediapath1 = str_replace("sda", "HDD", $mediapath1);
  538. $mediapath1 = str_replace("sdb1", "USB1", $mediapath1);
  539. $mediapath1 = str_replace("sdc1", "USB2", $mediapath1);
  540. $mediapath1 = str_replace("sdd1", "USB3", $mediapath1);
  541. $mediapath1 = str_replace("sdb", "USB", $mediapath1);
  542. $mediapath1 = str_replace("sdc", "USB", $mediapath1);
  543. $mediapath1 = str_replace("/tmp/myshare", "/NetShare", $mediapath1);
  544. }else{
  545. $mediapath1 = str_replace("sda1", "USB1", $mediapath1);
  546. $mediapath1 = str_replace("sdb1", "USB2", $mediapath1);
  547. $mediapath1 = str_replace("sdc1", "USB3", $mediapath1);
  548. $mediapath1 = str_replace("sdd1", "USB4", $mediapath1);
  549. $mediapath1 = str_replace("sdb", "USB", $mediapath1);
  550. $mediapath1 = str_replace("sdc", "USB", $mediapath1);
  551. $mediapath1 = str_replace("/tmp/myshare", "/NetShare", $mediapath1);
  552. }
  553. if (strlen($mediapath) > 90) {
  554. echo "<font face='Arial' color='white' size='2'>" . substr($mediapath1,0,90)."...</font>";
  555. }else{
  556. echo "<font face='Arial' color='white' size='2'>$mediapath1</font>";
  557. }
  558. ?>
  559. </td>
  560. <td>
  561. <? if (($mediapath != '') && ($aaa!= "") && (substr($mediapath, 0, 4) == "/sda")){
  562. echo '<table cellspacing="0" cellpadding="0" border="0"><tr>';
  563. echo '<td width=25><font face="Arial" color="White" size="1">HDD</font></td>';
  564. echo '<td width=50><font face="Arial" color="White" size="1">'. $STR_HDDUsed .'</font></td>';
  565. echo '<td width=50><font face="Arial" color="White" size="1">'. $STR_HDDFree .'</font></td>';
  566. echo '<td width=50><font face="Arial" color="White" size="1">'. $STR_HDDTotal .'</font></td>';
  567. echo '</tr>';
  568. echo '<tr>';
  569. echo '<td width=25></td>';
  570. echo '<td ><font face="Arial" color="White" size="1">';
  571. //$HDDInfo = shell_exec("df -h|grep /dev/scsi/host1/bus0/target0/lun0/part1");
  572. //sscanf($HDDInfo,"%s %s %s %s", $aaa,$HDDTotal, $HDDUsed, $HDDFree);
  573. echo "$HDDUsed";
  574. echo '</td>';
  575. echo '<td><font face="Arial" color="White" size="1">';
  576. echo "$HDDFree";
  577. echo '</td>';
  578. echo '<td><font face="Arial" color="White" size="1">';
  579. echo "$HDDTotal";
  580. echo '</td>';
  581. echo '</tr>';
  582. echo '</table>';
  583. }
  584. ?>
  585. </td>
  586. </tr>
  587. </table>
  588. <iframe name='gframe' width=0 height=0 style="display:none"></iframe>
  589. <table width="700" border="0" cellspacing="0" cellpadding="0">
  590. <tr height=4><td></td></tr>
  591. <tr>
  592. <td align="right" valign="top" style="border-top:solid 1px; border-top-color:#FFFFFF"><table width="900" border="0" cellspacing="0" cellpadding="0">
  593. <tr><td width=20></td>
  594. <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>
  595. | <a href="#" onclick="newwindow(318, 356, 'rc', 'rc_1');";>RC</a>
  596. | <a href="#" onclick="newwindow(250, 680, 'rc2', 'rc_2');";>RC2</a>
  597. <?if (file_exists("/tmp/usbmounts/sda1/scripts/xJukebox/index.php")){?>
  598. | <a href="jukebox">Jukebox</a>
  599. <?}?>
  600. | <a href="logout.php"><?echo $STR_Logout;?></a></font></td>
  601. <td align=right>
  602. <table><tr><!--td align=right><font face="Arial" color="#000000" size="1"><b><?echo date('M, d Y | h:i A');?></td--></tr>
  603. <tr><td align=right><font face="Arial" color="#000000" size="1"><b>Copyright 2009 Xtreamer.net, All right reserved.</td></tr>
  604. </table>
  605. </td>
  606. <td align=right><img src="dlf/footer.png" width="175" height="51" usemap="#planetmap">
  607. <map name="planetmap">
  608. <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');";/>
  609. </map>
  610. </td>
  611. </tr>
  612. </table>
  613. </td>
  614. </tr>
  615. </table>
  616. </center>
  617. </body>
  618. </HTML>