Guest User

stream

a guest
Aug 21st, 2014
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>CS:GO Baltics streams</title>
  4. <link rel="stylesheet" type="text/css" href="images/stream.css" />
  5. </head>
  6. <body>
  7. <div class="wrapper">
  8. <div class="viewer">
  9. <body background="/stream/images/Background.jpg">
  10. <?php
  11. $channel = $_GET["channel"];
  12. if($channel == null){
  13. //default channel
  14. $channel = "GGWPcsgo";
  15. }
  16. //places the flash video viewer $channel can be given as a url argument i.e. http://www.csgobaltics.com/index.php/stream-list/?channel=GGWPcsgo
  17. echo '
  18. <object type="application/x-shockwave-flash" height="350" width="543" id="live_embed_player_flash" data="http://nl.twitch.tv/widgets/live_embed_player.swf?channel='.$channel.'" bgcolor="#000000"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="movie" value="http://nl.twitch.tv/widgets/live_embed_player.swf" /><param name="flashvars" value="hostname=www.twitch.tv&channel='.$channel.'&auto_play=true&start_volume=25" /></object>
  19. <iframe frameborder="0" scrolling="no" id="chat_embed" src="http://twitch.tv/chat/embed?channel='.$channel.'&amp;popout_chat=true" height="350" width="300"></iframe>'; ?>
  20. </div>
  21. </br>
  22. <hr>
  23.  
  24. <?php
  25.  
  26. /**
  27. * @version 0.1
  28. * @copyright (C) 2012/2013 Cees Middel (Avon) www.maegis.net
  29. * @Inspired by Syi http://mushroom-mayhem.com
  30. * @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
  31. */
  32.  
  33. /**
  34. * array with all stream names i.e. www.twitch.tv/"GGWPcsgo".
  35. * To add more users just add their channel names with comma seperation
  36. * This is all there is, no futher editing required
  37. */
  38. $chan = "";
  39.  
  40. $members = array(
  41. "blooderis", "kviktv", "ynli", "NobodyLTU", "At this place might be your stream 1EUR/1mon - PayPal or Bank", "Cia gali buti Jusu stream 1EUR/1men - PayPal arba Bank", "At this place might be your stream 1EUR/1mon - PayPal or Bank", "Cia gali buti Jusu stream 1EUR/1men - PayPal arba Bank");
  42.  
  43.  
  44.  
  45. foreach($members as $i =>$value){
  46. $userGrab .= ",";
  47. $userGrab .= $value;
  48. }
  49. unset($value);
  50.  
  51. //grabs the channel data from twitch.tv streams
  52. $json_file = file_get_contents($userGrab, 0, null, null);
  53. $json_array = json_decode($json_file, true);
  54.  
  55. //get's member names from stream url's and checks for online members
  56. foreach ($members as &$i) {
  57. $chan = "http://api.justin.tv/api/stream/list.json?channel=" . $i;
  58. //$json = file_get_contents($chan);
  59.  
  60. // uncached Curl method by LTB
  61. $c = curl_init($chan);
  62. $options = array(
  63. CURLOPT_RETURNTRANSFER => true
  64. );
  65. curl_setopt_array($c, $options);
  66. $json = curl_exec($c);
  67. curl_close($c);
  68.  
  69. $exist = strpos($json, 'name');
  70. if($exist) {
  71. echo '<div class="stream_main">
  72. <div class="stream_thumb">
  73. <a href="index.php?channel='.$i.'"> <img src="images/online_thumb.gif" class="thumb_bg" width="188" height="113"/></a>
  74. </div>
  75. <div class="stream_title">
  76. <a href="index.php?channel='.$i.'"> <h2>'.$i.'</h2> </a>
  77. </div>
  78. <div class="stream_info">
  79. &nbsp<img src="images/online.png"> <strong> <font color="black">Status :</font></strong><font color="green"> Online! </font></br>
  80. </div>
  81. </div>';
  82.  
  83. }else{
  84. echo '<div class="stream_main">
  85. <div class="stream_thumb">
  86. <img class="thumb_bg" src="images/online_thumb.gif" width="188" height="113"/>
  87. </div>
  88. <div class="stream_title">
  89. <a href="index.php?channel='.$i.'"> <h2>'.$i.'</h2> </a>
  90. </div>
  91. <div class="stream_info">
  92. &nbsp<img src="images/offline.png"> <strong> <font color="black">Status :</font></strong><font color="red"> Offline! </font></br>
  93. </div>
  94. </div>';
  95. }
  96.  
  97. }
  98.  
  99.  
  100. unset($value);
  101. unset($i);
  102.  
  103. ?>
  104. </div>
  105. <div class ="footer">
  106. <p> </p>
  107. </div>
  108. </body>
  109. </html>
Add Comment
Please, Sign In to add comment