Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>CS:GO Baltics streams</title>
- <link rel="stylesheet" type="text/css" href="images/stream.css" />
- </head>
- <body>
- <div class="wrapper">
- <div class="viewer">
- <body background="/stream/images/Background.jpg">
- <?php
- $channel = $_GET["channel"];
- if($channel == null){
- //default channel
- $channel = "GGWPcsgo";
- }
- //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
- echo '
- <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>
- <iframe frameborder="0" scrolling="no" id="chat_embed" src="http://twitch.tv/chat/embed?channel='.$channel.'&popout_chat=true" height="350" width="300"></iframe>'; ?>
- </div>
- </br>
- <hr>
- <?php
- /**
- * @version 0.1
- * @copyright (C) 2012/2013 Cees Middel (Avon) www.maegis.net
- * @Inspired by Syi http://mushroom-mayhem.com
- * @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
- */
- /**
- * array with all stream names i.e. www.twitch.tv/"GGWPcsgo".
- * To add more users just add their channel names with comma seperation
- * This is all there is, no futher editing required
- */
- $chan = "";
- $members = array(
- "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");
- foreach($members as $i =>$value){
- $userGrab .= ",";
- $userGrab .= $value;
- }
- unset($value);
- //grabs the channel data from twitch.tv streams
- $json_file = file_get_contents($userGrab, 0, null, null);
- $json_array = json_decode($json_file, true);
- //get's member names from stream url's and checks for online members
- foreach ($members as &$i) {
- $chan = "http://api.justin.tv/api/stream/list.json?channel=" . $i;
- //$json = file_get_contents($chan);
- // uncached Curl method by LTB
- $c = curl_init($chan);
- $options = array(
- CURLOPT_RETURNTRANSFER => true
- );
- curl_setopt_array($c, $options);
- $json = curl_exec($c);
- curl_close($c);
- $exist = strpos($json, 'name');
- if($exist) {
- echo '<div class="stream_main">
- <div class="stream_thumb">
- <a href="index.php?channel='.$i.'"> <img src="images/online_thumb.gif" class="thumb_bg" width="188" height="113"/></a>
- </div>
- <div class="stream_title">
- <a href="index.php?channel='.$i.'"> <h2>'.$i.'</h2> </a>
- </div>
- <div class="stream_info">
-  <img src="images/online.png"> <strong> <font color="black">Status :</font></strong><font color="green"> Online! </font></br>
- </div>
- </div>';
- }else{
- echo '<div class="stream_main">
- <div class="stream_thumb">
- <img class="thumb_bg" src="images/online_thumb.gif" width="188" height="113"/>
- </div>
- <div class="stream_title">
- <a href="index.php?channel='.$i.'"> <h2>'.$i.'</h2> </a>
- </div>
- <div class="stream_info">
-  <img src="images/offline.png"> <strong> <font color="black">Status :</font></strong><font color="red"> Offline! </font></br>
- </div>
- </div>';
- }
- }
- unset($value);
- unset($i);
- ?>
- </div>
- <div class ="footer">
- <p> </p>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment