bekomme folgende fehler meldung.
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /www/htdocs/philipps/include/query.php on line 4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | <?php class Shoutcast { public function getStreamInfo ( $src ) { if ( empty ( $src )) { self::Error( "S101" , "no streamserver entered!" ); } if ( substr ( $src , -1, 1) != "/" ) { $src .= "/" ; } return self::query( $src ); } private function query ( $url ) { $url_data = parse_url ( $url ); $host = $url_data [ "host" ]; $port = $url_data [ "port" ]; $page = $url_data [ "path" ]; $page = "/" ; if ( $fp = @ fsockopen ( $host , $port , $errno , $errstr , 4)) { fputs ( $fp , "GET $page HTTP/1.0\r\nHost: Webabfrage\r\nUser-Agent: Mozilla\r\n\r\n" ); while (! feof ( $fp )) { $buffer .= fgets ( $fp , 1024); if ( strlen ( $buffer ) >= 7000) { break ; } } fclose ( $fp ); if (preg_match( '/Server is currently down/is' , $buffer )) { $info [ "status" ] = 0; return $info ; } preg_match( '/<b>Stream is up at (.+?) kbps with <B>(.+?) of (.+?) listeners \((.+?) unique\)<\/b>/is' , $buffer , $matches ); $info [ "bitrate" ] = $matches [1]; $info [ "listener" ] = $matches [2]; $info [ "listener_max" ] = $matches [3]; $info [ "listener_unique" ] = $matches [4]; preg_match( '/Peak: <\/font><\/td><td><font class=default><b>(.+?)<\/b>/is' , $buffer , $matches ); $info [ "peak" ] = $matches [1]; preg_match( '/Current Song: <\/font><\/td><td><font class=default><b>(.+?)<\/b>/is' , $buffer , $matches ); $info [ "song" ] = $matches [1]; if (preg_match( '/<\/b>/is' , $info [ "song" ])) { $info [ "song" ] = "" ; } preg_match( '/Stream Title: <\/font><\/td><td><font class=default><b>(.+?)<\/b>/is' , $buffer , $matches ); $info [ "title" ] = $matches [1]; preg_match( '/Stream Genre: <\/font><\/td><td><font class=default><b>(.+?)<\/b>/is' , $buffer , $matches ); $info [ "genre" ] = $matches [1]; preg_match( '/Stream URL: <\/font><\/td><td><font class=default><b><a href="(.+?)">(.+?)<\/a><\/b>/is' , $buffer , $matches ); $info [ "url" ] = $matches [1]; if (preg_match( '/<\/b>/is' , $info [ "url" ])) { $info [ "url" ] = "" ; } preg_match( '/Stream IRC: <\/font><\/td><td><font class=default><b><a href="(.+?)">(.+?)<\/a><\/b>/is' , $buffer , $matches ); $info [ "irc" ] = $matches [2]; if (preg_match( '/<\/b>/is' , $info [ "irc" ])) { $info [ "irc" ] = "" ; } unset( $buffer , $matches ); $info [ "status" ] = 1; return $info ; } else { $info [ "status" ] = 0; return $info ; } } private function Error( $code , $msg = '' ) { echo "[error_code] = " . $code . "<br />\n" ; if (! empty ( $msg )) { echo "[error_message] = " . $msg . "<br />\n" ; } exit (); } } ?> |
verwendete ilchClan Version: 1.1
betroffene Homepage: vivaristik.philipps-tierparadies.de