Warning: set_time_limit(): Cannot set time limit in safe mode in /home/www/dynamic/uv.ro/pubory.uv.ro/public_html/pub/index.php on line 526 includes/cast_functions.php0000755000000000000000000002676212147704566013341 0ustar $v) { if(@is_object($v) OR @is_array($v)) $array[$k] = obj_to_array($v); } return $array; } function file_get_contents_utf8($fn) { $opts = array( 'http' => array( 'method'=>"GET", 'header'=>"Content-Type: text/html; charset=utf-8", 'timeout' => 60 ) ); $context = stream_context_create($opts); $result = file_get_contents($fn, false, $context); return $result; } function title_sitename($domain) { $domaintmp = explode(".", $domain); $y = count($domaintmp) - 1; $r = ""; for ($a = 0; $y > $a; $a++) { $r .= $domaintmp[$a]."."; } $r = str_replace("http://", "", $r); return $r; } function title_sitesufix($domain) { $domaintmp = explode(".", $domain); $y = count($domaintmp) - 1; $r = $domaintmp[$y]; $r = str_replace("/", "", $r); return $r; } //get website url of the current song title if such... function song_siteInfo($artist, $song, $default_value, $getInfo = 'url_picture') { static $a_www, $s_www; $a_www = explode("www.", $artist); //$a_www = !empty($a_www[1]) ? explode("http://", $song) : $a_www; $a_www = empty($a_www[1]) ? explode(".org", $artist) : $a_www; $a_www = empty($a_www[1]) ? explode(".com", $artist) : $a_www; $s_www = explode("www.", $song); //$s_www = !empty($s_www[1]) ? explode("http://", $song) : $s_www; $s_www = empty($s_www[1]) ? explode(".org", $song) : $s_www; $s_www = empty($s_www[1]) ? explode(".com", $song) : $s_www; if (!empty($a_www[1])) { $url_info = "http://".title_sitename($artist).title_sitesufix($artist)."/"; $url_picture = $url_info."favicon.ico"; //$url_picture = $default_value; } elseif (!empty($s_www[1])) { $url_info = "http://".title_sitename($song).title_sitesufix($song)."/"; $url_picture = $url_info."favicon.ico"; //$url_picture = $default_value; } else { $url_info = $default_value; $url_picture = $default_value; } return $$getInfo; } //get information of the current song title use amazone's API function aws_signed_request($params, $title, $curl) { static $response, $request; $method = "GET"; $host = "ecs.amazonaws.com"; $uri = "/onca/xml"; $params["Service"] = "AWSECommerceService"; $params["AWSAccessKeyId"] = "0ZYCZQTQW9GRW4AY2602"; $params["Timestamp"] = gmdate("Y-m-d\TH:i:s\Z"); $params["Version"] = "2013-05-16"; ksort($params); $canonicalized_query = array(); foreach ($params as $param=>$value) { $param = str_replace("%7E", "~", rawurlencode($param)); $value = str_replace("%7E", "~", rawurlencode($value)); $canonicalized_query[] = $param."=".$value; } $canonicalized_query = implode("&", $canonicalized_query); $string_to_sign = $method."\n".$host."\n".$uri."\n".$canonicalized_query; $signature = base64_encode(hash_hmac("sha256", $string_to_sign, "LFpXAmTy+mZjDWISXr7bGkTVMapgrgUorRKEUOin", True)); $signature = str_replace("%7E", "~", rawurlencode($signature)); $request = "http://".$host.$uri."?".$canonicalized_query."&Signature=".$signature; if($curl == "yes") { $response = curl_file_get_contents($request); } $response = @file_get_contents($request); /* if(!$response) { $fp = @fsockopen($host, 80, $errno, $errstr, 5); @fputs($fp,"GET /".$uri."?".$canonicalized_query."&Signature=".$signature." HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); while(!feof($fp)) { $response .= fgets($fp, 1000); } $response = substr($response, 7); $response = substr($response, 0, strlen($response) - 6); } */ if ($response === false) { return false; } else { $parsed_xml = @simplexml_load_string($response); if ($parsed_xml === false) { return false; } else { //print_r($parsed_xml); return $parsed_xml; } } } // Get image thingy by drknas... function aws_search_album($params, $title, $curl) { static $response, $request; $method = "GET"; $host = "ecs.amazonaws.com"; $uri = "/onca/xml"; $params["Service"] = "AWSECommerceService"; $params["AWSAccessKeyId"] = "0ZYCZQTQW9GRW4AY2602"; $params["Timestamp"] = gmdate("Y-m-d\TH:i:s\Z"); $params["Version"] = "2013-05-16"; ksort($params); $canonicalized_query = array(); foreach ($params as $param=>$value) { $param = str_replace("%7E", "~", rawurlencode($param)); $value = str_replace("%7E", "~", rawurlencode($value)); $canonicalized_query[] = $param."=".$value; } $canonicalized_query = implode("&", $canonicalized_query); $string_to_sign = $method."\n".$host."\n".$uri."\n".$canonicalized_query; $signature = base64_encode(hash_hmac("sha256", $string_to_sign, "LFpXAmTy+mZjDWISXr7bGkTVMapgrgUorRKEUOin", true)); $signature = str_replace("%7E", "~", rawurlencode($signature)); $request = "http://".$host.$uri."?".$canonicalized_query."&Signature=".$signature; if($curl == "yes") { $response = curl_file_get_contents($request); } if ($response === false) { $response = @file_get_contents($request); } if ($response === false) { $canonicalized_query = "Service=AWSECommerceService&AWSAccessKeyId=0ZYCZQTQW9GRW4AY2602&AssociateTag=knas-20&Operation=ItemSearch&ResponseGroup=Medium,Offers&SearchIndex=Music&Keywords=".$title."&ItemPage="; $fp = @fsockopen($host, 80, $errno, $errstr, 5); if($fp) { @fputs($fp,"GET /".$uri."?".$canonicalized_query." HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); while(!feof($fp)) { $response .= fgets($fp, 1000); } $response = substr($response, 7); $response = substr($response, 0, strlen($response) - 6); } } if ($response === false) { return false; } else { $parsed_xml = @simplexml_load_string($response); if ($parsed_xml === false) { return false; } else { //print_r($parsed_xml); return $parsed_xml; } } } function aws_get_wanted_data($parsed_xml) { $numOfItems = $parsed_xml->Items->TotalResults; $wanted_data = array(); if($numOfItems > 0) { $first = $parsed_xml->Items->Item[0]; $wanted_data[0] = $first->SmallImage->URL; $wanted_data[1] = $first->DetailPageURL; return $wanted_data; } if($numOfItems < 1) { return false; } } //get information of the current song use amazone's API by Ory (but yet put here only for refrence) function aws_searchInfo($artist, $song, $title, $getInfo = 'url_picture', $url_picture = 'nochange', $search = 'DigitalMusic') { static $url_info, $album_url; global $curl; $parsed_xml = $url_picture; $parsed_xml = aws_signed_request(array("AssociateTag"=>"knas-20","Operation"=>"ItemSearch","SearchIndex"=>$search,"ResponseGroup"=>"Medium,Offers","Keywords"=>clean_string_alpha_num($title)), $title, $curl); $data = @is_object($parsed_xml) ? aws_get_wanted_data($parsed_xml) : ""; if(is_array($data)) { $url_picture = $data[0]; $url_info = $data[1]; } else { return $default; } return $$getInfo; } //get information of the current song use last.fm's API function aws_getInfo($artist, $song, $method = 'track', $getInfo = 'url_picture', $default = 'nochange') { static $image_s, $album_url, $request; global $curl, $skininfo; $host = "http://ws.audioscrobbler.com"; $uri = "/2.0/"; $api_keyId = "470df9d6f46d4c28d221483ffdcf6062"; $request = str_replace('#','', $host.$uri.'?method=track.getInfo&api_key='.$api_keyId.'&artist='.urlencode($artist).'&track='.urlencode($song)); $xml = @simplexml_load_file($request, 'SimpleXMLElement', LIBXML_NOCDATA); //print_r($xml); if (!is_object($xml)) { return $default; } $xml = obj_to_array($xml); if (!is_array($xml)) { return $default; } if(!empty($xml[$method]['album']['image'])) { //Picture size taken from skin configuration; Valid values are: 0 for small; 1 for medium; 2 for large; and 3 for eXtrem large; $skininfo['image'] = !empty($skininfo['image']) ? $skininfo['image'] : 0; $skinimage = $xml[$method]['album']['image'][$skininfo['image']]; } if(!empty($xml[$method]['wiki']['summary'])) { $wikisummary = $xml[$method]['wiki']['summary']; $wikicontent = $xml[$method]['wiki']['content']; } if(!empty($xml[$method]['album']['title'])) { $album_title = $xml[$method]['album']['title']; $album_url = $xml[$method]['album']['url']; } $lastfm_url = $xml[$method]['url']; if(!empty($xml[$method]['artist']['url'])) { $artist_url = $xml[$method]['artist']['url']; } $url_picture = !empty($skinimage) ? $skinimage : $default; $url_info = !empty($album_url) ? $album_url : $default; return $$getInfo; } ?>includes/cd_cover_getter.php0000755000000000000000000000716012147704566013444 0ustar $value) { $param = str_replace("%7E", "~", rawurlencode($param)); $value = str_replace("%7E", "~", rawurlencode($value)); $canonicalized_query[] = $param."=".$value; } $canonicalized_query = implode("&", $canonicalized_query); $string_to_sign = $method."\n".$host."\n".$uri."\n".$canonicalized_query; $signature = base64_encode(hash_hmac("sha256", $string_to_sign, "LFpXAmTy+mZjDWISXr7bGkTVMapgrgUorRKEUOin", true)); $signature = str_replace("%7E", "~", rawurlencode($signature)); $request = "http://".$host.$uri."?".$canonicalized_query."&Signature=".$signature; if($curl == "yes") { $response = curl_file_get_contents($request); } if ($response === false) { $response = @file_get_contents($request); } if ($response === false) { $canonicalized_query = "Service=AWSECommerceService&AWSAccessKeyId=0ZYCZQTQW9GRW4AY2602&AssociateTag=knas-20&Operation=ItemSearch&ResponseGroup=Medium,Offers&SearchIndex=Music&Keywords=".$title."&ItemPage="; $fp = @fsockopen($host, 80, $errno, $errstr, 5); if($fp) { @fputs($fp,"GET /".$uri."?".$canonicalized_query." HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); while(!feof($fp)) { $response .= fgets($fp, 1000); } $response = substr($response, 7); $response = substr($response, 0, strlen($response) - 6); } } if ($response === false) { return false; } else { $parsed_xml = @simplexml_load_string($response); if ($parsed_xml === false) { return false; } else { return $parsed_xml; } } } function get_wanted_data($parsed_xml) { $numOfItems = $parsed_xml->Items->TotalResults; if($numOfItems > 0) { $first = $parsed_xml->Items->Item[0]; $wanted_data[] = $first->SmallImage->URL; $wanted_data[] = $first->DetailPageURL; return $wanted_data; } if($numOfItems < 1) { return false; } } ?>includes/common.php0000755000000000000000000002243512147704566011600 0ustar 80) ? ':' . trim($server_port) : ''; } // // Get the current document root. // like /wamp/www/ if( isset($_SERVER['DOCUMENT_ROOT']) ) { $document_root = $_SERVER['DOCUMENT_ROOT']; } elseif( isset($DOCUMENT_ROOT) ) { $document_root = $DOCUMENT_ROOT; } else { $document_root = './'; } //Remove drive leter in windows $document_root = substr(strrchr($document_root, ':'), 1); $document_root = str_replace('\\', '/', $document_root); // Get the lasr path to this installation. like /wamp/www/ $document_bang = explode('/', $document_root); $bangs = sizeof($document_bang) - 2; $document_bang = $document_bang[$bangs]; // Get the absolute path to this installation. like /wamp/www/pub/radioplayer/v4/ $mx_absolute_path = str_replace('\\', '/', substr(__FILE__, 0, -strlen('includes/'.basename(__FILE__)))); $script_path = substr(strrchr($mx_absolute_path, $document_bang), 1); $server_protocol = ($cookie_secure != false) ? 'https://' : 'http://'; $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($server_name)); $script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($script_path)); $script_name = ($script_name == '') ? $script_name : '/' . $script_name; define('ADDON_URL', $server_protocol . $server_name . (($server_port != 80) ? ":".$server_port : "") . $script_name . '/' ); $is_block = false; } else { define('ADDON_URL', PORTAL_URL . $module_root_path); } if(isset($_GET["language"])) { $language = $_GET["language"]; } elseif(isset($_GET["lang"])) { $language = $_GET["lang"]; } else { if(empty($language)) { $language = "english"; } } $clean_language = preg_replace("/[^a-zA-Z0-9_.-@]/", "", $language); if ((@include $module_root_path . "language/lang_" . $clean_language . "/lang_main.$phpEx") === false) { if ((@include $module_root_path . "language/lang_english/lang_main.$phpEx") === false) { die('Language file ' . $module_root_path. "lang_" . $clean_language . "/lang_main.$phpEx" . ' couldn\'t be opened.'); } } if(empty($caster_ip)) { $caster_ip = "localhost"; $lang['Off_Air'] = $lang['Edit_Config']; @define('SHOTCAST_INSTALLED', false); } else { @define('SHOTCAST_INSTALLED', true); } if(empty($caster_port)) { $caster_port = "8000"; } if(empty($caster_internal_port)) { $caster_internal_port = "8000"; } if(empty($caster)) { $caster = "shout"; } if(empty($playlist_pls)) { $playlist_pls = "listen.pls"; } if(empty($playlist_ip)) { $playlist_ip = $caster_ip; $playlist_port = $caster_port; } //Setup defualt skin, then overwrite it with your configuration skin $default_skin = "default"; if(!empty($radio_skin)) { $default_skin = $radio_skin; } if(isset($_GET["skin"])) { $radio_skin = $_GET["skin"]; } elseif(isset($_GET["style"])) { $radio_skin = $_GET["style"]; } else { if(empty($radio_skin)) { $radio_skin = "default"; } } $radio_skin = preg_replace("/[^a-zA-Z0-9_.-@]/", "", $radio_skin); if (@file_exists($module_root_path . "skins/" . $radio_skin . "/skin_config.$phpEx") === false) { $radio_skin = $default_skin; //die('Requested skin and default skin configuration file couldn\'t be found.'); } @define('SKIN', $radio_skin); if(empty($disable_clean_string)) { $disable_clean_string = "no"; } require($module_root_path ."includes/cast_functions." . $phpEx); if($caster === "shout") { $icecast_mount_point = ""; $getinfo = $module_root_path . "includes/getinfo_shout." . $phpEx; } else { $getinfo = $module_root_path . "includes/getinfo_ice." . $phpEx; } require($getinfo); //Setup some vars if(!empty($stream_title)) { $station_name = $stream_title; } elseif(empty($station_name)) { $station_name = "Radio Station"; } if(!empty($server_name)) { $h = $server_name = $station_name; } elseif(empty($station_name)) { $h = $server_name = "Radio Station"; } $a = $currentsong; $b = $currentlisteners; $c = $maxlisteners; $d = $mimetype; $e = $stream_genre; $f = $bitrate; $g = $peaklisteners; $h = $server_name; $i = $server_description; $j = $quality; $k = $video_quality; $l = $frame_size; $m = $frame_rate; $n = $server_url; $o = $artist; $p = ""; $q = ""; $r = ""; $s = ""; $t = ""; $u = ""; $v = ""; $w = ""; $x = ""; $y = ""; $z = ""; $update_title = "5000"; $accplugin = 'http://retro-radio.net/plugin/setup_AAC_aacPlus_plugin_1_0_36.exe'; $ff2pluginspace = ($mimetype !== 'audio/aacp') ? 'http://port25.technet.com/videos/downloads/wmpfirefoxplugin.exe' : $accplugin; $wmp7pluginspace = ($mimetype !== 'audio/aacp') ? 'http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&' : $accplugin; $wmp6pluginspace = ($mimetype !== 'audio/aacp') ? 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' : 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715'; if(!empty($stream_title)) { $station_name = $stream_title; } elseif(empty($station_name)) { $station_name = "Radio Station"; } require($module_root_path ."config/display_config." . $phpEx); require($module_root_path . "skins/" . $radio_skin . "/skin_config." . $phpEx); require($module_root_path ."includes/css." . $phpEx); require($module_root_path ."includes/java_script." . $phpEx); //require($module_root_path ."includes/cd_cover_getter." . $phpEx); //Removed by DrKnas in v. 4.21 - To do!!!! $full_wmp_playlist_url = $playlist_ip . ":" . $playlist_port . (!empty($playlist_asx) ? "/" . $playlist_asx : ""); $full_real_and_quick_playlist_url = $playlist_ip . ":" . $playlist_port . (!empty($playlist_pls) ? "/" . $playlist_pls : ""); ?>includes/css.php0000755000000000000000000001200112147726723011063 0ustar "; return $css; } ?> includes/cur_display.php0000755000000000000000000001421412147704566012622 0ustar "knas-20", "Operation"=>"ItemSearch", "SearchIndex"=>$search, "ResponseGroup"=>"Medium,Offers", "Keywords"=>clean_string_alpha_num($title)), $title, $curl); if ($parsed_xml === false) { $search = "MP3Downloads"; $parsed_xml = aws_search_album(array("AssociateTag"=>"knas-20", "Operation"=>"ItemSearch", "SearchIndex"=>$search, "ResponseGroup"=>"Medium,Offers", "Keywords"=>clean_string_alpha_num($title)), $title, $curl); } $data = @is_object($parsed_xml) ? aws_get_wanted_data($parsed_xml) : ""; if(is_array($data)) { $url_picture = ($url_picture != 'nochange') ? $url_picture : $data[0]; if(!empty($data[1]) && ($data[0] != $data[1])) { $url_info = ($url_info != $no_cover_url) ? $url_info : $data[1]; } } /* if (isset($parsed_xml->Items->Item->SmallImage->URL)) { $url_picture = ($url_picture != 'nochange') ? $url_picture : $parsed_xml->Items->Item->SmallImage->URL; $url_info = ($url_info != 'nochange') ? $url_picture : (isset($parsed_xml->Items->Item->DetailPageURL) ? $parsed_xml->Items->Item->DetailPageURL : $url_picture); } */ } if ($url_picture == "nochange") { if($fallback == "logo") { $url_picture = $module_root_bang . "logos/" . $logo_name; } else { $url_picture = $module_root_bang. "skins/" . SKIN . "/equalizer_play.gif"; } } } } } if($picture == "logo") { $url_picture = $module_root_bang . "logos/" . $logo_name; //Try FavIcon.Ico if a site is found in song title $url_picture = song_siteInfo($artist, $song, $url_picture, 'url_picture'); } //Blank Picture check for Curenct Picture ver 3.x if(empty($url_picture)) { if($fallback == "logo") { $url_picture = $module_root_bang . "logos/" . $logo_name; } else { $url_picture = $module_root_bang. "skins/" . SKIN . "/equalizer_play.gif"; } } $old_title = asc2hex($currentsong); // generate the XML headers header('Content-type: text/xml'); echo ''; if($disable_clean_string == "no") { $title = clean_string($title); $server_description = clean_string($server_description); $server_url = clean_string($server_url); $firstinfo = clean_string($firstinfo); $secondinfo = clean_string($secondinfo); $thirdinfo = clean_string($thirdinfo); $forthinfo = clean_string($forthinfo); } else { $title = trim($title); $server_description = trim($server_description); $server_url = trim($server_url); $firstinfo = trim($firstinfo); $secondinfo = trim($secondinfo); $thirdinfo = trim($thirdinfo); $forthinfo = trim($forthinfo); } // generate the XML Response print " ".htmlentities(clean_string($title))." ".htmlentities(clean_string($firstinfo))." ".htmlentities(clean_string($secondinfo))." ".htmlentities(clean_string($thirdinfo))." ".htmlentities(clean_string($forthinfo))." ".htmlentities($update_title)." ".htmlentities($url_picture)." ".htmlentities($url_info)." ".htmlentities($server_description)." ".htmlentities($server_url)." ".htmlentities($old_title)." "; ?> includes/cur_listeners.php0000755000000000000000000000344011426665000013150 0ustar
BluePink BluePink
XHost
Servere virtuale de la 20 eur / luna. Servere dedicate de la 100 eur / luna - servicii de administrare si monitorizare incluse. Colocare servere si echipamente de la 75 eur / luna. Pentru detalii accesati site-ul BluePink.
' . $currentlisteners . ''; ?> includes/cur_picture.php0000755000000000000000000001101212147473056012616 0ustar "knas-20", "Operation"=>"ItemSearch", "SearchIndex"=>$search, "ResponseGroup"=>"Medium,Offers", "Keywords"=>clean_string_alpha_num($title)), $title, $curl); if ($parsed_xml === false) { $search = "MP3Downloads"; $parsed_xml = aws_search_album(array("AssociateTag"=>"knas-20", "Operation"=>"ItemSearch", "SearchIndex"=>$search, "ResponseGroup"=>"Medium,Offers", "Keywords"=>clean_string_alpha_num($title)), $title, $curl); } $data = @is_object($parsed_xml) ? aws_get_wanted_data($parsed_xml) : ""; if(is_array($data)) { $url_picture = ($url_picture != 'nochange') ? $url_picture : $data[0]; $url_info = ($url_info != $no_cover_url) ? $url_info : $data[1]; } if (isset($parsed_xml->Items->Item->SmallImage->URL)) { $url_picture = ($url_picture != 'nochange') ? $url_picture : $parsed_xml->Items->Item->SmallImage->URL; $url_info = ($url_picture != 'nochange') ? $url_picture : $parsed_xml->Items->Item->DetailPageURL; } } if ($url_picture == "nochange") { if($fallback == "logo") { $url_picture = $module_root_bang . "logos/" . $logo_name; } else { $url_picture = $module_root_bang. "skins/" . SKIN . "/equalizer_play.gif"; } } } if($picture == "logo") { $url_picture = $module_root_bang . "logos/" . $logo_name; //Try FavIcon.Ico if a site is found in song title $url_picture = song_siteInfo($artist, $song, $url_picture, 'url_picture'); } //Blank Picture check for Curenct Picture ver 3.x if (empty($url_picture)) { if($fallback == "logo") { $url_picture = $module_root_bang . "logos/" . $logo_name; } else { $url_picture = $module_root_bang. "skins/" . SKIN . "/equalizer_play.gif"; } } $old_title = asc2hex($currentsong); if($mode == 'url_picture') { die("$url_picture"); } else { die("$$mode"); } ?>includes/cur_song.php0000755000000000000000000000532212147726547012126 0ustar ' . $title . '   '; ?>includes/cur_url.php0000755000000000000000000000744712147704566011771 0ustar "knas-20", "Operation"=>"ItemSearch", "SearchIndex"=>$search, "ResponseGroup"=>"Medium,Offers", "Keywords"=>clean_string_alpha_num($title)), $title, $curl); if ($parsed_xml === false) { $search = "MP3Downloads"; $parsed_xml = aws_search_album(array("AssociateTag"=>"knas-20", "Operation"=>"ItemSearch", "SearchIndex"=>$search, "ResponseGroup"=>"Medium,Offers", "Keywords"=>clean_string_alpha_num($title)), $title, $curl); } $data = @is_object($parsed_xml) ? aws_get_wanted_data($parsed_xml) : ""; if(is_array($data)) { $url_info = ($url_info != $no_cover_url) ? $url_info : $data[1]; } if (isset($parsed_xml->Items->Item->SmallImage->URL)) { $url_info = ($url_picture != 'nochange') ? $url_picture : $parsed_xml->Items->Item->DetailPageURL; } } } } } $old_title = asc2hex($currentsong); if($mode == 'url_info') { die("$url_info"); } else { die("$$mode "); } ?>includes/getinfo.php0000755000000000000000000003375312145271056011737 0ustar = '5.0.0') { //$open = fsockopen($scip, $scport, &$errno, &$errstr, $connect_timeout); //open connection $open = @fsockopen($scip, $scport); //open connection if(!$open) { //if connection could not be made @fclose($open); $text = array(); if ($force_online == 1) { $text[1] = '1, 1, 4, 32, 1, 128, Unknon Artist'; $text = explode(",",$text[1]); } $er = '

' . $lang['Socket_functions_disabled'] . '

'; } else { //$request = "GET /7.html HTTP/1.1\r\nHost:" . $scip . ":" . $scport . "\r\nUser-Agent: SHOUTcast DNAS Status [7] * XML Getter (Mozilla Compatible)\r\nConnection: close\r\n\r\n"; //get 7.html //@fputs($open,"GET /7 HTTP/1.1\r\nUser-Agent:Mozilla\r\n\r\n"); fputs($open,"GET /7.html HTTP/1.1\r\nUser-Agent:Mozilla\r\n\r\n"); $read = @fread($open, 1000); $text = explode("content-type:text/html", $read); $text = explode(",",$text[1]); @fclose($open); } } else { $text = array(); $er = '

Old php version!

'; } $page = $song = ''; $scfp = @fsockopen($scip, $scport); $scsuccs = ($scfp) ? '' : 1; if ($scfp) { @fputs($scfp, "GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"); while(!feof($scfp)) { $page .= @fgets($scfp, 1000); } $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE", "SERVERGENRE", "SONGURL", "SERVERURL", "REPORTEDLISTENERS"); $y = 0; while(!empty($loop[$y])) { $pageed = @preg_replace("~.*<$loop[$y]>~", "", $page); $scphp = strtolower($loop[$y]); $$scphp = @preg_replace("~.*~", "", $pageed); if($loop[$y] == "STREAMSTATUS" || $loop[$y] == "BITRATE" || $loop[$y] == "SERVERTITLE" || $loop[$y] == "SERVERGENRE" || $loop[$y] == "CURRENTLISTENERS" || $loop[$y] == "MAXLISTENERS" || $loop[$y] == "SONGURL" || $loop[$y] == "SERVERURL" || $loop[$y] == "SONGTITLE" || $loop[$y] == "REPORTEDLISTENERS") { $$scphp = urldecode($$scphp); } $y++; } $pageed = @preg_replace("~.*~", "", $page); $pageed = @preg_replace("~.*~", "", $pageed); $songatime = explode("", $pageed); //$streamstatus = preg_replace("/.*/", "", $page); //$streamstatus = preg_replace("/.*/", "", $pageed); $r = 1; while(!empty($songatime[$r])) { $t = $r - 1; $playedat[$t] = preg_replace("/.*/", "", $songatime[$r]); $playedat[$t] = preg_replace("/.*/", "", $playedat[$t]); $song[$t] = preg_replace("/.*/", "", $songatime[$r]); $song[$t] = preg_replace("/.*/", "", $song[$t]); $song[$t] = urldecode($song[$t]); $dj[$t] = preg_replace("/.*/", "", $page); $dj[$t] = preg_replace("/.*/", "", $pageed); $r++; } @fclose($scfp); $text[1] = ($text[1] == 1) ? $text[1] : $streamstatus; //$text[2] = !empty($text[2]) ? $text[2] : $currentlisteners; $text[3] = !empty($text[3]) ? $text[3] : $maxlisteners; $text[5] = !empty($text[5]) ? $text[5] : $bitrate; } else { $shoutcastserver = $station = $servertitle = $station_name; $currentlisteners = "Unknon"; $bitrate = "Unknon"; $text[6] = $song[0] = "Unknon Artist"; $maxlisteners = "Unknon"; $servergenre = $lang['Socket_functions_disabled']; $songurl = "Unknon"; $serverurl = "Unknon"; $reportedlisteners = "Unknon"; $er = '

' . $lang['Socket_functions_disabled'] . '

'; } /** * radio.class is a stand-alone php class for ShoutCast Servers that obtains informations about the server. * USAGE: * $variable = new radio(HOST, PORT); - Construct the Object. ie. - new radio($SERVER_NAME, 8000); * $variable->host - Get server host. (INT) * $variable->port - Get server port. (INT) * $variable->stat - Status if server is on/off (INT, 1=on, 0=off) * $variable->bitrate - Bitrate of streaming audio. (INT) * $variable->listners - Listners. (INT) * $variable->station - Radiostation name (STRING) * $variable->genre - Streamers selected genre. (STRING) * $variable->song - Current song. (STRING) * $variable->played - Last played songs (ARRAY[STRING]) * * @author Niklas Pull * @created 2008-02-04, Sweden * * Keep the autor tag in order to use or distrubutate this php class, */ class radio { var $host; var $port; var $stat = 0; var $rawdata; var $c = 0; var $errno; var $errstr; /** * Constructor for radio class. * @param $host Server Host. * @param $port Server Port */ function radio($host, $port) { $this->host = $host; $this->port = $port; $this->rawdata = $this->getServerData("index.html"); $this->stat = $this->servStat(); } /** * Collecting raw data from ShoutCast server. * @param $source From where to collect data. * @return An array with each row. */ function getServerData($source) { $fp = @fsockopen($this->host, $this->port, $errno, $errstr, 10); static $buf; if (!$fp) { return; } else { @fputs($fp, "GET /$source HTTP/1.1\r\n"); @fputs($fp, "Host: $this->host\r\n"); @fputs($fp, "User-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"); @fputs($fp, "Connection: close\r\n\r\n"); while (!feof($fp)) { $buf .= fgets($fp, 128); } @fclose($fp); return explode("\t", strip_tags(str_replace(array("", "", "Current Song"), array("\t", "\t", " Current Song"), $buf))); } } /** * @return An integer, 1 if the server is streaming otherwise 0. */ function servStat() { $i = 0; while ($i < count($this->rawdata)) { $this->rawdata[$i] = trim($this->rawdata[$i]); if (strstr($this->rawdata[$i], "Server Status:")) { $tmp = explode(" ", $this->rawdata[$i+1]); return ($tmp[3] == "up") ? "1" : "0"; } $i++; } return 0; } /** * @return An integer representing the bitrate of the streaming. */ function bitrate() { $i = 0; if($this->stat != 1) { return 0; } while ($i < count($this->rawdata)) { $this->rawdata[$i] = trim($this->rawdata[$i]); if (strstr($this->rawdata[$i], "Stream Status:")) { $bitr = explode(" ", $this->rawdata[$i+1]); return $bitr[4]; } $i++; } } /** * @return An integer of how many listners. */ function listners() { $i = 0; if($this->stat != 1) { return 0; } while ($i < count($this->rawdata)) { $this->rawdata[$i] = trim($this->rawdata[$i]); if (strstr($this->rawdata[$i], "Stream Status:")) { $listn = explode(" ", $this->rawdata[$i+1]); return $listn[7]; } $i++; } } /** * @return A string representing the Stream title. */ function station() { $i = 0; if($this->stat != 1) { return; } while ($i < count($this->rawdata)) { $this->rawdata[$i] = trim($this->rawdata[$i]); if (strstr($this->rawdata[$i], "Stream Title:")) { return $this->rawdata[$i+1]; } $i++; } } /** * @return The mime-type of the stream */ function mimeType() { $i = 0; if($this->stat != 1) { return; } while ($i < count($this->rawdata)) { $this->rawdata[$i] = trim($this->rawdata[$i]); if (strstr($this->rawdata[$i], "Content Type:")) { return $this->rawdata[$i+1]; } $i++; } } /** * @return The streaming genre. */ function genre() { $i = 0; if($this->stat != 1){ return; } while ($i < count($this->rawdata)) { $this->rawdata[$i] = trim($this->rawdata[$i]); if (strstr($this->rawdata[$i], "Stream Genre:")) { return $this->rawdata[$i+1]; } $i++; } } /** * @return A string with the current song playing on the stream. */ function song(){ $i = 0; if($this->stat != 1){ return; } if($this->c != 0){ return trim($this->rawdata[$this->c]); } while ($i < count($this->rawdata)) { $this->rawdata[$i] = trim($this->rawdata[$i]); if (strstr($this->rawdata[$i], "Current Song:")) { $this->c = $i+1; return $this->rawdata[$i+1]; } $i++; } } /** * @return An array with Strings of every previous played song, the lenght is set inte the .ini file for the ShoutCast server. */ function played() { $played = array(); $i = 0; if($this->stat != 1) { return; } $raw_played = $this->getServerData("played.html"); while ($i < count($raw_played)) { $raw_played[$i] = trim($raw_played[$i]); if (strstr($raw_played[$i], "Current Song")) { $i=$i+3; break; } $i++; } $j=0; while ($raw_played[$i-1] != "") { $played[$j] = $raw_played[$i]; $i=$i+2; $j++; } return $played; } } $radio = new radio($scip, $scport); $mimetype = ''; if ($radio->mimeType()) { $mimetype = $radio->mimeType(); } else { $mimetype = ($stream_type == 'mp3') ? 'audio/mpeg' : 'audio/aacp'; } // The "i" after the pattern delimiter indicates a case-insensitive search if (preg_match("/Unauthorized/", $servertitle)) { $servertitle = $station_name; } if($radio->station()) { $stream_title = $radio->station(); } else { $stream_title = $servertitle; } if (preg_match("/Unauthorized/", $servergenre)) { $servergenre = $radio->genre(); } if (preg_match("/Unauthorized/", $songurl)) { $songurl = ""; } if (preg_match("/Unauthorized/", $serverurl)) { $serverurl = $lang['require_password']; } //Check for reported listeners if (preg_match("/Unauthorized/", $reportedlisteners)) { $reportedlisteners = $lang['require_password']; } //Check for max listeners if (preg_match("/Unauthorized/", $maxlisteners)) { $maxlisteners = $text[3]; } //Check for curent listeners if($radio->listners()) { if (is_numeric($currentlisteners)) { if ($currentlisteners < $radio->listners()) { $currentlisteners = $radio->listners(); } //Else return value from admin.cgi //Validate admin.cgi $shotcast_admin = true; } else { $currentlisteners = $radio->listners(); $shotcast_admin = false; } //now compare $currentlisteners with value from 7.html if (is_numeric($text[2])) { if (($currentlisteners < $text[2])) { $currentlisteners = $text[2]; } //Validate 7.html $shotcast_stats = true; } if ((($shotcast_admin)&& ($shotcast_stats)) || (mt_rand(0, 3) === 1)) { $listeners_array = array(); $listeners_array[0] = $currentlisteners; $listeners_array[1] = $radio->listners(); $listeners_array[2] = $text[2]; $listeners_array[3] = $currentlisteners; $currentlisteners = $listeners_array[mt_rand(0, 3)]; } } elseif (@preg_match("/^[a-zA-Z\-\'\ ]+$/", $text[2])) { $currentlisteners = $text[2]; } elseif (@preg_match("/Unauthorized/", $currentlisteners)) { $currentlisteners = 'n/a'; } //Check for curent song if($radio->song()) { $curentsong = $radio->song(); } elseif (preg_match("/^[a-zA-Z\-\'\ ]+$/", $text[6])) { $curentsong = $text[6]; } elseif (($song[0]) || !(preg_match("/Unauthorized/", $song[0]))) { $curentsong = $song[0]; } else { $curentsong = $lang['Unknown_Artist']; } if($radio->genre()) { $stream_genre = $radio->genre(); } else { $stream_genre = $lang['Unknown']; } //Check for curent bitrate if($radio->bitrate()) { $bitrate = $radio->bitrate(); } elseif (preg_match("/^[a-zA-Z\-\'\ ]+$/", $text[5])) { $bitrate = $text[5]; } elseif (preg_match("/Unauthorized/", $bitrate)) { $bitrate = 'n/a'; } $wmpmode = ($mimetype !== 'audio/aacp') ? 'http://' : 'icyx://'; // AAC VS MPEG $wmplist = '/' . $playlist; $protocol_type = ($mimetype !== 'audio/aacp') ? 'http' : 'icyx'; $streamdest = $protocol_type . "://" . $scip . ":" . $scport . "/" . $playlist; $accplugin = 'http://www.free-codecs.com/download_soft.php?d=5079&s=683'; $ff2pluginspace = ($mimetype !== 'audio/aacp') ? 'http://port25.technet.com/videos/downloads/wmpfirefoxplugin.exe' : $accplugin; $wmp7pluginspace = ($mimetype !== 'audio/aacp') ? 'http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&' : $accplugin; $wmp6pluginspace = ($mimetype !== 'audio/aacp') ? 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' : 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715'; $state = ($text[1] == 1) ? 'Up' : 'Down'; $shotcast_state_icon = ($text[1] == 1) ? 'online.gif' : 'offline.gif'; $text[2] = !empty($text[2]) ? $text[2] : $currentlisteners; $text[3] = !empty($text[3]) ? $text[3] : $maxlisteners; $text[5] = !empty($text[5]) ? $text[5] : $bitrate; $status = isset($_GET['status']) ? $_GET['status'] : 'stop'; $player = isset($_GET['player']) ? $_GET['player'] : 'wmp'; $changeto = ($player == 'real') ? 'wmp' : 'real'; ?>includes/getinfo_ice.php0000755000000000000000000002413212147704566012557 0ustar ]*class=\"streamdata\">(.*)<\/td>/isU' , $page, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); //die("$page"); //for( $i = 0; $i < $n = count($page_array); $i++ ) //{ // $state = "Up"; //} $mount_points = explode("_END_",$page); if(count($mount_points) < 2) { return FALSE; } foreach ($mount_points as $value) { if ( ( $value !== '_END_' ) && !empty( $value ) ) { $info = explode("|",$value); if(isset($info[0])) { $mountpoint = explode("_START_", $info[0]); if(count($mountpoint) > 1) { $status[$info[0]]['mount'] = preg_replace("/[\n\r]/","",$mountpoint[1]) ; } else { $status[$info[0]]['mount'] = preg_replace("/[\n\r]/","",$mountpoint[0]) ; } } if(isset($info[1])) { $status[$info[0]]['server_name'] = preg_replace("/[\n\r]/","",$info[1]) ; } if(isset($info[2])) { $status[$info[0]]['server_description'] = preg_replace("/[\n\r]/","",$info[2]) ; } if(isset($info[3])) { $status[$info[0]]['server_type'] = preg_replace("/[\n\r]/","",$info[3]) ; } if(isset($info[4])) { $status[$info[0]]['bitrate'] = preg_replace("/[\n\r]/","",$info[4]) ; } if(isset($info[5])) { $status[$info[0]]['quality'] = preg_replace("/[\n\r]/","",$info[5]) ; } if(isset($info[6])) { $status[$info[0]]['video_quality'] = preg_replace("/[\n\r]/","",$info[6]) ; } if(isset($info[7])) { $status[$info[0]]['frame_size'] = preg_replace("/[\n\r]/","",$info[7]) ; } if(isset($info[8])) { $status[$info[0]]['frame_rate'] = preg_replace("/[\n\r]/","",$info[8]) ; } if(isset($info[9])) { $status[$info[0]]['listeners'] = preg_replace("/[\n\r]/","",$info[9]) ; } if(isset($info[10])) { $status[$info[0]]['listener_peak'] = preg_replace("/[\n\r]/","",$info[10]) ; } if(isset($info[11])) { $status[$info[0]]['genre'] = preg_replace("/[\n\r]/","",$info[11]) ; } if(isset($info[12])) { $status[$info[0]]['server_url'] = preg_replace("/[\n\r]/","",$info[12]) ; } if(isset($info[13])) { $status[$info[0]]['artist'] = preg_replace("/[\n\r]/","",$info[13]) ; } if(isset($info[14])) { $status[$info[0]]['title'] = preg_replace("/[\n\r]/","",$info[14]) ; } $status[$streamdata]['status'] = 'Up'; } } if(isset($status)) { return $status; } else { return FALSE; } } else { $status[$streamdata]['status'] = 'Socket'; return $status; } @fclose($fp); # error_reporting(E_ALL ^ E_NOTICE); } /* based on function by Jude http://jude.im/ FlorinCB works with Icecast 2.3.2 */ function getStreamInfo($ice_caster_ip, $ice_caster_port, $icecast_mount_point) { static $streamdata; $status = array(); $str = @file_get_contents('http://'.$ice_caster_ip.":".$ice_caster_port.'/status.xsl?mount='.$icecast_mount_point); if(!$str) { $fp = @fsockopen($ice_caster_ip, $ice_caster_port, $errno, $errstr, 5); if($fp) { @fputs($fp,"GET /status.xsl?mount=".$icecast_mount_point." HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); while(!@feof($fp)) { $str .= @fgets($fp, 1000); } } else { $status[$streamdata]['status'] = 'Down'; } } if(preg_match_all('/]*class=\"streamdata\">(.*)<\/td>/isU', $str, $match)) { //Stream Title: title 1,0 //Stream Description: description 1.1 //Content Type: audio/mpeg type 1,2 //Mount started: Thu, 16 May 2013 09:39:02 -0500 start 1.3 //Bitrate: 56 bitrate 1,4 //Current Listeners: 3 listeners 1,5 //Peak Listeners: 3 max_listeners 1,6 //Stream Genre: Various genre 1,7 //Stream URL: http://www.scweb.tld/ stream_url 1,8 //Current Song: Artist - Song - Album $status[$streamdata]['status'] = 'Up'; $status[$streamdata]['title'] = $match[1][0]; $status[$streamdata]['description'] = $match[1][1]; $status[$streamdata]['type'] = $match[1][2]; $status[$streamdata]['start'] = $match[1][3]; $status[$streamdata]['bitrate'] = $match[1][4]; $status[$streamdata]['listeners'] = $match[1][5]; $status[$streamdata]['max_listeners'] = $match[1][6]; $status[$streamdata]['genre'] = $match[1][7]; $status[$streamdata]['stream_url'] = $match[1][8]; $status[$streamdata]['artist_song'] = $match[1][9]; $x = explode(" - ", $match[1][9]); $status[$streamdata]['artist'] = !empty($x[0]) ? $x[0] : $match[1][9]; $status[$streamdata]['song'] = !empty($x[1]) ? $x[1] : $match[1][9]; } else { $status[$streamdata]['status'] = 'Down'; } if(!$str) { $status[$streamdata]['status'] = 'Socket'; } return $status; } ?>includes/getinfo_shout.php0000755000000000000000000001727512147704566013173 0ustar
.*~", "", $page); //extract data $page_array = preg_split('~(]+>)~' , $page, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); if(count($page_array) > 10) { for( $i = 0; $i < count( $page_array ); $i++ ) { $state = "Up"; if($page_array[$i] == "Server Status: ") { $server_status = strip_tags($page_array[$i+6]); } if($page_array[$i] == "Stream Status: ") { $bitrate = preg_replace("/ kbps.*/", "", preg_replace("/.*at /", "", $page_array[$i+6])); $currentlisteners = preg_replace("/of.*/", "", $page_array[$i+8]); $maxlisteners = preg_replace("/ listeners.*/", "", preg_replace("/.*of/", "", $page_array[$i+8])); } if($page_array[$i] == "Listener Peak: ") { $peaklisteners = strip_tags($page_array[$i+6]); } if($page_array[$i] == "Stream Title: ") { $stream_title = strip_tags($page_array[$i+6]); } if($page_array[$i] == "Content Type: ") { $mimetype = strip_tags($page_array[$i+6]); } if($page_array[$i] == "Stream Genre: ") { $stream_genre = strip_tags($page_array[$i+6]); } if($page_array[$i] == "Stream URL: ") { $stream_url = strip_tags($page_array[$i+6]); } if($page_array[$i] == "Current Song: ") { $currentsong = strip_tags($page_array[$i+6]); } } } else { $state = $server_status = "Down"; $peaklisteners = 1; $bitrate = "56"; $stream_title = "Stream"; $currentsong = "Track"; $server_url = "http://".$shout_caster_ip.":".$shout_caster_port."/"; //$mimetype = "audio/mpeg"; $lang['Off_Air'] = $lang['Socket_functions_disabled']; } } @fclose($fp); $x = explode(" - ", $currentsong); $artist = !empty($x[0]) ? $x[0] : $currentsong; $song = !empty($x[1]) ? $x[1] : $currentsong; $server_description[1] = sprintf($lang['Description_Status'] ." kbps - ". $lang['listeners'] .": %s", $bitrate, $peaklisteners); $server_description[2] = !empty($server_status) ? $server_status : $stream_title; $server_description[3] = $stream_title; $choice = rand(1, 3); $server_description = $server_description[$choice]; $server_url = !empty($stream_url) ? $stream_url : "http://".$shout_caster_ip.":".$shout_caster_port."/"; if (empty($mimetype)) { $mimetype = ($stream_type == 'mp3') ? 'audio/mpeg' : 'audio/aacp'; } // The "i" after the pattern delimiter indicates a case-insensitive search if (preg_match("/Unauthorized/", $station_name)) { $stream_title = $station_name; } if (preg_match("/Unauthorized/", $bitrate)) { $bitrate = 'n/a'; } $wmpmode = ($mimetype !== 'audio/aacp') ? 'http://' : 'icyx://'; // AAC VS MPEG $wmplist = '/' . $playlist_pls; $protocol_type = ($mimetype !== 'audio/aacp') ? 'http' : 'icyx'; $streamdest = $protocol_type . "://" . $shout_caster_ip . ":" . $shout_caster_port . "/" . $playlist_pls; $accplugin = 'http://www.free-codecs.com/download_soft.php?d=5079&s=683'; $ff2pluginspace = ($mimetype !== 'audio/aacp') ? 'http://port25.technet.com/videos/downloads/wmpfirefoxplugin.exe' : $accplugin; $wmp7pluginspace = ($mimetype !== 'audio/aacp') ? 'http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&' : $accplugin; $wmp6pluginspace = ($mimetype !== 'audio/aacp') ? 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' : 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715'; $shotcast_state_icon = ($state == "Up") ? 'online.gif' : 'offline.gif'; $status = isset($_GET['status']) ? $_GET['status'] : 'stop'; $player = isset($_GET['player']) ? $_GET['player'] : 'wmp'; $changeto = ($player == 'real') ? 'wmp' : 'real'; #error_reporting(E_ALL ^ E_NOTICE); ?>includes/index.html0000755000000000000000000000357712143426334011570 0ustar Index of /radioplayer/v4/includes


Index of /radioplayer/v4/includes

Last Updated: Saturday, May 11th, 2013


File name Size Last update Description
[..]<DIR>5/11/2013, 16:3Parent directory
cd_cover_getter.php2,27211/22/2008, 0:10
common.php6,0353/3/2011, 0:57
css.php3,97711/22/2008, 0:9
cur_display.php2,65311/22/2008, 0:9
getinfo_ice.php5,3132/17/2009, 19:39
getinfo_shout.php3,1063/3/2011, 0:44
java_script.php19,74612/27/2008, 1:9

There are 7 files and 1 directories
for a total of 43102 bytes.
includes/java_script.php0000755000000000000000000006435312147704566012622 0ustar "; } ?>