Changeset 349
- Timestamp:
- Jan 18, 2012, 7:16:43 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.htaccess
r348 r349 5 5 6 6 RewriteEngine On 7 #RewriteBase /7 RewriteBase / 8 8 9 9 # Pretty urls on localhost with alias … … 11 11 RewriteCond %{REQUEST_FILENAME} !-f 12 12 RewriteCond %{REQUEST_FILENAME} !-d 13 RewriteRule ^(.*)$ index.php?page=$113 RewriteRule ^(.*)$ centrala/index.php?$1 14 14 15 15 # Pretty urls -
trunk/Modules/TV/TV.php
r348 r349 7 7 8 8 function Show() 9 { 10 if(count($this->System->PathItems) > 1) 11 { 12 if($this->System->PathItems[1] == 'playlist.m3u') return($this->ShowPlayList()); 13 else return(PAGE_NOT_FOUND); 14 } else return($this->ShowChannelList()); 15 } 16 17 function ShowChannelList() 9 18 { 10 19 global $Channels; 11 20 12 21 $Output = 'Stažení přehrávače: <a href="http://www.videolan.org/vlc/">VLC Media Player</a><br/>'. 13 22 'Seznam všech kanálů do přehrávače: <a href="playlist.m3u">Playlist</a><br/>'. … … 59 68 $Output .= 'Další online TV na webu: <a href="http://www.tvinfo.cz/live/televize/evropa/cz">TV info</a><br/>'; 60 69 61 return($Output); 70 return($Output); 62 71 } 63 }64 72 65 class TVPlaylistPage extends Page 66 { 67 var $FullTitle = 'Síťová televize'; 68 var $ShortTitle = 'IPTV'; 69 var $SimplePage = true; 70 71 function Show() 73 function ShowPlaylist() 72 74 { 75 $this->SimplePage = true; 76 $this->FormatHTML = false; 77 73 78 Header("Content-Type: audio/mpegurl"); 74 79 Header("Content-Disposition: attachment; filename=playlist.m3u"); … … 94 99 } 95 100 return($Output); 96 } 101 } 97 102 } 98 103 … … 133 138 { 134 139 $this->System->Pages['tv'] = 'TVChannelsPage'; 135 $this->System->Pages['tv/playlist.m3u'] = 'TVPlaylistPage';136 140 } 137 141 -
trunk/Modules/page.php
r348 r349 1 1 <?php 2 3 define('PAGE_NOT_FOUND', 'Stránka nenalezena'); 2 4 3 5 class Page extends OldModule -
trunk/index.php
r348 r349 304 304 } 305 305 306 if(array_key_exists('page', $_GET)) 306 function ProcessURL() 307 { 308 $QueryString = $_SERVER['QUERY_STRING']; 309 if(substr($QueryString, -1, 1) == '/') $QueryString = substr($QueryString, 0, -1); 310 //echo('"'.$QueryString.'"'); 311 $PathItems = explode('/', $QueryString); 312 if(strpos($_SERVER['REQUEST_URI'], '?') !== false) 313 $_SERVER['QUERY_STRING'] = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1); 314 else $_SERVER['QUERY_STRING'] = ''; 315 parse_str($_SERVER['QUERY_STRING'], $_GET); 316 return($PathItems); 317 } 318 319 $System->PathItems = ProcessURL(); 320 //print_r($_GET); 321 //print_r($System->PathItems); 322 323 if($System->PathItems[0] != '') 307 324 { 308 $Page = $ _GET['page'];309 if(substr($Page, -1) == '/') $Page = substr($Page, 0, -1);325 $Page = $System->PathItems[0]; 326 //if(substr($Page, -1) == '/') $Page = substr($Page, 0, -1); 310 327 //print_r($System->Pages); 311 328 if(array_key_exists($Page, $System->Pages)) … … 316 333 $PageObject->System = &$System; 317 334 $PageObject->GetOutput(); 318 } else echo( 'Stránka nenalezena');335 } else echo(PAGE_NOT_FOUND); 319 336 } else 320 337 {
Note:
See TracChangeset
for help on using the changeset viewer.