Файл: system/modules/radio/parser.php
Строк: 39
<?php
@session_start();
@ob_start();
@ob_implicit_flush(0);
@error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
define('MOZG', true);
define('ROOT_DIR', dirname (__FILE__));
define('ENGINE_DIR', ROOT_DIR.'/system');
header('Content-type: text/html; charset=windows-1251');
require ENGINE_DIR . "/modules/radio/data/config.php";
if( $radio_config['work'] == "off" ) die( "Модуль временно отключён!" );
// module
######################################################################
// get radio url
if ( isset( $_REQUEST['url'] ) AND preg_match( "/^[0-9a-zA-Z_-/:.]*$/i", trim($_REQUEST['url'] ))) $radio_url = $_REQUEST['url']; else $radio_url = '';
// get radio server
if ( isset( $_REQUEST['server'] )) $server = intval( $_REQUEST['server'] ); else $server = "";
if ( $radio_url OR $server ) die("Hacking attempt!");
// echo current song
switch( $server ){
case "1": $song = get_ShoutCast( $radio_url ); echo ( $song ? $song : "none" ); break;
default: echo "none";
};
// get shoutcast.com current song
function get_ShoutCast( $radio_url ){
$html = file_get_contents( $radio_url . "/7.html" );
$html = str_replace( "<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>", "", $html );
$html = str_replace( "</body></html>", "", $html );
$stream_info = explode( "," , $html );
if( isset( $stream_info[6] )) $song = htmlspecialchars( strip_tags( trim( $stream_info[6] ))); else $song = "";
return $song;
}
?>