source->title; }else{ $show_song_title = 'on'; // show_song_title: on - off. When it is on, it will show the currently playing song name on the player. $show_album_art = 'on'; // Options: on - off. If this is on, the script will search the itunes search API for the currently playing song image and will show it on the player. If it doesnt find the image on itunes, it will not show the image and div. The script inserts the image file into in the player.php file. You can change the location of this image on the page or on your website. If $show_song_title is set off, this option will be ignored and set off. This is only available when $show_song_title is on. $song_title_update = '1'; // The song name update interval in MINUTE form. 2 means 2 minute. That means the script will update the song name and album art every 2 minutes. // Color Options, if you need white or transparent background use preimg.light.png and other .png files in the img folder, set them in js/player.css. $song_title_color = '#FFF'; $player_background_color = ''; $player_size_width = '400px'; // Minumum 400px is suggested, below 300 the song name will expand if it is long. $song_title_width = '400px'; if($show_song_title == 'on') { $fp = @fsockopen($dados_servidor["ip"],$dados_stm["porta"], $errno, $errstr, 5); if($fp) { @fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Reader(Mozilla Compatible)\r\n\r\n"); while(!feof($fp)) { $dataset = @fgets($fp, 1000); } @fclose($fp); $entries = explode(",",$dataset); $status=$entries[1]; $currentlisteners=$entries[0]; $bitrate=$entries[5]; $songtitle=$entries[6]; $maxlist=$entries[3]; if($show_album_art == 'on' && $show_song_title == 'on') { // itunes song art this is for removing the (original mix) and some other parts from the track name, itunes doesnt like. $songtitle_exp = explode('-', $songtitle); // This is for itunes album search. Explodes the track name into two by using - to get the artist and track name. $songtitle = str_replace('(', '', $songtitle); $songtitle = str_replace(')', '', $songtitle); $songtitle = str_replace('[', '', $songtitle); $songtitle = str_replace(']', '', $songtitle); $songtitle = str_replace('{', '', $songtitle); $songtitle = str_replace('}', '', $songtitle); $songtitle = str_replace('@', '', $songtitle); $songtitle = str_replace('#', '', $songtitle); $songtitle = str_replace('%', '', $songtitle); $songtitle = str_replace('www.', '', $songtitle); $songtitle = str_replace('.com.br', '', $songtitle); $songtitle = str_replace('.com', '', $songtitle); $artist = $songtitle_exp[0]; $artist = explode("-", $artist); // Clear feat and thirdnames that itunes search does not like $artist = "$artist[0]" . " $artist[1]"; // Use only two first words from the artist name, usually name and surname $artist = str_replace('(', '', $artist); $artist = str_replace(')', '', $artist); $artist = str_replace('[', '', $artist); $artist = str_replace(']', '', $artist); $artist = str_replace('{', '', $artist); $artist = str_replace('}', '', $artist); $artist = str_replace('@', '', $artist); $artist = str_replace('#', '', $artist); $artist = str_replace('%', '', $artist); $artist = str_replace('www.', '', $artist); $artist = str_replace('.com.br', '', $artist); $artist = str_replace('.com', '', $artist); function delete_all_between($beginning, $end, $string) { $beginningPos = strpos($string, $beginning); $endPos = strpos($string, $end); if ($beginningPos === false || $endPos === false) { return $string; } $textToDelete = substr($string, $beginningPos, ($endPos + strlen($end)) - $beginningPos); return str_replace($textToDelete, '', $string); } $trackname = delete_all_between('(', ')', $songtitle_exp[1]); $trackname = strip_tags($trackname); $trackname = trim($trackname); // itunes song art this is for removing the (original mix) and some other parts from the track name, itunes doesnt like. $trackname = str_replace('(', '', $trackname); $trackname = str_replace(')', '', $trackname); $trackname = str_replace('[', '', $trackname); $trackname = str_replace(']', '', $trackname); $trackname = str_replace('{', '', $trackname); $trackname = str_replace('}', '', $trackname); $trackname = str_replace('@', '', $trackname); $trackname = str_replace('#', '', $trackname); $trackname = str_replace('%', '', $trackname); $trackname = str_replace('www.', '', $trackname); $trackname = str_replace('.com.br', '', $trackname); $trackname = str_replace('.com', '', $trackname); echo ""; // Hidden div used to give artistname to javascript on the player.php echo ""; // Hidden div used to give trackname to javascript on the player.php } } // FP Ends } $tocando = $songtitle; } ?>