Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 30th, 2012  |  syntax: PHP  |  size: 3.01 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   <table class="table">
  2.         <thead>
  3.           <tr>
  4.            <th colspan="4" class="streamheader">Current live Sstreams</th>
  5.           </tr>
  6.         </thead>
  7.                
  8.                 <tbody>
  9.                
  10.                 <?php
  11.  
  12.         $xmlFileData2 = file_get_contents("http://api.own3d.tv/live?limit=15");
  13.  
  14.         $xmlData2 = new SimpleXMLElement($xmlFileData2);
  15.  
  16.         foreach($xmlData2->channel->item as $item)
  17.  
  18.         if ($item->misc['game'] == 'Dota 2' OR $item->misc['game'] == 'League of Legends' OR $item->misc['game'] == 'StarCraft II') {
  19.  
  20.         {
  21.  
  22.         $titlelimit = $item->title;
  23.  
  24.         $title = substr($titlelimit,0,20);
  25.  
  26.         echo "<tr><td>";
  27.  
  28.         if ($item->misc['game'] == 'League of Legends')
  29.         echo"<img src='http://localhost/ae/wp-content/themes/ae/img/lol.jpg' /></td><td>";
  30.         elseif ($item->misc['game'] == 'StarCraft II')
  31.         echo"<img src='http://localhost/ae/wp-content/themes/ae/img/sc2.jpg' /></td><td>";
  32.         elseif ($item->misc['game'] == 'Dota 2')
  33.         echo"<img src='http://localhost/ae/wp-content/themes/ae/img/dota2.jpg' /></td><td>";
  34.  
  35.         else
  36.         echo "none";
  37.  
  38.         echo "<a href='";
  39.         $link = $item->link;                     
  40.         $findthis ="/www.own3d.tv/live/";
  41.         $replacement ="ae/stream/";
  42.         echo str_replace ($findthis, $replacement, $link);
  43.         echo "'>";
  44.         echo $title;
  45.         echo "</a></td><td>";
  46.         $author = $item->author;                         
  47.         $find ="/rss@own3d.tv/";
  48.         $replace ="";
  49.         echo preg_replace ($find, $replace, $author);
  50.         echo "<td>";
  51.         echo $item->misc['viewers'];
  52.         echo "</td> </tr>";
  53.  
  54.         }
  55.         }
  56.         else
  57.         {
  58.         echo "";
  59.         }
  60.  
  61.         $xmlFileData1 = file_get_contents("http://api.justin.tv/api/stream/list.xml?category=gaming&limit=15");
  62.        
  63.         $xmlData1 = new SimpleXMLElement($xmlFileData1);
  64.  
  65.         foreach($xmlData1->stream as $itemtwitch) {
  66.        
  67.         $game = $itemtwitch->meta_game;
  68.        
  69.         $sc2 = "StarCraft II: Wings of Liberty";
  70.        
  71.         if ($itemtwitch->meta_game == 'Dota 2' OR $itemtwitch->meta_game == 'League of Legends' OR $itemtwitch->meta_game == 'StarCraft II: Wings of Liberty') {
  72.         {
  73.         echo "<tr><td>";
  74.        
  75.         $titlelimittwitch = $itemtwitch->title;
  76.  
  77.         $titlelimittwitch = substr($titlelimittwitch,0,20);
  78.  
  79.         if ($itemtwitch->meta_game == 'League of Legends')
  80.           echo"<img src='http://localhost/ae/wp-content/themes/ae/img/lol.jpg' /></td><td>";
  81.         elseif ($itemtwitch->meta_game == 'StarCraft II: Wings of Liberty')
  82.           echo"<img src='http://localhost/ae/wp-content/themes/ae/img/sc2.jpg' /></td><td>";
  83.         elseif ($itemtwitch->meta_game == 'Dota 2')
  84.           echo"<img src='http://localhost/ae/wp-content/themes/ae/img/dota2.jpg' /></td><td>";
  85.         else
  86.           echo "none";
  87.        
  88.         $data = $itemtwitch->name;
  89.         $find ="/live_user_/";
  90.         $replace ="";
  91.         echo "<a href='";
  92.         echo "http://localhost/ae/stream/";
  93.         echo preg_replace ($find, $replace, $data);
  94.         echo "''>";
  95.         echo "$titlelimittwitch";
  96.         //print(" - " . $itemtwitch->meta_game . "");
  97.         echo "</a></td><td>";
  98.         echo preg_replace ($find, $replace, $data);
  99.         print("</td><td>" . $itemtwitch->channel_count . "</td></tr>");
  100.         }
  101.         }
  102.         else {
  103.         echo "";
  104.         }
  105. }
  106. ?>
  107.  
  108.          <tr>
  109.        
  110.            <th colspan="4" class="streamheader centered">View all streams</th>
  111.           </tr>
  112. </tbody>
  113. </table>