Advertisement
Kiporralixo

Untitled

May 27th, 2017
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.92 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. ini_set("display_errors",0);
  4. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  5. header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
  6. header("Cache-Control: post-check=0, pre-check=0", false);
  7. header("Pragma: no-cache"); // HTTP/1.0
  8. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  9. @$host = 'yoda.hosthb.com';
  10. @$port = '9982';
  11. @$ch = curl_init();
  12. @curl_setopt($ch, CURLOPT_URL, "http://".$host.":".$port."/index.html");
  13. @curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla");
  14. @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  15. @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
  16. $data = @curl_exec($ch);
  17. $locutor = @explode("<font class=default>Stream Title: </font></td><td><font class=default><b>", $data);
  18. $locutor = @explode("</b></td></tr>", $locutor[1]);
  19. $locutor = @strip_tags(addslashes(utf8_encode($locutor[0])));
  20. if($locutor == ''){
  21. $locutor = 'Offline';
  22. }
  23. $programa = @explode("<font class=default>Stream Genre: </font></td><td><font class=default>", $data);
  24. $programa = @explode("<b>", $programa[1]);
  25. $programa = @explode("</b></td></tr>", $programa[1]);
  26. $programa = @strip_tags(addslashes(utf8_encode($programa[0])));
  27. if($programa == ''){
  28. $programa = 'Auto';
  29. }
  30. $musica = @explode("<font class=default>Current Song: </font></td><td><font class=default><b>", $data);
  31. $musica = @explode("</b></td></tr>", $musica[1]);
  32. $musica = @strip_tags(addslashes(utf8_encode($musica[0])));
  33. if($musica == ''){
  34. $musica = 'HapDev';
  35. }
  36. $unicos = @explode("<b>Stream is up at ", $data);
  37. $unicos = @explode("(", $unicos[1]);
  38. $unicos = @explode(" unique)", $unicos[1]);
  39. $unicos = $unicos[0];
  40. if($unicos < 10){
  41. $unicos = "0".$unicos;
  42. }
  43. if($locutor == 'Offline'){
  44. $avatar = 'HapDev';
  45. }else{
  46. $avatar = trim($locutor);
  47. }
  48. if($locutor == 'Offline'){
  49. $quarto = 'Offline';
  50. $quarto_id = 'Null';
  51. }else{
  52. // Antônio deverá fazer o quarto pois precisa se conectar à sql.
  53. $quarto = 'HapDev';
  54. $quarto_id = '3';
  55. }
  56. @curl_close($ch);
  57.  
  58. if(isset($_GET['get']) && $_GET['get'] == 'data'){
  59. $data = array(
  60. 'avatar' => $avatar,
  61. 'locutor' => $locutor,
  62. 'musica' => $musica,
  63. 'unicos' => $unicos,
  64. 'quarto' => $quarto,
  65. 'quarto_id' => $quarto_id,
  66. );
  67. }
  68. // ATUALIZADOR
  69. if($_GET['ver'] == "locutor"){
  70. echo"$locutor";
  71. }
  72. if($_GET['ver'] == "unicos"){
  73. echo"$unicos Ouvintes ";
  74. }
  75. if($_GET['ver'] == "musica"){
  76. echo "$musica";
  77. }
  78. if($_GET['ver'] == "programa"){
  79. echo"$programa";
  80. }
  81. // ATUALIZADOR
  82. ?>
  83. <!doctype html>
  84. <html>
  85. <head>
  86. <meta charset="utf-8">
  87. <link href="player/css/reset.css" rel="stylesheet" type="text/css"/>
  88. <link href="player/css/style.css" rel="stylesheet" type="text/css"/>
  89. <link href="player/css/jquery-ui.css" rel="stylesheet" type="text/css"/>
  90. <link href="player/css/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
  91. <link href="player/css/jquery-ui.structure.css" rel="stylesheet" type="text/css"/>
  92. <link href="player/css/jquery-ui.structure.min.css" rel="stylesheet" type="text/css"/>
  93. <link href="player/css/jquery-ui.theme.css" rel="stylesheet" type="text/css"/>
  94. <link href="player/css/jquery-ui.theme.min.css" rel="stylesheet" type="text/css"/>
  95. <script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
  96. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
  97. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
  98. <!--<meta http-equiv="refresh" content="1;player.php">-->
  99. <title>Player HP</title>
  100. <script>
  101. $(document).ready(function(){
  102. $('#play-pause').click(function(){
  103. var classeAtual = $(this).attr('class');
  104.  
  105. if (classeAtual=='play'){
  106. PlayerPause();
  107. }
  108. else {
  109. PlayerPlay();
  110. }
  111.  
  112. $(this).toggleClass('play').toggleClass('pause');
  113. $(this).attr('title', classeAtual=='play'? 'Play':'Pause');
  114. });
  115. });
  116. </script>
  117. <script>
  118. function atualiza_dados(id, caminho)
  119. {
  120. $("#" + id).html("...");
  121. $("#" + id).fadeOut(1000);
  122. $("#" + id).load("_php/status.php?ver=" + caminho);
  123. $("#" + id).fadeIn(2000);
  124. }
  125. </script>
  126.  
  127. <script type="text/javascript">
  128. $(function(){
  129. $('.atualizarradio').submit(function(){
  130. $.ajax({
  131. url: 'dadosPlayer.php',
  132. type: 'POST',
  133. data: $('.atualizarradio').serialize(),
  134. success: function( data ){
  135. $('#container_radio').html(data);
  136. }
  137. });
  138. return false;
  139. });
  140. });
  141. </script>
  142. </head>
  143. <body class="pl" style="width:100%; overflow: hidden;">
  144. <div style="display: none">
  145. <script>
  146. function auto(){
  147. document.getElementById('player2').volume = 0;
  148. }
  149. </script>
  150. <body onload="auto()">
  151. <audio id="player2" controls autoplay src="http://stm30.srvstm.com:28112/;"></audio>
  152. <!-- minimizar radio -->
  153. <script>
  154. $(document).ready(function(){
  155. $("#stop").click(function(event){
  156. event.preventDefault();
  157. $("#area_player").css({"transition":"1s","margin-top":"-100px"});
  158. $(".att").css({"transition":"1s","margin-top":"-100px","display":"block"});
  159. $("#miniplayer").css({"transition":"1s","margin-top":"0px"});
  160. $("#container_radio").css({"transition":"1s","height":"30px", "width":"280px"});
  161. });
  162.  
  163. $("#maxmizar").click(function(event){
  164. event.preventDefault();
  165. $("#miniplayer").css({"transition":"1s","margin-top":"-50px"});
  166. $(".att").css({"transition":"1s","margin-top":"0px","display":"block"});
  167. $("#area_player").css({"transition":"1s","margin-top":"0px"});
  168. $("#container_radio").css({"transition":"1s","height":"90px", "width":"280px"});
  169. });
  170. });
  171. </script>
  172. <script>
  173. var stream = document.getElementById("player2");
  174.  
  175. function getVolume() {
  176. alert(stream.volume);
  177. }
  178.  
  179. function SetVolumeLower() {
  180. stream.volume -= 0.05;
  181. }
  182.  
  183. function SetVolumeHigher() {
  184. stream.volume += 0.05;
  185. }
  186. function UpdateAudio(){
  187. var update = document.getElementById('player2'); player2.src='http://stm30.srvstm.com:28112/;'; player2.load();
  188. }
  189. function PlayerPlay(){
  190. document.getElementById('player2').muted = false;
  191. event.preventDefault();
  192. }
  193. function PlayerPause(){
  194. document.getElementById('player2').muted = true;
  195. event.preventDefault();
  196. }
  197. </script>
  198. </div>
  199. <style>
  200. .atualizarradio{
  201. width: 280px;
  202. height:0px;
  203. position: relative;
  204. margin: auto;
  205. z-index: 99999;
  206. }
  207. .att{
  208. background:url(http://i.imgur.com/2st4p6j.png) no-repeat 0 0;
  209. width:22px;
  210. height:17px;
  211. display:block;
  212. overflow:hidden;
  213. outline:none;
  214. border: 0px;
  215. cursor: pointer;
  216. position: absolute;
  217. z-index: 999999;
  218. font-size: 0px;
  219. left: 251px;
  220. top:45px;
  221. }
  222. </style>
  223. <script>
  224. $( function() {
  225. function position() {
  226. $( ".positionable" ).position({
  227. of: $( "#arrastarplayer" )
  228. });
  229. }
  230. $( ".atualizarradio" ).draggable({ axis: "x" });
  231. position();
  232. } );
  233. </script>
  234. <form method="" action="" class="atualizarradio">
  235. <input type="submit" class="att" name="AtualizarRadio" title="Atualizar informações">
  236. <div id="container_radio">
  237. <div id="area_player">
  238. <div class="container_player">
  239. <table style="width:260px; position: relative; margin: auto; top: -5px; background: transparent;">
  240. <tr>
  241. <td>
  242. <table style="width: 70px; height:70px; background: transparent; border-right: 1px solid #000000">
  243. <tr>
  244. <td colspan="2">
  245. <a class="play" title="Stop" id="play-pause"></a>
  246. <!-- -->
  247. </td>
  248. </tr>
  249. <tr>
  250. <td>
  251. <a class="link" title="Diminuir volume" id="menos" title="Abaixar volume" onclick="SetVolumeLower()"></a>
  252. </td>
  253. <td>
  254. <a class="link" title="Almentar volume" onclick="SetVolumeHigher()" id="mais"></a>
  255. </td>
  256. </tr>
  257. </table>
  258. </td>
  259. <td style="display: block; background: transparent; height:85px; overflow: hidden;">
  260. <table>
  261. <tr>
  262. <td>
  263. <p class="p_radio"><img style="position: relative; top:2px;" title="Dj" src="http://i.imgur.com/wdDay4M.png"> <font title="Locutor" style="position: relative; left:4px; top:-2px; font-size: 18px; font-family: calibri;"><?php echo $locutor ?> - DJ</font></p>
  264. <p class="p_radio"><img style="position: relative; top:-3px; left:-2px;" title="Programação" src="http://i.imgur.com/jTCfwio.png"> <font title="Programação" style="position: relative; top:-6px; "><?php echo $programa; echo " - <font title='Ouvintes' style='color: orange;' >".$unicos."</font>" ?></font></p>
  265. <p class="p_radio"><img style="position: relative; top:-12px; left:-2px;" title="Musica" src="http://i.imgur.com/mECappD.png"> <font title="Musica" style="position: relative; top:-8px; "><MARQUEE style="position:relative;" HEIGHT=20 WIDTH=100 DIRECTION=LEFT SCROLLAMOUNT=5><font style="position:relative; top:6px;"><?php echo $musica ?></font></MARQUEE></font></p>
  266.  
  267. </td>
  268. </tr>
  269. </table>
  270. </td>
  271. <td>
  272. <table>
  273. <tr>
  274. <td colspan="2">
  275. <a id="stop" style="position:relative; left:33px;" title="Minimizar Player" data-element="#area_player"></a>
  276. </td>
  277. </tr>
  278. <tr>
  279. <td>
  280. <img style="position:relative; top:15px;" src="http://i.imgur.com/pmp66wJ.png" id="arrastarplayer">
  281. </td>
  282. <td>
  283. <img onclick="UpdateAudio()" style="cursor: pointer; position: relative; top: 15px; left:5px;" title="Atualizar dados" src="http://i.imgur.com/PnvfxVl.png" id="atualizar">
  284. </td>
  285. </tr>
  286. </table>
  287. </td>
  288. </tr>
  289. </table>
  290. </div>
  291. </div>
  292. <div id="container_miniplayer">
  293. <div id="miniplayer">
  294. <table style="width:220px; position: relative; margin: auto;">
  295. <tr>
  296. <td>
  297. <p class="p_radio" style="position: relative; top: -10px; padding-left: 10px; "><img style="position: relative; top:2px;" title="Dj" src="http://i.imgur.com/wdDay4M.png"> <font title="Locutor" style="position: relative; left:4px; top:-2px; font-size: 18px; font-family: calibri;"><MARQUEE class="dj" HEIGHT=30 WIDTH=130 DIRECTION=LEFT SCROLLAMOUNT=5><font style="position: relative; top:12px;"><?php echo $locutor." Musica: ".$musica ?> - DJ</font></MARQUEE></font></p>
  298. </td>
  299. <td>
  300. <img style="position: relative; top: -21px; left: 15px;" src="http://i.imgur.com/pmp66wJ.png" id="arrastarplayer">
  301. </td>
  302. <td>
  303. <a id="maxmizar" style="position: relative; margin-right: 25px; top:-23px;" data-element="#area_player"></a>
  304. </td>
  305. </tr>
  306. </table>
  307. </div>
  308. </div>
  309. </div>
  310. </form>
  311. </body>
  312. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement