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

/patches/Servicios/sbin/www/otherlist.php

https://github.com/frisco82/HMR600.com-Firmware
PHP | 1106 lines | 788 code | 201 blank | 117 comment | 162 complexity | 4631d0f1a25a0d1cae7afcee330c65af 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. //echo "<script>alert('username $id');</script>";
  11. //echo "<script>alert('password $pass');</script>";
  12. $filetypes = array (
  13. 'zip' => 'archive.png',
  14. 'rar' => 'archive.png',
  15. 'tar' => 'archive.png',
  16. 'exe' => 'exe.gif',
  17. 'setup' => 'setup.gif',
  18. 'txt' => 'text.png',
  19. 'htm' => 'html.gif',
  20. 'html' => 'html.gif',
  21. 'fla' => 'fla.gif',
  22. 'bin' => 'binary.png',
  23. 'xls' => 'xls.gif',
  24. 'doc' => 'doc.gif',
  25. 'ppt' => 'ppt.gif',
  26. 'sig' => 'sig.gif',
  27. 'pdf' => 'pdf.gif',
  28. 'psd' => 'psd.gif',
  29. 'gz' => 'archive.png',
  30. 'asc' => 'sig.gif',
  31. );
  32. $Netshare_path = substr($_GET['dir'],0,12);
  33. if ($Netshare_path == "/tmp/myshare"){
  34. $mydir = $_GET['dir'];
  35. $mediapath = stripslashes($_GET['dir']);
  36. //echo "<script>alert('$mydir');</script>";
  37. if ($mydir != "/tmp/myshare"){
  38. $uplink = substr_replace($_GET['dir'],'',strlen($_GET['dir'])-strlen(strrchr( $_GET['dir'],'/')));
  39. //check whether already mounted?
  40. $mydir1 = $mydir;
  41. $mydir1 = str_replace("(", "\(", $mydir1);
  42. $mydir1 = str_replace(")", "\)", $mydir1);
  43. $mydir1 = str_replace(" ", "\ ", $mydir1);
  44. $cmd = "mount |grep ".$mydir1;
  45. exec($cmd, $output1, $result1);
  46. if((substr($mydir, -4) == ".smb") || (substr($mydir, -4) == ".nfs") and ($output1[0] == "")){
  47. $ShareName = '/tmp/myshare/.cmd'.strrchr( $mydir,'/');
  48. $ShareName = str_replace("(", "\(", $ShareName);
  49. $ShareName = str_replace(")", "\)", $ShareName);
  50. $ShareName = str_replace(" ", "\ ", $ShareName);
  51. //mount
  52. $cmd = $ShareName . ' ' . $id . ' ' . $pass;
  53. exec($cmd, $output, $result);
  54. if ($result != 0){
  55. //$share = strrchr( $mydir,'/');
  56. //$cmd = $ShareName . " " . $id . " " . $pass;
  57. //echo "<script>alert('Can not mount $share');</script>";
  58. echo "<script>window.open('smblogin.php?dir=$mydir', 'All', 'width=350,height=150');</script>";
  59. //exec($cmd, $output, $result);
  60. //echo "<script>alert('mydirectory.....$cmd');</script>";
  61. echo "<script>location.href='otherlist.php?dir=$uplink';</script>";
  62. }else if($id != ''){
  63. echo "<script>location.href='otherlist.php?dir=$mydir';</script>";
  64. }
  65. }
  66. $files = myscan($mydir);
  67. sort($files);
  68. //$mydir = str_replace("(", "\(", $mydir);
  69. //$mydir = str_replace(")", "\)", $mydir);
  70. $command = 'cd ' .$mydir1.';ls -alh > /tmp/aaa' ;
  71. shell_exec($command);
  72. $file1 = "/tmp/aaa";
  73. $fp1 = fopen($file1, 'r');
  74. //$fileData1 = fread($fp1, filesize($file1));
  75. $j=0;
  76. while (!feof($fp1)) {
  77. $line1[$j++] = fgets($fp1, 4096);
  78. }
  79. fclose($fp1);
  80. //echo "<script>alert('Net-$j');</script>";
  81. }else{
  82. $file = "/tmp/myshare/share.list";
  83. $fp = fopen($file, 'r');
  84. //$fileData = fread($fp, filesize($file));
  85. $j=0;
  86. while (!feof($fp)) {
  87. $files[$j++] = fgets($fp, 4096);
  88. }
  89. fclose($fp);
  90. }
  91. //echo "<script>alert('val of J ......$j');</script>";
  92. //$files = explode("\n", $fileData);
  93. //$files = explode("\n", $fileData);
  94. }else{
  95. $root = "/tmp/usbmounts";
  96. if ((substr($_GET['dir'],0,2) != '/.') and (substr($_GET['dir'],0,1) != '.') and ($_GET['dir'] != '')) {
  97. $mydir = $root . $_GET['dir'];
  98. $mediapath = stripslashes($_GET['dir']);
  99. }else{
  100. $mydir = $root;
  101. }
  102. //echo "<script>alert('$mydir');</script>";
  103. $uplink = substr_replace($_GET['dir'],'',strlen($_GET['dir'])-strlen(strrchr( $_GET['dir'],'/')));
  104. $files = myscan($mydir);
  105. sort($files);
  106. $mydir1 = $mydir;
  107. $mydir1 = str_replace("(", "\(", $mydir1);
  108. $mydir1 = str_replace(")", "\)", $mydir1);
  109. $command = 'cd ' .str_replace(" ", "\ ", $mydir1).';ls -alh > /tmp/aaa' ;
  110. shell_exec($command);
  111. $file1 = "/tmp/aaa";
  112. $fp1 = fopen($file1, 'r');
  113. //$fileData1 = fread($fp1, filesize($file1));
  114. $j=0;
  115. while (!feof($fp1)) {
  116. $line1[$j++] = fgets($fp1, 4096);
  117. }
  118. fclose($fp1);
  119. //echo "<script>alert('$j');</script>";
  120. }
  121. function myscan($dir) {
  122. $arrfiles = array();
  123. $arrfiles = opendir(stripslashes($dir));
  124. while (false !== ($filename = readdir($arrfiles))) {
  125. $files[] = $filename;
  126. }
  127. return $files;
  128. }
  129. $HDDInfo = shell_exec("df -h|grep /dev/scsi/host0/bus0/target0/lun0/part1");
  130. sscanf($HDDInfo,"%s %s %s %s", $aaa,$HDDTotal, $HDDUsed, $HDDFree);
  131. ?>
  132. <HTML>
  133. <head>
  134. <script language=javascript>
  135. function goto(form){
  136. var index=form.File_Manager.selectedIndex
  137. if (form.File_Manager.options[index].value != "") {
  138. if (form.File_Manager.options[index].value == "creatfolder.php?dir=<?echo $mediapath;?>") {
  139. window.open(form.File_Manager.options[index].value,'New_folder','height=200,width=550,left=150,top=200');
  140. }else if (form.File_Manager.options[index].value == "copy.php?dir=<?echo $mediapath;?>") {
  141. window.open(form.File_Manager.options[index].value,'copy','height=635,width=987,left=50,top=50');
  142. }else{
  143. window.open(form.File_Manager.options[index].value,'FileManager','height=630,width=550,left=220,top=50');
  144. }
  145. }
  146. }
  147. function newwindow(w,h,webaddress,name){
  148. 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);
  149. viewimageWin.moveTo(screen.availWidth/2-(w/2),screen.availHeight/2-(h/2));
  150. }
  151. function alertUser(){
  152. alert('<?echo $STR_Link_Copied_To_Clipboard;?>');
  153. }
  154. </script>
  155. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  156. <title><?echo $STR_Title;?></title>
  157. <link rel="stylesheet" type="text/css" href="dlf/styles.css" />
  158. </head>
  159. <body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 oncontextmenu="return false;">
  160. <div id="container">
  161. <center>
  162. <table width="996" cellspacing="0" cellpadding="0" border="0" valign="middle">
  163. <!--tr>
  164. <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>
  165. </tr-->
  166. <tr>
  167. <td align="center"><table height="94" background="dlf/top_menu.jpg" width="996" border="0" cellspacing="0" cellpadding="0">
  168. <tr>
  169. <td width="189"><img src="dlf/icon_other.jpg" width="189" height="94" /><td>
  170. <td valign="bottom">
  171. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  172. <tr>
  173. <td valign="middle" width="5">&nbsp;</td>
  174. <td colspan="9" valign="middle"><font face="arial" color="#ff0000"><h2><?echo $STR_All_title;?></h2></font></td>
  175. </tr>
  176. <tr>
  177. <td valign="bottom" width="5">&nbsp;</td>
  178. <!--td height="30" width="40" valign="bottom"><font face="arial" color="white" size="2">
  179. <a href="index.php"><?echo $STR_Home;?></a></td-->
  180. <td height="30" width="40" valign="bottom" align="middle"><font face="arial" color="white" size="2">
  181. <a href="videolist.php?dir=<?echo $mediapath;?>"><?echo $STR_Video;?></a></td>
  182. <td height="30" width="65" valign="bottom" align="middle"><font face="arial" color="white" size="2">
  183. <a href="audiolist.php?dir=<?echo $mediapath;?>"><?echo $STR_Audio;?></a></td>
  184. <td height="30" width="40" valign="bottom" align="middle"><font face="arial" color="white" size="2">
  185. <a href ="imagelist.php?dir=<?echo $mediapath;?>"><?echo $STR_Photo;?></a></td>
  186. <td height="30" width="65" valign="bottom" align="middle">
  187. <a href="otherlist.php?dir=<?echo $mediapath;?>">
  188. <font face="arial" color="#ff0000" size="2"><u><?echo $STR_All;?></u></font></a>&nbsp&nbsp|
  189. <td height="30" width="30" valign="bottom">
  190. <?
  191. //Mylist
  192. if (($Netshare_path != "/tmp/myshare")){
  193. 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,'m3uAll.php', 'All');\";>";
  194. }
  195. echo '</td><td height="30" width="40" valign="bottom">';
  196. //Upload
  197. //if (($mediapath != '') and (strncmp($mediapath, '/Media_Library', 14))){
  198. if ($mediapath != ''){
  199. 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');\";>";
  200. }
  201. echo '</td><td height="30" width="40" valign="bottom">';
  202. //Filemanager
  203. //if (($mediapath != '') and (strncmp($mediapath, '/Media_Library', 14))){
  204. if ($mediapath != ''){ ?>
  205. <FORM NAME="FileManager">
  206. <select name="File_Manager" class="listbox" ONCHANGE="goto(this.form)" >
  207. <option value=""><?echo $STR_Filemanager;?></option>
  208. <option value="creatfolder.php?dir=<?echo $mediapath;?>"><?echo $STR_NewFolder;?></option>
  209. <option value="rename.php?dir=<?echo $mediapath;?>"><?echo $STR_Rename;?></option>
  210. <option value="copy.php?dir=<?echo $mediapath;?>"><?echo $STR_CopyMove;?></option>
  211. <option value="delete.php?dir=<?echo $mediapath;?>"><?echo $STR_Delete;?></option>
  212. <option value="zip.php?dir=<?echo $mediapath;?>">Archive</option>
  213. </select>
  214. </FORM>
  215. <?
  216. }
  217. ?>
  218. </font></td>
  219. </tr>
  220. </table>
  221. </td>
  222. <td width="300" valign="bottom"><a href="index.php"><img src="dlf/mvix_logo.png" width="300" height="72"></td>
  223. </tr></table>
  224. </td>
  225. </tr>
  226. <tr height="12"><td></td></tr>
  227. <tr>
  228. <td height=100% align='center' valign='bottom'>
  229. <div id="listingcontainer">
  230. <table><tr height=12><td></td></tr></table>
  231. <div id="listing">
  232. <?
  233. echo "<div>";
  234. if(!$_GET["dir"]==''){
  235. 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>';
  236. echo "<table><tr><td><img src='dlf/dirup.png' align='center'>";
  237. echo "<td colspan='250'><a href='" . $_SERVER['PHP_SELF'] . "?dir=" . $uplink ."'>" . $STR_ParentDirectory . "</a></td></tr></table>";
  238. echo "</td></tr></table>";
  239. }
  240. /*
  241. $mydir = str_replace("(", "\(", $mydir);
  242. $mydir = str_replace(")", "\)", $mydir);
  243. $command = 'cd ' .str_replace(" ", "\ ", $mydir).';ls -alh > /tmp/aaa' ;
  244. shell_exec($command);
  245. $file1 = "/tmp/aaa";
  246. $fp1 = fopen($file1, 'r');
  247. //$fileData1 = fread($fp1, filesize($file1));
  248. $i=0;
  249. while (!feof($fp1)) {
  250. $line1[$i++] = fgets($fp1, 4096);
  251. }
  252. fclose($fp1);
  253. */
  254. //$line1 = preg_split("/\n/", $fileData1);
  255. if ($Netshare_path == "/tmp/myshare"){
  256. for ($x=0; $x<($j-1); $x++) {
  257. if ($mydir == "/tmp/myshare"){
  258. 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;">';
  259. echo '<tr><td width=400>';
  260. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  261. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files[$x] . "</td>";
  262. echo "</tr></table>";
  263. echo "</td></tr></table>";
  264. }else if(substr($line1[$x],0,1) == 'd'){
  265. 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")){
  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;">';
  267. echo '<tr><td width=400>';
  268. if (strlen($files[$x]) > 40) {
  269. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  270. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . substr($files[$x],0,40) . "...</td>";
  271. echo "</tr></table>";
  272. }else{
  273. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  274. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files[$x] . "</td>";
  275. echo "</tr></table>";
  276. }
  277. //if ($mediapath != ""){
  278. echo "</td><td width='20'>";
  279. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  280. 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>";
  281. echo "</tr></table>";
  282. echo "</td><td width='20'>";
  283. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  284. 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>";
  285. echo "</tr></table>";
  286. echo "</td><td width='20'>";
  287. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  288. 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>";
  289. echo "</tr></table>";
  290. //}
  291. echo "</td>";
  292. echo "<td width='370'></td>";
  293. echo "</tr></table>";
  294. }
  295. }
  296. }
  297. }else{
  298. for ($x=0; $x<($j-1); $x++) {
  299. 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")){
  300. //echo "<div>";
  301. //if(is_dir($mydir . "/" . $files[$x])) {
  302. //echo "<script>alert('AAA-$j');</script>";
  303. if (substr($line1[$x],0,1) == 'd'){
  304. $files1[$x] = $files[$x];
  305. if ($aaa!= ""){
  306. $files1[$x] = str_replace("sda", "HDD", $files1[$x]);
  307. $files1[$x] = str_replace("sdb1", "USB1", $files1[$x]);
  308. $files1[$x] = str_replace("sdc1", "USB2", $files1[$x]);
  309. $files1[$x] = str_replace("sdd1", "USB3", $files1[$x]);
  310. $files1[$x] = str_replace("sdb", "USB", $files1[$x]);
  311. $files1[$x] = str_replace("sdc", "USB", $files1[$x]);
  312. }else{
  313. $files1[$x] = str_replace("sda1", "USB1", $files1[$x]);
  314. $files1[$x] = str_replace("sdb1", "USB2", $files1[$x]);
  315. $files1[$x] = str_replace("sdc1", "USB3", $files1[$x]);
  316. $files1[$x] = str_replace("sdd1", "USB4", $files1[$x]);
  317. $files1[$x] = str_replace("sdb", "USB", $files1[$x]);
  318. $files1[$x] = str_replace("sdc", "USB", $files1[$x]);
  319. }
  320. 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;">';
  321. echo '<tr><td width=400>';
  322. if (strlen($files[$x]) > 40) {
  323. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  324. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . substr($files1[$x],0,40) . "...</td>";
  325. echo "</tr></table>";
  326. }else{
  327. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  328. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\" class='rollover'>" . $files1[$x] . "</td>";
  329. echo "</tr></table>";
  330. }
  331. if ($mediapath != ""){
  332. echo "</td><td width='20'>";
  333. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  334. 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>";
  335. echo "</tr></table>";
  336. echo "</td><td width='20'>";
  337. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  338. 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>";
  339. echo "</tr></table>";
  340. echo "</td><td width='20'>";
  341. echo "<table width='20' height='20' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  342. 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>";
  343. echo "</tr></table>";
  344. }
  345. echo "</td>";
  346. echo "<td width='360'></td>";
  347. echo "</tr></table>";
  348. $line1[$x] = NULL;
  349. }
  350. }
  351. }
  352. }
  353. //for NetShares
  354. if (($mediapath == "") and ($Netshare_path != "/tmp/myshare")){
  355. 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;">';
  356. echo '<tr><td width=400>';
  357. echo "<table><tr><td><img src='dlf/folder.png' align='center'>";
  358. echo "<td width=380><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=/tmp/myshare\" class='rollover'>Network Shares</td>";
  359. echo "</tr></table>";
  360. echo "</td>";
  361. echo "<td width='370'></td>";
  362. echo "</tr></table>";
  363. }
  364. //for NetShares
  365. for ($x=0; $x<($j-1); $x++) {
  366. //if (($files[$x] != '.') and ($files[$x] != "..")) {
  367. // echo "<div>";
  368. //if(!is_dir($mydir . "/" . $files[$x])) {
  369. if($line1[$x] == NULL)
  370. continue;
  371. if (substr($line1[$x],0,1) != 'd'){
  372. //for video files
  373. 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")){
  374. if ($Netshare_path == "/tmp/myshare"){
  375. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media3" . substr($mediapath,12) .'/'.$files[$x];
  376. }else{
  377. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  378. }
  379. //$file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  380. $file1 = urlencode(str_replace(' ', '%20', $file));
  381. $ext = strtolower(substr($files[$x], strrpos($files[$x], '.')+1));
  382. if($filetypes[$ext]) {
  383. $icon = $filetypes[$ext];
  384. } else {
  385. $icon = 'unknown.png';
  386. }
  387. 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;">';
  388. echo '<tr><td>';
  389. echo "<table width='390' cellspacing='0' cellpadding='0' border='0'> <tr>";
  390. if (strlen($files[$x]) > 40) {
  391. echo "<table><tr><td> <img src='dlf/video.png' align='center'>";
  392. echo "<td width='380'><a href='$file'><font color= 'white' face='Arial' size='2'>" . substr($files[$x],0,40) . "...</td>";
  393. echo "<td>";
  394. ?>
  395. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  396. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  397. <param name="movie" value="dlf/copyButton.swf">
  398. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  399. </embed>
  400. </object>
  401. <?
  402. echo "</td>";
  403. }else {
  404. echo "<table><tr><td> <img src='dlf/video.png' align='center'></td>";
  405. echo "<td width='380'><a href='$file'><font color= 'white' face='Arial' size='2'>" . $files[$x] . "</td>";
  406. echo "<td>";
  407. ?>
  408. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  409. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  410. <param name="movie" value="dlf/copyButton.swf">
  411. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  412. </embed>
  413. </object>
  414. <?
  415. echo "</td>";
  416. }
  417. echo "</tr></table>";
  418. echo "<td>";
  419. echo "<table width='20' height='16' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  420. 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>";
  421. echo "</tr></table>";
  422. echo "</td>";
  423. echo "<td>";
  424. echo "<table width='15' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  425. 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>";
  426. echo "</tr></table>";
  427. echo "</td>";
  428. echo "<td>";
  429. echo "<table width='15' height='2' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  430. echo "<td><a onClick=\"newwindow(700,545,'vlc.php?dir=$mediapath&file=$files[$x]', 'VLC');\"; href='#'>&nbsp&nbsp<img src='dlf/vlc.png' width='15' height='17' title='VLC Player'></td>";
  431. echo "</tr></table>";
  432. echo "</td>";
  433. echo "<td>";
  434. echo "<table width='35' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  435. 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"))
  436. {
  437. 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>";
  438. }
  439. echo "</tr></table>";
  440. echo "</td>";
  441. echo "</a>";
  442. echo "<td>";
  443. echo "<table width='90' height='2' cellspacing='0' cellpadding='0' border='0' > <tr><td>";
  444. ?>
  445. <font color= "white" face="Arial" size="2">
  446. <?
  447. //$i = 0;
  448. //while ($i < sizeof($line1)) {
  449. // if($line1[$i] == NULL) {
  450. // $i++;
  451. // continue;
  452. // }
  453. sscanf($line1[$x],"%s %s %s %s %s %s %s %s", $a,$b, $c, $d, $Size, $mnth, $day, $time);
  454. // $Name = substr(strstr($line1[$i],$time),strlen($time)+1);
  455. // if ($Name == $files[$x]) {
  456. echo "<a>".$Size."</a>";
  457. echo "</td></tr> </table>";
  458. echo "</td>";
  459. echo "<td>";
  460. echo "<table width='170' height='2' cellspacing='0' cellpadding='0' border='0'> <tr><td>";
  461. echo '<font color= "white" face="Arial" size="2">';
  462. echo "<a>".$mnth. ' ' .$day. ' ' .$time."</a>";
  463. //$line1[$i] = NULL;
  464. //break;
  465. // }
  466. // $i++;
  467. //}
  468. echo "</td></tr> </table>";
  469. echo "</td>";
  470. echo "<td>";
  471. echo '<table width="80" height="3" cellspacing="0" cellpadding="0" border="0">';
  472. echo '<tr><td>';
  473. echo "<table cellspacing='0' cellpadding='0' cellspacing='0' cellpadding='0' border='0'><tr><td width='20'>
  474. <a href=\"download.php?dir=$mediapath&file=$files[$x]\";><img src='dlf/download_icon.png' align='center'>$nsbp$nsbp";
  475. echo "<td><a href=\"download.php?dir=$mediapath&file=$files[$x]\"; class='g'>Download</td></tr></table>";
  476. echo "</td></tr></table>";
  477. echo "</font>";
  478. echo "</td>";
  479. echo "</tr>";
  480. echo "</table>";
  481. }
  482. //for Audio files
  483. else 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")||(strtolower(strrchr($files[$x],'.')) == ".m3u8") ||(strtolower(strrchr($files[$x],'.')) == ".pls"))
  484. {
  485. if ($Netshare_path == "/tmp/myshare"){
  486. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media3" . substr($mediapath,12) .'/'.$files[$x];
  487. }else{
  488. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  489. }
  490. //$file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  491. $file1 = urlencode(str_replace(' ', '%20', $file));
  492. $ext = strtolower(substr($files[$x], strrpos($files[$x], '.')+1));
  493. if($filetypes[$ext]) {
  494. $icon = $filetypes[$ext];
  495. } else {
  496. $icon = 'unknown.png';
  497. }
  498. 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;">';
  499. echo '<tr ><td>';
  500. echo "<table width='390' cellspacing='0' cellpadding='0' border='0'> <tr>";
  501. if (strlen($files[$x]) > 40) {
  502. echo "<table><tr><td><img src='dlf/audio.png' align='center'>";
  503. echo "<td width='380'><a href='$file'><font color= 'white' face='Arial' size='2'>" . substr($files[$x],0,40) . "...</td>";
  504. //echo "<td> <img src='dlf/audio.gif' align='center'>";
  505. //echo "<td colspan=\"100\"><a href='download.php?dir=$mediapath&file=$files[$x]'; class='rollover'>" . substr($files[$x],0,40) . "...</td>"; }
  506. echo "<td>";
  507. ?>
  508. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  509. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  510. <param name="movie" value="dlf/copyButton.swf">
  511. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  512. </embed>
  513. </object>
  514. <?
  515. echo "</td>";
  516. }else {
  517. echo "<table><tr><td><img src='dlf/audio.png' align='center'>";
  518. echo "<td width='380'><a href='$file'><font color= 'white' face='Arial' size='2'>" . $files[$x] . "</td>";
  519. //echo "<td><img src='dlf/audio.gif' align='center'>";
  520. //echo "<td colspan=\"130\"><a href='#'; class='rollover'>" . $files[$x] . "</td>";
  521. echo "<td>";
  522. ?>
  523. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  524. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  525. <param name="movie" value="dlf/copyButton.swf">
  526. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  527. </embed>
  528. </object>
  529. <?
  530. echo "</td>";
  531. }
  532. echo "</tr></table>";
  533. echo "<td>";
  534. echo "<table width='20' height='16' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  535. 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>";
  536. echo "</tr></table>";
  537. echo "</td>";
  538. echo "<td>";
  539. echo "<table width='15' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  540. 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>";
  541. echo "</tr></table>";
  542. echo "</td>";
  543. echo "<td>";
  544. echo "<table width='15' height='2' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  545. echo "<td><a onClick=\"newwindow(700,545,'vlc.php?dir=$mediapath&file=$files[$x]', 'VLC');\"; href='#'>&nbsp&nbsp<img src='dlf/vlc.png' width='15' height='17' title='VLC Player'></td>";
  546. echo "</tr></table>";
  547. echo "</td>";
  548. echo "<td>";
  549. echo "<table width='35' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  550. 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"))
  551. {
  552. 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>";
  553. }
  554. echo "</tr></table>";
  555. echo "</td>";
  556. echo "</a>";
  557. echo "<td>";
  558. echo "<table width='90' height='2' cellspacing='0' cellpadding='0' border='0' > <tr><td>";
  559. ?>
  560. <font color= "white" face="Arial" size="2">
  561. <?
  562. //$i = 2;
  563. //echo sizeof($line1);
  564. //while ($i < sizeof($line1)) {
  565. sscanf($line1[$x],"%s %s %s %s %s %s %s %s", $a,$b, $c, $d, $Size, $mnth, $day, $time);
  566. // $Name = substr(strstr($line1[$i],$time),strlen($time)+1);
  567. // if ($Name == $files[$x]) {
  568. echo $Size;
  569. echo "</td></tr> </table>";
  570. echo "</td>";
  571. echo "<td>";
  572. echo "<table width='170' height='2' cellspacing='0' cellpadding='0' border='0'> <tr><td>";
  573. echo '<font color= "white" face="Arial" size="2">';
  574. echo $mnth. ' ' .$day. ' ' .$time;
  575. //}
  576. //$i++;
  577. //}
  578. echo "</td></tr> </table>";
  579. echo "</td>";
  580. echo "<td>";
  581. echo '<table width="80" height="3" cellspacing="0" cellpadding="0" border="0">';
  582. echo '<tr><td>';
  583. echo "<table cellspacing='0' cellpadding='0' cellspacing='0' cellpadding='0' border='0'><tr><td width='20'>
  584. <a href=\"download.php?dir=$mediapath&file=$files[$x]\";><img src='dlf/download_icon.png' align='center'>$nsbp$nsbp";
  585. echo "<td><a href=\"download.php?dir=$mediapath&file=$files[$x]\"; class='g'>Download</td></tr></table>";
  586. echo "</td></tr></table>";
  587. echo "</font>";
  588. echo "</td>";
  589. echo "</tr>";
  590. echo "</table>";
  591. }
  592. //for Image files
  593. else if ((strtolower(strrchr($files[$x],'.')) == ".png")||(strtolower(strrchr($files[$x],'.')) == ".jpeg")|| (strtolower(strrchr($files[$x],'.')) == ".jpg")||(strtolower(strrchr($files[$x],'.')) == ".bmp")||(strtolower(strrchr($files[$x],'.')) == ".gif")||(strtolower(strrchr($files[$x],'.')) == ".tiff"))
  594. {
  595. if ($Netshare_path == "/tmp/myshare"){
  596. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media3" . substr($mediapath,12) .'/'.$files[$x];
  597. }else{
  598. $file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  599. }
  600. //$file = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  601. $file1 = urlencode(str_replace(' ', '%20', $file));
  602. $ext = strtolower(substr($files[$x], strrpos($files[$x], '.')+1));
  603. if($filetypes[$ext]) {
  604. $icon = $filetypes[$ext];
  605. } else {
  606. $icon = 'unknown.png';
  607. }
  608. 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;">';
  609. echo '<tr ><td>';
  610. echo "<table width='390' cellspacing='0' cellpadding='1' border='0'> <tr>";
  611. if (strlen($files[$x]) > 40) {
  612. echo "<table><tr><td> <img src='dlf/photo.png' align='center'>";
  613. echo "<td width='380'><a href='$file'>" . substr($files[$x],0,40) . "...</td>";
  614. echo "<td>";
  615. ?>
  616. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  617. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  618. <param name="movie" value="dlf/copyButton.swf">
  619. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  620. </embed>
  621. </object>
  622. <?
  623. echo "</td>";
  624. }else {
  625. echo "<table><tr><td> <img src='dlf/photo.png' align='center'>";
  626. echo "<td width='380'><a href='$file'>" . $files[$x] . "</td>";
  627. echo "<td>";
  628. ?>
  629. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  630. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  631. <param name="movie" value="dlf/copyButton.swf">
  632. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  633. </embed>
  634. </object>
  635. <?
  636. echo "</td>";
  637. }
  638. echo "</a>";
  639. echo "</tr></table>";
  640. echo "<td>";
  641. echo "<table width='20' height='16' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  642. echo "<td><a onClick=\"newwindow(318, 356, 'play.php?dir=Photo $mediapath&file=$files[$x]', 'play');\"; href='#'><img src='dlf/play.png' width='16' height='16' title='$STR_Play'></td>";
  643. echo "</tr></table>";
  644. echo "</td>";
  645. echo "<td>";
  646. echo "<table width='15' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  647. echo "<td></td>";
  648. echo "</tr></table>";
  649. echo "</td>";
  650. echo "<td>";
  651. echo "<table width='15' height='2' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  652. echo "<td></td>";
  653. echo "</tr></table>";
  654. echo "</td>";
  655. echo "<td>";
  656. echo "<table width='40' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  657. echo "<td></td>";
  658. echo "</tr></table>";
  659. echo "</td>";
  660. echo "<td>";
  661. echo "<table width='90' height='2' cellspacing='0' cellpadding='0' border='0' > <tr><td>";
  662. ?>
  663. <font color= "white" face="Arial" size="2">
  664. <?
  665. //$i = 2;
  666. //echo sizeof($line1);
  667. //while ($i < sizeof($line1)) {
  668. sscanf($line1[$x],"%s %s %s %s %s %s %s %s", $a,$b, $c, $d, $Size, $mnth, $day, $time);
  669. // $Name = substr(strstr($line1[$i],$time),strlen($time)+1);
  670. // if ($Name == $files[$x]) {
  671. echo $Size;
  672. echo "</td></tr> </table>";
  673. echo "</td>";
  674. echo "<td>";
  675. echo "<table width='170' height='2' cellspacing='0' cellpadding='0' border='0'> <tr><td>";
  676. echo '<font color= "white" face="Arial" size="2">';
  677. echo $mnth. ' ' .$day. ' ' .$time;
  678. //}
  679. //$i++;
  680. //}
  681. echo "</td></tr> </table>";
  682. echo "</td>";
  683. echo "<td>";
  684. echo '<table width="80" height="3" cellspacing="0" cellpadding="0" border="0">';
  685. echo '<tr><td>';
  686. echo "<table cellspacing='0' cellpadding='0' cellspacing='0' cellpadding='0' border='0'><tr><td width='20'>
  687. <a href=\"download.php?dir=$mediapath&file=$files[$x]\";><img src='dlf/download_icon.png' align='center'>$nsbp$nsbp";
  688. echo "<td><a href=\"download.php?dir=$mediapath&file=$files[$x]\"; class='g'>Download</td></tr></table>";
  689. echo "</td></tr></table>";
  690. echo "</font>";
  691. echo "</td>";
  692. echo "</tr>";
  693. echo "</table>";
  694. }
  695. //for other files
  696. else if(($files[$x] != "mylist.All") and ($files[$x] != "mylist.Music") and ($files[$x] != "mylist.Picture") and ($files[$x] != "mylist.Video") and ($files[$x] != "keyword.data")){
  697. if ($Netshare_path == "/tmp/myshare"){
  698. $otherfile = "http://".$_SERVER["SERVER_NAME"].'/'. "media3" . substr($mediapath,12) .'/'.$files[$x];
  699. }else{
  700. $otherfile = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  701. }
  702. //$otherfile = "http://".$_SERVER["SERVER_NAME"].'/'. "media" . $mediapath .'/'.$files[$x];
  703. $file1 = urlencode(str_replace(' ', '%20', $otherfile));
  704. $ext = strtolower(substr($files[$x], strrpos($files[$x], '.')+1));
  705. if($filetypes[$ext]) {
  706. $icon = $filetypes[$ext];
  707. } else {
  708. $icon = 'unknown.png';
  709. }
  710. 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;">';
  711. echo '<tr ><td>';
  712. echo "<table width='390' cellspacing='0' cellpadding='0' border='0'> <tr>";
  713. if (strlen($files[$x]) > 40) {
  714. echo "<table><tr><td> <img src='dlf/" . $icon . "' align='center'>";
  715. echo "<td width='380'><a href='$otherfile'>" . substr($files[$x],0,40) . "...</td>";
  716. echo "<td>";
  717. ?>
  718. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  719. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  720. <param name="movie" value="dlf/copyButton.swf">
  721. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  722. </embed>
  723. </object>
  724. <?
  725. echo "</td>";
  726. }else {
  727. echo "<table><tr><td> <img src='dlf/" . $icon . "' align='center'>";
  728. echo "<td width='380'><a href='$otherfile'>" . $files[$x] ."</td>";
  729. echo "<td>";
  730. ?>
  731. <object title="<?echo $STR_Copy_To_Clipboard;?>" width="18" height="18">
  732. <PARAM NAME=FlashVars VALUE=<?echo "txtToCopy=".$file1."&js=alertUser()";?>>
  733. <param name="movie" value="dlf/copyButton.swf">
  734. <embed src="dlf/copyButton.swf" flashvars=<?echo "txtToCopy=".$file1."&js=alertUser()";?> width="18" height="18" menu="false" wmode="transparent">
  735. </embed>
  736. </object>
  737. <?
  738. echo "</td>";
  739. }
  740. echo "</a>";
  741. echo "</tr></table>";
  742. //echo "<td>";
  743. //echo "<table width='15' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  744. //echo "<td></td>";
  745. //echo "</tr></table>";
  746. //echo "</td>";
  747. //for Unzip....
  748. echo "<td>";
  749. echo "<table width='20' height='17' cellspacing='0' cellpadding='0' border='0'> <tr>";
  750. if ((strtolower(strrchr($files[$x],'.')) == ".zip") || (strtolower(strrchr($files[$x],'.')) == ".tar") || (strtolower(strrchr($files[$x],'.')) == ".bz2"))
  751. {
  752. echo "<td align='center'><a onClick=\"newwindow(600,650,'unzip.php?zipdir=$mediapath&zipfile=$files[$x]&val=1', 'Unzip');\"; href='#'><img src='dlf/unzip_icon.png' width='16' height='17' title='$STR_Unzip'></td>";
  753. }
  754. echo "</tr></table>";
  755. echo "</td>";
  756. echo "<td>";
  757. echo "<table width='15' height='2' align='left' cellspacing='0' cellpadding='0' border='0'> <tr>";
  758. echo "<td></td>";
  759. echo "</tr></table>";
  760. echo "</td>";
  761. echo "<td>";
  762. echo "<table width='44' height='2' cellspacing='0' cellpadding='0' border='0'> <tr>";
  763. echo "<td></td>";
  764. echo "</tr></table>";
  765. echo "</td>";
  766. echo "<td>";
  767. echo "<table width='90' height='2' cellspacing='0' cellpadding='0' border='0' > <tr><td>";
  768. ?>
  769. <font color= "white" face="Arial" size="2">
  770. <?
  771. //$i = 0;
  772. //echo sizeof($line1);
  773. //while ($i < sizeof($line1)) {
  774. sscanf($line1[$x],"%s %s %s %s %s %s %s %s", $a,$b, $c, $d, $Size, $mnth, $day, $time);
  775. //$Name = substr(strstr($line1[$i],$time),strlen($time)+1);
  776. //if ($Name == $files[$x]) {
  777. echo $Size;
  778. echo "</td></tr> </table>";
  779. echo "</td>";
  780. echo "<td>";
  781. echo "<table width='170' height='2' cellspacing='0' cellpadding='0' border='0'> <tr><td>";
  782. echo '<font color= "white" face="Arial" size="2">';
  783. echo $mnth. ' ' .$day. ' ' .$time;
  784. //}
  785. //$i++;
  786. //}
  787. echo "</td></tr> </table>";
  788. echo "</td>";
  789. echo "<td>";
  790. echo '<table width="80" height="3" cellspacing="0" cellpadding="0" border="0">';
  791. echo '<tr><td>';
  792. echo "<table cellspacing='0' cellpadding='0' cellspacing='0' cellpadding='0' border='0'><tr><td width='20'>
  793. <a href=\"download.php?dir=$mediapath&file=$files[$x]\";><img src='dlf/download_icon.png' align='center'>$nsbp$nsbp";
  794. echo "<td><a href=\"download.php?dir=$mediapath&file=$files[$x]\"; class='g'>Download</td></tr></table>";
  795. echo "</td></tr></table>";
  796. echo "</font>";
  797. echo "</td>";
  798. echo "</tr>";
  799. echo "</table>";
  800. }
  801. }
  802. // echo "</div>";
  803. //}
  804. }
  805. ?>
  806. </td>
  807. </tr>
  808. </table>
  809. </div>
  810. </div>
  811. </div>
  812. <center>
  813. <table cellspacing='0' cellpadding='0' border='0' width=996 valign="center">
  814. <tr height="5"><td></td></tr>
  815. <tr><td width=70></td><td width=700>
  816. <?
  817. $mediapath1 = $mediapath;
  818. if ($aaa!= ""){
  819. $mediapath1 = str_replace("sda", "HDD", $mediapath1);
  820. $mediapath1 = str_replace("sdb1", "USB1", $mediapath1);
  821. $mediapath1 = str_replace("sdc1", "USB2", $mediapath1);
  822. $mediapath1 = str_replace("sdd1", "USB3", $mediapath1);
  823. $mediapath1 = str_replace("sdb", "USB", $mediapath1);
  824. $mediapath1 = str_replace("sdc", "USB", $mediapath1);
  825. $mediapath1 = str_replace("/tmp/myshare", "/NetShare", $mediapath1);
  826. }else{
  827. $mediapath1 = str_replace("sda1", "USB1", $mediapath1);
  828. $mediapath1 = str_replace("sdb1", "USB2", $mediapath1);
  829. $mediapath1 = str_replace("sdc1", "USB3", $mediapath1);
  830. $mediapath1 = str_replace("sdd1", "USB4", $mediapath1);
  831. $mediapath1 = str_replace("sdb", "USB", $mediapath1);
  832. $mediapath1 = str_replace("sdc", "USB", $mediapath1);
  833. $mediapath1 = str_replace("/tmp/myshare", "/NetShare", $mediapath1);
  834. }
  835. if (strlen($mediapath) > 90) {
  836. echo "<font face='Arial' color='white' size='2'>" . substr($mediapath1,0,90)."...</font>";
  837. }else{
  838. echo "<font face='Arial' color='white' size='2'>$mediapath1</font>";
  839. }
  840. ?>
  841. </td>
  842. <td>
  843. <? if (($mediapath != '') && ($aaa!= "") && (substr($mediapath, 0, 4) == "/sda")){
  844. echo '<table cellspacing="0" cellpadding="0" border="0"><tr>';
  845. echo '<td width=25><font face="Arial" color="white" size="1">HDD</font></td>';
  846. echo '<td width=50><font face="Arial" color="white" size="1">'. $STR_HDDUsed .'</font></td>';
  847. echo '<td width=50><font face="Arial" color="white" size="1">'. $STR_HDDFree .'</font></td>';
  848. echo '<td width=50><font face="Arial" color="white" size="1">'. $STR_HDDTotal .'</font></td>';
  849. echo '</tr>';
  850. echo '<tr>';
  851. echo '<td width=25></td>';
  852. echo '<td ><font face="Arial" color="white" size="1">';
  853. //$HDDInfo = shell_exec("df -h|grep /dev/ide/host0/bus0/target0/lun0/part1");
  854. //$HDDInfo = shell_exec("df -h|grep /dev/scsi/host1/bus0/target0/lun0/part1");
  855. //sscanf($HDDInfo,"%s %s %s %s", $aaa,$HDDTotal, $HDDUsed, $HDDFree);
  856. echo "$HDDUsed";
  857. echo '</td>';
  858. echo '<td><font face="Arial" color="white" size="1">';
  859. echo "$HDDFree";
  860. echo '</td>';
  861. echo '<td><font face="Arial" color="white" size="1">';
  862. echo "$HDDTotal";
  863. echo '</td>';
  864. echo '</tr>';
  865. echo '</table>';
  866. }
  867. ?>
  868. </td>
  869. </tr>
  870. </table>
  871. <table width="700" border="0" cellspacing="0" cellpadding="0">
  872. <tr height=4><td></td></tr>
  873. <tr>
  874. <td align="right" valign="top" style="border-top:solid 1px; border-top-color:#FFFFFF"><table width="900" border="0" cellspacing="0" cellpadding="0">
  875. <tr><td width=20></td>
  876. <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>
  877. | <a href="#" onclick="newwindow(318, 356, 'rc', 'rc_1');";>RC</a>
  878. | <a href="#" onclick="newwindow(250, 680, 'rc2', 'rc_2');";>RC2</a>
  879. <?if (file_exists("/tmp/usbmounts/sda1/scripts/xJukebox/index.php")){?>
  880. | <a href="jukebox">Jukebox</a>
  881. <?}?>
  882. | <a href="logout.php"><?echo $STR_Logout;?></a></font></td>
  883. <td align=right>
  884. <table><tr><!--td align=right><font face="Arial" color="#000000" size="1"><b><?echo date('M, d Y | h:i A');?></td--></tr>
  885. <tr><td align=right><font face="Arial" color="#000000" size="1"><b>Copyright 2009 Xtreamer.net, All right reserved.</td></tr>
  886. </table>
  887. </td>
  888. <td align=right><img src="dlf/footer.png" width="175" height="51" usemap="#planetmap">
  889. <map name="planetmap">
  890. <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');";/>
  891. </map>
  892. </td>
  893. </tr>
  894. </table>
  895. </td>
  896. </tr>
  897. </table>
  898. </center>
  899. </body>
  900. </HTML>