PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/patches/Servicios/sbin/www/rc/screenshot.php

https://github.com/frisco82/HMR600.com-Firmware
PHP | 115 lines | 94 code | 12 blank | 9 comment | 11 complexity | f7e106e3005e64edee33d7110a934229 MD5 | raw file
  1. <?
  2. error_reporting(0);
  3. session_start();
  4. $_SESSION['redirect'] = $_SERVER['REQUEST_URI'];
  5. include "../chooselang.php";
  6. include '/tmp/lang.php';
  7. $file = "/usr/local/etc/setup.php";
  8. $fp = fopen($file, 'r');
  9. $fileData = fread($fp, filesize($file));
  10. fclose($fp);
  11. $line = explode("\n", $fileData);
  12. $i = 1;
  13. while ($i <= 5) {
  14. $dataPair = explode('=', $line[$i]);
  15. if ($dataPair[0] == "Login" && $dataPair[1] == "true") {
  16. if ($_SESSION['loggedIn'] != 1) {
  17. //header("Location:../login_form.php");
  18. echo "<script>document.location.href='../login_form.php'</script>";
  19. exit;
  20. }
  21. }
  22. $i++;
  23. }
  24. exec("echo -n ',*' >> /tmp/ir");
  25. //exec("echo -n '*' >> /tmp/ir");
  26. usleep(300000);
  27. $file1 = "/tmp/nowstatus";
  28. $fp1 = fopen($file1, 'r');
  29. $fileData1 = fread($fp1, filesize($file1));
  30. fclose($fp1);
  31. $line1 = explode("\n", $fileData1);
  32. $type = $line1[1];
  33. $playing = substr(strrchr($line1[2], '/'), 1);
  34. if (substr($line1[2], 0, 12) == "/tmp/myshare"){ //for NetShare
  35. $cur_dir = substr($line1[2], 12, strrpos($line1[2], '/')-12);
  36. $playing_file = '../media3'.rawurlencode($cur_dir).'/'.rawurlencode($playing);
  37. //$path = '../media3'.$cur_dir;
  38. }else{ //for HDD files
  39. $cur_dir = substr($line1[2], 18, strrpos($line1[2], '/')-18);
  40. $playing_file = '../media2'.rawurlencode($cur_dir).'/'.rawurlencode($playing);
  41. //$path = '../media2'.$cur_dir;
  42. }
  43. //echo "<script>alert('$cur_dir');</script>";
  44. //$file_without_ext = substr($playing, 0, strrpos($playing, '.'));
  45. //echo "<script>alert('$file_without_ext');</script>";
  46. //$shufl_seq = $line1[3];
  47. //$repeat = $line1[4];
  48. $time = $line1[5];
  49. ?>
  50. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  51. <html xmlns="http://www.w3.org/1999/xhtml" >
  52. <head>
  53. <title>Xtreamer</title>
  54. <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
  55. <meta name="apple-mobile-web-app-capable" content="yes" />
  56. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  57. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  58. <link href="statics/styles/general.css" rel="stylesheet" type="text/css" />
  59. <script src="statics/scripts/panel_funcs.js"></script>
  60. <script src="statics/scripts/global.js"></script>
  61. <!--script>
  62. function aaa(value){
  63. goTo(value);
  64. window.location.reload();
  65. }
  66. </script-->
  67. </head>
  68. <body>
  69. <img id="progressImg" src="statics/images/wifi_icon.png" />
  70. <map name="screenshotPage">
  71. <area shape="rect" coords="12,198,73,260" title="Settings" href="#" onclick="goTo('fSettings')">
  72. <area shape="rect" coords="243,198,313,260" title="<?echo $STR_Refresh;?>" href="#" onclick="goTo('fRefresh')">
  73. <area shape="rect" coords="1,265,75,308" title="<?echo $STR_Sub_panel;?>" href="#" onclick="goTo('fGotosub')">
  74. <area shape="rect" coords="243,265,313,308" title="Return" href="#" onclick="goTo('fReturn')">
  75. <area shape="poly" coords="101,220,77,274,101,334,130,306,118,277,129,247,101,220" title="Left" href="#" onclick="goTo('fLeftarrow')">
  76. <area shape="poly" coords="191,247,201,274,189,306,214,334,238,274,218,220,191,247" title="Right" href="#" onclick="goTo('fRightarrow')">
  77. <area shape="poly" coords="130,246,159,235,189,246,216,219,157,200,106,220,130,246" title="Up" href="#" onclick="goTo('fToparrow')">
  78. <area shape="poly" coords="130,306,103,333,159,354,216,334,188,306,159,318,130,306" title="Down" href="#" onclick="goTo('fBottomarrow')">
  79. <area shape="circle" coords="160,278,40" title="Enter" href="#" onclick="goTo('fEnter')">
  80. <area shape="circle" coords="20,336,20" title="Previous" href="#" onclick="goTo('fPrevious')">
  81. <area shape="circle" coords="63,336,20" title="Play/Pause" href="#" onclick="goTo('fPlay')">
  82. <area shape="circle" coords="258,336,20" title="Stop" href="#" onclick="goTo('fStop')">
  83. <area shape="circle" coords="298,336,20" title="Next" href="#" onclick="goTo('fNext')">
  84. </map>
  85. <img src="statics/images/screenshot.png" border="0" usemap="#screenshotPage"/>
  86. <?
  87. if($type == "Photo"){
  88. echo "<div id='screenshot'>";
  89. echo "<a href='$playing_file'><img src='$playing_file' width='320px' height='180px' title='$playing' border='0' /></a>";
  90. echo "</div>";
  91. }else{
  92. ?>
  93. <div id="screenshot">
  94. <a href='../screenshot.bmp'><img src='../screenshot.bmp' width='320px' height='180px' title='ScreenShot' border='0' /></a>
  95. </div>
  96. <?}?>
  97. <div id="screenshotinfo">
  98. <div id="npName"><marquee scrolldelay=200 onmouseover="this.stop();" onmouseout="this.start();" behavior="alternate"><a href="nowplaying.php"><?echo $playing;?></a></marquee></div>
  99. <!--div id="nptime1"><?echo $time;?></div-->
  100. </div>
  101. <iframe name='gframe' width=0 height=0 style="display:none"></iframe>
  102. </body>
  103. </html>