Browse Source

some changes, don't know what - old stuff i think ...

Thomas Merkel 12 years ago
parent
commit
de3527b12b
1 changed files with 40 additions and 12 deletions
  1. 40 12
      index.php

+ 40 - 12
index.php

@@ -71,6 +71,29 @@ function channelname( $station, $channels ) {
 	return $channels[$station][1];
 }
 
+function epg( $channel ) {
+	if( $xml = @simplexml_load_file('epg.xml') ) {
+
+		$path ="/tv/programme[@channel='".$channel.".dvb.guide']";
+
+		foreach( $xml->xpath($path) as $res ) {
+			$datetime['start'] =  strtotime((string)$res->attributes()->start);
+			$datetime['stop']  =  strtotime((string)$res->attributes()->stop);
+
+			if( $datetime['start'] < time() && $datetime['stop'] > time() ) {
+				$return = array( 
+					'title'     => (string)$res->title,
+					'start'     => (string)$res->attributes()->start,
+					'stop'      => (string)$res->attributes()->stop,
+					'desc'      => (string)$res->desc
+					);
+				return $return;
+			}
+		}
+	}
+	return false;
+}
+
 function vlc_status( ) {
 	// proccess check
 	$pid = @file_get_contents('vlc.pid');
@@ -145,15 +168,15 @@ function cmd( $channel, $frequency, $voltage, $symbols ) {
 	$cmd_http = '/usr/bin/vlc -d --pidfile vlc.pid --ts-es-id-pid'
 	          . ' --program ' . $channel
 	          . ' --dvb-frequency=' . $frequency
-	          . ' --dvb-adapter=1'
+	          . ' --dvb-adapter=0'
 	          . '  dvb://'
 	          . ' -I telnet --telnet-host 127.0.0.1 --telnet-port 4212 --telnet-password asdfjedn3jdsw3jd'
 	          . ' --dvb-voltage=' . $voltage
 	          . ' --dvb-srate=' . $symbols
 	          . ' --sout \'#duplicate{dst="standard{access'
 	          . '=http,mux=ts,url=lafe.doc.fruky.net:8080/tv},select="program=' . $channel . '"}\' ';
-	//          . ' --sout \'#duplicate{dst="transcode{acodec=mp3, vcodec=mp4v,vb=2000,ab=128,vt=800000,keyint=80}:standard{access'
-	//          . '=http,mux=ts,url=:8080/tv}",select="program=' . $channel . '"}\' ';
+	//          . ' --sout \'#duplicate{dst="transcode{acodec=mpga, vcodec=mp4v,vb=1600,ab=128,vt=800000,keyint=80,deinterlace}:standard{access'
+	//          . '=http,mux=ts,url=lafe.doc.fruky.net:8080/tv}",select="program=' . $channel . '"}\' ';
 
 	return $cmd_http;
 }
@@ -206,20 +229,25 @@ else {
 		.'    <link rel="shortcut icon" type="image/png" href="frutv_ico.png" />'.NL
 	    .'  </head>'.NL
 	    .'  <body>'.NL;
-	echo '    <h1><img src="frutv.png" /> <span class="orange_h1">Fru</span>TV</h1>'.NL
-	    .'    <hr />'.NL
-	    .'    <h2>Channel List</h2>'.NL
-	    .'    '.$channelname.'<br /><br />'.NL
-	    .'    <a href="?playlist">&raquo; playlist</a><br /><br />'.NL;
+	echo '    <div class="head">FruTV</div>'.NL
+	    .'    <p>'.$channelname.'</p>'.NL
+	    .'    <p><a href="?playlist">&raquo; playlist</a></p>'.NL
+	    .'    <div class="content"><div>'.NL;
 
 	foreach($channels as $num => $c) {
 		if($num == 0) continue;
-		if(preg_match("/^#/", $c[0]))
-			echo '<strong>'.preg_replace("/^# /", "", $c[0]).'</strong><br />'.NL;
+		if(preg_match("/^#/", $c[0])) {
+			echo '</div><div class="headline">'.preg_replace("/^# /", "", $c[0]).'</div>'.NL
+			    .'  <div class="box">'.NL;
+		}
 		if($c[0] != 'TV' && $c[0] != 'RA') continue;
-			echo '    <span>' . $c[0] . '</span> <a href="?station=' . $num . '">' . $c[1] . '</a><br />'.NL;
+			$epg = epg( $c[8] ); $epg = $epg['title']; if( empty($epg) ) $epg = "-";
+			echo '    <div class="box_head"><a href="?station=' . $num . '">' . $c[1] . '</a></div>'.NL
+			    .'    <div class="box_content"><div class="box_text">'.$epg.'</div></div>'.NL;
 	}
-	echo '  </body>'.NL
+	echo '    </div></div>'.NL
+	    .'    <div class="footer">&copy; FruTV, Frubar Network</div>'.NL
+	    .'  </body>'.NL
 	    .'</html>';
 }