Advertisement
Guest User

DJ anzeige

a guest
May 25th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.63 KB | None | 0 0
  1. <?php
  2. $pfadweg = "//deine-domain.de/uploads/";
  3.  
  4. $bildformat = "png";
  5. // Hier kannst du die Hoehe des Bildes einstellen.
  6. $hoehe = "150";
  7. // Hier kannst du die Breite des Bildes einstellen.
  8. $breite = "150";
  9.  
  10. ?>
  11.  
  12. <?php
  13.  
  14. ?>
  15. <!DOCTYPE html>
  16. <html>
  17. <head>
  18.  
  19. <title>OnAir</title>
  20. <meta content='text/html;charset=utf-8' http-equiv='content-type'>
  21. </head>
  22. <body>
  23. <?php
  24.  
  25. // Um welche Station handelt sich's:
  26. $sid = "8";
  27.  
  28. // Die Stations-Infos aus der API abfragen:
  29. $json_station = file_get_contents("https://stream.project-radio.eu/api/nowplaying/".$sid);
  30. // zu Debuggen einkommentieren:
  31. // var_dump($http_response_header);
  32. // var_dump($json_station);
  33.  
  34. // Die Anwort von JSON in einen assoziativen Object umwandeln:
  35. $obj_station = json_decode($json_station);
  36.  
  37. ?>
  38. <!DOCTYPE html>
  39. <html lang="en">
  40. <head>
  41. <meta charset="UTF-8">
  42. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  43. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  44. <link rel="stylesheet" href="style.css">
  45. <title>Streamanzeige</title>
  46. <script src="jquery.min.js"></script>
  47. <script>
  48. $(document).ready(function(){
  49. setInterval(function(){
  50. $("#cs").load('song.php')
  51. }, 30000);
  52. });
  53. </script>
  54.  
  55. </head>
  56. <body>
  57. <div class="container-fluid">
  58. <div class="row">
  59. <div class="col-sm-12 col-md-12 col-lg-12">
  60.  
  61. <div class="row">
  62. <div class="col-md-3 col-lg-2 col-sm-12 col-xs-12">
  63. <p>
  64. <?php if (empty($obj_station->live->streamer_name)){
  65. echo "Playlist";
  66. } else {
  67. echo $obj_station->live->streamer_name;
  68.  
  69. } ?>
  70.  
  71. echo('<img src='.$pfadweg.''.$string.'.'.$bildformat.' width="'.$breite.'" height="'.$hoehe.'">');
  72. </p>
  73.  
  74. </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement