Changeset 471 for trunk/Modules/TV/TV.php
- Timestamp:
- Dec 30, 2012, 10:09:08 PM (12 years ago)
- Location:
- trunk/Modules/TV
- Files:
-
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/TV/TV.php
r470 r471 1 1 <?php 2 2 3 include_once(' ../Common/Global.php');3 include_once('Common/Global.php'); 4 4 5 class IPTVPage extends Page 5 class PagePlayList extends Page 6 { 7 function Show() 8 { 9 $this->ClearPage = true; 10 11 Header("Content-Type: audio/mpegurl"); 12 Header("Content-Disposition: attachment; filename=playlist.m3u"); 13 14 echo('#EXTM3U'."\n"); 15 if(array_key_exists('id', $_GET)) 16 { 17 $DbResult = $this->Database->select('TV', '*', ' (`Stream` <> "") AND (`ShortName`="'.addslashes($_GET['id']).'") '); 18 if($DbResult->num_rows > 0) 19 { 20 $Channel = $DbResult->fetch_array(); 21 echo('#EXTINF:0,'.$Channel['Name']."\n"); 22 echo($Channel['Stream']."\n"); 23 } 24 } else 25 { 26 $DbResult = $this->Database->select('TV', '*', ' (`Stream` <> "") ORDER BY `Name` '); 27 while($Channel = $DbResult->fetch_array()) 28 { 29 echo('#EXTINF:0,'.$Channel['Name']."\n"); 30 echo($Channel['Stream']."\n"); 31 } 32 } 33 } 34 } 35 36 class PageIPTV extends Page 6 37 { 7 38 var $FullTitle = 'Síťová televize'; … … 13 44 14 45 $Output = 'Stažení přehrávače: <a href="http://www.videolan.org/vlc/">VLC Media Player</a><br/>'. 15 'Seznam všech kanálů do přehrávače: <a href="playlist. php">Playlist</a><br/>'.46 'Seznam všech kanálů do přehrávače: <a href="playlist.m3u">Playlist</a><br/>'. 16 47 'Zobrazení playlistu ve VLC lze provést pomocí menu <strong>View - Playlist</strong> nebo klávesové zkratky CTRL+L<br/>'. 17 48 '<br/>'. … … 43 74 while($Line = $DbResult->fetch_assoc()) 44 75 { 45 if($Line['Stream'] <> '') $Line['Show'] = '<a href="playlist. php?id='.$Line['ShortName'].'">Naladit</a>';76 if($Line['Stream'] <> '') $Line['Show'] = '<a href="playlist.m3u?id='.$Line['ShortName'].'">Naladit</a>'; 46 77 else 47 78 if($Line['StreamWeb'] <> '') $Line['Show'] = '<a href="'.$Line['StreamWeb'].'">Naladit</a>'; … … 67 98 } 68 99 69 $System->AddModule(new IPTVPage()); 70 $System->Modules['IPTVPage']->GetOutput(); 100 class TV extends AppModule 101 { 102 function __construct($System) 103 { 104 parent::__construct($System); 105 $this->Name = 'TV'; 106 $this->Version = '1.0'; 107 $this->Creator = 'Chronos'; 108 $this->License = 'GNU/GPLv3'; 109 $this->Description = 'Television channels management'; 110 $this->Dependencies = array(); 111 } 112 113 function Install() 114 { 115 } 116 117 function Uninstall() 118 { 119 } 120 121 function Start() 122 { 123 parent::Start(); 124 $this->System->RegisterPage('tv', 'PageIPTV'); 125 $this->System->RegisterPage('tv/playlist.m3u', 'PagePlayList'); 126 } 127 128 function Stop() 129 { 130 } 131 } 71 132 72 133 ?>
Note:
See TracChangeset
for help on using the changeset viewer.