PageRenderTime 53ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/patches/Servicios/sbin/www/setup_Skin.php

https://github.com/frisco82/HMR600.com-Firmware
PHP | 318 lines | 268 code | 48 blank | 2 comment | 36 complexity | 87a47204ddb7c4b0778f981e99c25631 MD5 | raw file
  1. <?
  2. header('Content-Type: text/html; charset=utf-8');
  3. session_start();
  4. error_reporting(0);
  5. $_SESSION['redirect'] = $_SERVER['REQUEST_URI'];
  6. include "chooselang.php";
  7. include '/tmp/lang.php';
  8. $root = "/tmp/usbmounts"; // this will the the root position of this script
  9. //Set our root position and make sure the URL input is not manually manipulated
  10. if ((substr($_GET['dir'],0,2) != '/.') and (substr($_GET['dir'],0,1) != '.') and ($_GET['dir'] != '')) {
  11. $mydir = $root . $_GET['dir'];
  12. $mediapath = $_GET['dir']; }
  13. else {
  14. $mydir = $root;
  15. }
  16. $uplink = substr_replace($_GET['dir'],'',strlen($_GET['dir'])-strlen(strrchr( $_GET['dir'],'/')));
  17. $files = myscan($mydir);
  18. sort($files);
  19. function myscan($dir) {
  20. $arrfiles = array();
  21. $arrfiles = opendir(stripslashes($dir));
  22. while (false !== ($filename = readdir($arrfiles))) {
  23. $files[] = $filename;
  24. }
  25. return $files;
  26. }
  27. //to deetct internal HDD exists or not
  28. $HDDInfo = shell_exec("df -h|grep /dev/scsi/host0/bus0/target0/lun0/part1");
  29. sscanf($HDDInfo,"%s %s %s %s", $aaa,$HDDTotal, $HDDUsed, $HDDFree);
  30. ?>
  31. <html>
  32. <head>
  33. <title><?echo $STR_Setup;?></title>
  34. <link href="dlf/styles.css" rel="stylesheet" type="text/css">
  35. </head>
  36. <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" bgcolor="#012436" oncontextmenu="return false;">
  37. <script language=javascript>
  38. checked=false;
  39. function checkedAll(filelist) {
  40. var aa= document.getElementById('filelist');
  41. if (checked == false)
  42. {
  43. checked = true
  44. }else{
  45. checked = false
  46. }
  47. for (var i =0; i < aa.elements.length; i++){
  48. aa.elements[i].checked = checked;
  49. }
  50. }
  51. function putvalue(){
  52. for(i=0; i<document.filelist.length; i++){
  53. if(document.filelist[i].checked == true){
  54. document.filelist.new_name.value = document.filelist[i].value;
  55. document.filelist.old_name.value = document.filelist[i].value;
  56. break;
  57. }else{
  58. document.filelist.new_name.value = "";
  59. }
  60. }
  61. }
  62. function skin_change(){
  63. flg = 0;
  64. for(i=0;i<document.filelist.length;i++){
  65. if(document.filelist[i].checked == true){
  66. flg = 1;
  67. break;
  68. }else{
  69. flg = 0;
  70. }
  71. }
  72. if(flg == 0){
  73. alert("<?echo $STR_No_item_selected;?>");
  74. return false;
  75. }
  76. if(confirm("<?echo $STR_Skin_Change_Confirmation;?>")){
  77. loadDivEl = document.getElementById("loadDiv");
  78. loadDivEl.style.visibility = 'visible';
  79. document.filelist.target = 'gframe';
  80. document.filelist.action = 'skin_change.php?dir=<? echo $mediapath;?>';
  81. document.filelist.submit();
  82. }
  83. }
  84. function newwindow(w,h,webaddress,name){
  85. var viewimageWin = window.open(webaddress,name,"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width="+w+",height="+h);
  86. viewimageWin.moveTo(screen.availWidth/2-(w/2),screen.availHeight/2-(h/2));
  87. }
  88. function newwindow1(w,h,webaddress,name){
  89. 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);
  90. viewimageWin.moveTo(screen.availWidth/2-(w/2),screen.availHeight/2-(h/2));
  91. }
  92. </script>
  93. <center>
  94. <table cellspacing="0" cellpadding="0" border="0" height="500" width="996">
  95. <tr><td width=300>&nbsp</td>
  96. <td width=620>&nbsp</td>
  97. <td height="100" align="right" valign="bottom"><a href="index.php"><Img src="dlf/mvix_logo.png" width="300" height="72"></td>
  98. </tr>
  99. <tr><td width=350>&nbsp</td>
  100. <td width=620 valign="top">
  101. <table width=540 height="100" cellspacing="0" cellpadding="0" border="0">
  102. <tr><td height=40></td></tr>
  103. <tr><td>
  104. <table cellspacing="0" cellpadding="0" border="0"><tr>
  105. <td><font face="arial" color="white" size="2">
  106. <a href="register_form.php"><b><?echo $STR_Login_Head;?> </b></font>
  107. <font face="arial" color="white" size="2">|&nbsp</td>
  108. <td><font face="arial" color="white" size="2">
  109. <a href="setup_ddns.php"><b><?echo $STR_DDNS_Head;?> </b>
  110. <font face="arial" color="white" size="2">|&nbsp</td>
  111. <td><font face="arial" color="white" size="2">
  112. <a href="setup_http.php"><b><?echo $STR_HTTP_Head;?> </b>
  113. <font face="arial" color="white" size="2">|&nbsp</td>
  114. <td><font face="arial" color="white" size="2">
  115. <a href="setup_ftp.php"><b><?echo $STR_FTP_Head;?> </b>
  116. <font face="arial" color="white" size="2">|&nbsp</td>
  117. <td><font face="arial" color="white" size="2">
  118. <a href="setup_live_keyword.php"><b><?echo $STR_LiveKeyword_Head;?> </b>
  119. <font face="arial" color="white" size="2">|&nbsp</td>
  120. <td><font face="arial" color="white" size="2">
  121. <a href="setup_backup.php"><b><?echo $STR_Backup_Head;?> </b>
  122. <font face="arial" color="white" size="2">|&nbsp</td>
  123. </tr></table>
  124. </td></tr>
  125. <tr><td>
  126. <table cellspacing="0" cellpadding="0" border="0"><tr>
  127. <td width="110"></td>
  128. <td><font face="arial" color="white" size="2">
  129. <a href="setup_language.php"><b><?echo $STR_Language_Head;?> </b>
  130. <font face="arial" color="white" size="2">|&nbsp</td>
  131. <td><font face="arial" color="white" size="2">
  132. <a href="setup_upnp_boost.php"><b><?echo $STR_NAS_Mode;?></b>
  133. <font face="arial" color="white" size="2">|&nbsp</td>
  134. <!--td><font face="arial" color="white" size="2">
  135. <a href="setup_time.php"><b>Time Server</b>
  136. <font face="arial" color="white" size="2">|&nbsp</td-->
  137. <td><font face="arial" color="white" size="2">
  138. <a href="setup_nfs.php"><b><?echo $STR_NFS_Client;?></b>
  139. <font face="arial" color="white" size="2">|&nbsp</td>
  140. <td><font face="arial" color="white" size="2">
  141. <a href="setup_Host_workgroup.php"><b>Workgroup/Hostname</b>
  142. <font face="arial" color="white" size="2">|&nbsp</td>
  143. <td><a href="setup_Skin.php">
  144. <font face="arial" color="#ff0000" size="2"><b><u><?echo $STR_Skin_Head;?></u> </b></font></td>
  145. </tr></table>
  146. </td></tr>
  147. </table>
  148. <table cellspacing="0" cellpadding="0" border="0">
  149. <tr><td height=50 width=100></td>
  150. <td><font face="Arial" color="#748e94" size="2"><?echo $STR_Skin_Note;?></td></tr>
  151. <tr><td width=100></td>
  152. <td>
  153. <?
  154. echo "<div style='width: 500; height: 200; overflow: auto; border: 1px solid #ff0000; background: transparent;'>";
  155. if(!$_GET["dir"]==''){
  156. echo '<table width="480" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'"><tr><td>';
  157. echo "<table cellspacing='1' cellpadding='0'><tr><td><img src='dlf/dirup.png' align='center'>";
  158. echo "<td colspan='200'><font face='Arial' color='white' size='2'><a href='" . $_SERVER['PHP_SELF'] . "?dir=" . $uplink ."'>" . $STR_ParentDirectory . "</a></td></tr></table>";
  159. echo "</td></tr></table>";
  160. echo "<input type='checkbox' name='selectall' onclick='checkedAll(filelist);'><font face='Arial' color='white' size='2'>" . $STR_SelectAll;
  161. }
  162. echo "<form id='filelist' name='filelist' method='post' action='javascript:change();'>";
  163. for ($x=0; $x<sizeof($files); $x++) {
  164. 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")) {
  165. if(is_dir($mydir . "/" . $files[$x])) {
  166. $files1[$x] = $files[$x];
  167. if ($aaa!= ""){
  168. $files1[$x] = str_replace("sda", "HDD", $files1[$x]);
  169. $files1[$x] = str_replace("sdb1", "USB1", $files1[$x]);
  170. $files1[$x] = str_replace("sdc1", "USB2", $files1[$x]);
  171. $files1[$x] = str_replace("sdd1", "USB3", $files1[$x]);
  172. $files1[$x] = str_replace("sdb", "USB", $files1[$x]);
  173. $files1[$x] = str_replace("sdc", "USB", $files1[$x]);
  174. }else{
  175. $files1[$x] = str_replace("sda1", "USB1", $files1[$x]);
  176. $files1[$x] = str_replace("sdb1", "USB2", $files1[$x]);
  177. $files1[$x] = str_replace("sdc1", "USB3", $files1[$x]);
  178. $files1[$x] = str_replace("sdd1", "USB4", $files1[$x]);
  179. $files1[$x] = str_replace("sdb", "USB", $files1[$x]);
  180. $files1[$x] = str_replace("sdc", "USB", $files1[$x]);
  181. }
  182. echo '<table width="480" height="3" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'">';
  183. echo "<tr> <td>";
  184. echo "<table cellspacing='1' cellpadding='0'><tr>";
  185. echo "<td><img src='dlf/folder.png' align='center'>";
  186. echo "<td colspan='200'><font face='Arial' color='white' size='2'><a href=\"" . $_SERVER['PHP_SELF'] . "?dir=" . $mediapath . "/" . $files[$x] . "\">" . $files1[$x] . "</td>";
  187. echo "</tr></table>";
  188. echo "</td></tr></table>";
  189. }
  190. }
  191. }
  192. for ($x=0; $x<sizeof($files); $x++) {
  193. if (($files[$x] != '.') and ($files[$x] != "..")) {
  194. if(!is_dir($mydir . "/" . $files[$x])) {
  195. if (strtolower(strrchr($files[$x],'.')) == ".bmp"){
  196. echo '<table width="480" cellspacing="0" cellpadding="0" border="0" onMouseOver="this.style.backgroundImage= \'url(dlf/rollover_bar.png)\'" onMouseOut="this.style.backgroundImage=\'none\'">';
  197. echo "<tr> <td>";
  198. echo "<table cellspacing='1' cellpadding='0'><tr><td><input type='checkbox' name='filelist[]' value=\"$files[$x]\">";
  199. echo "<td colspan='200'><font face='Arial' color='white' size='2'>" . $files[$x] . "</font></td>";
  200. echo "</tr></table>";
  201. echo "</td></tr></table>";
  202. }
  203. }
  204. }
  205. }
  206. echo "</div>";
  207. ?>
  208. </td>
  209. </tr>
  210. <tr><tr height=3></tr>
  211. <td></td><td>
  212. <table border=0 width=500><tr><td>
  213. <font face="Arial" color="#748e94" size="2">
  214. <a href="#" onclick="newwindow(900, 700, 'http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Skins', 'skin');">
  215. <?echo $STR_View_All_Skin;?></a></td>
  216. <td rowspan=2 align=right><input type="button" class='btn_2' name="apply" value="<?echo $STR_Apply;?>" onClick="javascript:skin_change();">
  217. </td></tr>
  218. <tr><td><font face="Arial" color="#748e94" size="2">
  219. <a href="#" onclick="newwindow(900, 700, 'http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Skin_modding_guide', 'skinguid');">
  220. <?echo $STR_Skin_Wiki;?></a>
  221. </td></tr>
  222. </table>
  223. </td></tr>
  224. </table>
  225. </td>
  226. <td width="337" align="right" valign="middle"><img src="dlf/pvr_img.png" width="337" height="250"></td>
  227. </tr>
  228. </table>
  229. <iframe name='gframe' width=0 height=0 style="display:none"></iframe>
  230. <div id="loadDiv" name="loadDiv" style="position:absolute; visibility:hidden; left:340;top:190;width:200; height:100; z-index:1;">
  231. <table cellspacing="0" cellpadding="0" border="0" width=100% height=100%>
  232. <td valign=middle align=center>
  233. <table borde=0 align=center>
  234. <td align=center>
  235. <img src="dlf/upload.gif">
  236. </td>
  237. </table>
  238. </td>
  239. </table>
  240. </div>
  241. <table width="700" border="0" cellspacing="0" cellpadding="0">
  242. <tr height=4><td></td></tr>
  243. <tr>
  244. <td align="right" valign="top" style="border-top:solid 1px; border-top-color:#FFFFFF"><table width="900" border="0" cellspacing="0" cellpadding="0">
  245. <tr><td width=20></td>
  246. <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>
  247. | <a href="#" onclick="newwindow1(318, 356, 'rc', 'rc_1');";>RC</a>
  248. | <a href="#" onclick="newwindow1(250, 680, 'rc2', 'rc_2');";>RC2</a>
  249. <?if (file_exists("/tmp/usbmounts/sda1/scripts/xJukebox/index.php")){?>
  250. | <a href="jukebox">Jukebox</a>
  251. <?}?>
  252. | <a href="logout.php"><?echo $STR_Logout;?></a></font></td>
  253. <td align=right>
  254. <table><tr><!--td align=right><font face="Arial" color="#000000" size="1"><b><?echo date('M, d Y | h:i A');?></td--></tr>
  255. <tr><td align=right><font face="Arial" color="#000000" size="1"><b>Copyright 2009 Xtreamer.net, All right reserved.</td></tr>
  256. </table>
  257. </td>
  258. <td align=right><img src="dlf/footer.png" width="175" height="51" usemap="#planetmap">
  259. <map name="planetmap">
  260. <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');";/>
  261. </map>
  262. </td>
  263. </tr>
  264. </table>
  265. </td>
  266. </tr>
  267. </table>
  268. </center>
  269. </body>
  270. </html>