= (mktime () - 120)) { header('X-Using-Cache: yes'); readfile ('/tmp/dir.xiph.org.index_cache.html'); exit (); } ob_start (); } $nopad = 1; ?> Icecast.org '; return $streamLine; } function buildStreamLine($server_name,$listen_url, $genre, $listeners, $description, $current_song, $server_type, $server_subtype, $bitrate, $samplerate, $channels, $stream_id, $bgcolor, $clustercount, $playlist_id) { if ($channels == "1") { $channels = "Mono"; } if ($channels == "2") { $channels = "Stereo"; } $mountpoint = preg_replace("/^http:\/\/.*:.*\//", "/", $listen_url); $server_type = contentTypeLookup($server_type, $server_subtype); $channels = str_replace(" ", "", $channels); $channels = str_replace("\r\n", "", $channels); if ($channels == "1") { $channels = "Mono"; } if ($channels == "2") { $channels = "Stereo"; } if ($server_type == "Ogg Vorbis") { if ($bitrate == "Quality 1@00") { $bitrate = ""; } if ($bitrate > 1000) { $bitrate = ""; } if ($bitrate == "0") { $bitrate = ""; } if ($samplerate == "") { $samplerate = ""; } else { $samplerate = $samplerate."Hz"; } if ($channels == "") { $channels = ""; } if (substr($bitrate, 0, 5) == "Quali") { $audio_info = $bitrate."
".$samplerate." ".$channels; } else { $audio_info = $bitrate."kbps
".$samplerate." ".$channels; } } else { if ($bitrate == "Quality 0") { $bitrate = ""; } if ($bitrate == "0") { $bitrate = ""; } if ($samplerate == "") { $samplerate = ""; } else { $samplerate = $samplerate."Hz"; } if ($channels == "") { $channels = ""; } $audio_info = $bitrate."kbps
".$samplerate." ".$channels; } if (($samplerate == "0") || ($channels == "0")) { $audio_info = "Unknown"; } $clustertext = ""; if ($clustercount > 1) { $clustertext = 'Cluster'; } if ($server_name != $description) { $description_tag = ''.$description.'
'; } else { $description_tag = '
'; } $streamLine = ' '; return $streamLine; } ?> '; $query = "select id, server_name, listeners from servers where yp_status = 'verified' order by rank desc"; $subquery = ""; if ($sgenre) { $query = "select a.id, a.server_name, a.listeners from servers a, server_details b where a.id = b.parent_id and b.genre like '%$sgenre%' and yp_status = 'verified' group by a.id, a.server_name, a.listeners order by a.rank desc"; $subquery = "and genre like '%$sgenre%'"; } if ($stype) { $query = "select a.id, a.server_name, a.listeners from servers a, server_details b where a.id = b.parent_id and b.server_type like '%$stype%' and yp_status = 'verified' group by a.id, a.server_name, a.listeners order by a.rank desc"; $subquery = "and server_type like '%$stype%'"; } if ($search) { $query = "select a.id, a.server_name, a.listeners from servers a, server_details b where a.id = b.parent_id and (a.server_name like '%$search%' or b.description like '%$search%' or b.current_song like '%$search%' or b.genre like '%$search%') and yp_status = 'verified' group by a.id, a.server_name, a.listeners order by a.rank desc"; $subquery = "and (server_name like '%$search%' or description like '%$search%' or current_song like '%$search%' or genre like '%$search%')"; } $result = mysql_query($query); if (!$result) { print "
Mysql Error: ".mysql_error()."!

"; } $row_counter = 0; $printed = 0; while ($row = mysql_fetch_row($result)) { $row_counter++; if ($start) { if ($row_counter < $start) { continue; } } if ($pagesize) { if ($printed >= $pagesize) { break; } } $id = $row[0]; $server_name = htmlentities($row[1]); $listeners = htmlentities($row[2]); $cluster_flag = 0; if ($cluster_id != "") { $cluster_flag = 1; } if ($swap) { $swap = 0; $bgcolor = "#222222"; } else { $swap = 1; $bgcolor = "#444444"; } if ($cluster_flag) { $cluster_text = "cluster"; } else { $cluster_text = ""; } if ($server_name != "") { $all_listeners = $listeners; $clustercount = 1; $query = "select description, genre, url, current_song, listen_url, server_type, bitrate, samplerate, channels, listeners+0, parent_id, id, playlist_id, server_subtype from server_details where parent_id = $id $subquery group by cluster_password"; $streamDetailsLine = ""; $result2 = mysql_query($query); if (!$result2) { print "
Mysql Error: ".mysql_error()."!

"; } while ($row2 = mysql_fetch_row($result2)) { $description = htmlentities($row2[0]); $genre = htmlentities($row2[1]); $url = htmlentities($row2[2]); $url = str_replace("hTtP", "http", $url); $current_song = htmlentities($row2[3]); $listen_url = urlencode($row2[4]); $listen_url = str_replace("hTtP", "http", $listen_url); $listen_url_raw = htmlentities($row2[4]); $listen_url_raw = str_replace("hTtP", "http", $listen_url_raw); $server_type = htmlentities($row2[5]); $bitrate = htmlentities($row2[6]); $samplerate = htmlentities($row2[7]); $channels = htmlentities($row2[8]); $listeners = htmlentities($row2[9]); $cluster_id = htmlentities($row2[10]); $stream_id = htmlentities($row2[11]); $playlist_id = $row2[12]; $server_subtype = htmlentities($row2[13]); $total_listeners = $total_listeners + $listeners; $query2 = "select count(*) from playlists where id = $playlist_id"; $result3 = mysql_query($query2); $row3 = mysql_fetch_row($result3); $clustercount = $row3[0]; $streamDetailsLine .= buildStreamLine($server_name, $listen_url_raw, $genre, $listeners, $description, $current_song, $server_type, $server_subtype, $bitrate, $samplerate, $channels, $stream_id, $bgcolor, $clustercount, $playlist_id); } $streamDescriptionLine = buildStreamDescription($all_listeners, $url, $server_name, $bgcolor); $directory_data .= ' '.$streamDescriptionLine.' '.$streamDetailsLine.' '; $printed++; } } $directory_data .= '
Icecast Logo
Icecast Logo
Home  |   Download  |   Subversion  |   Stream Directory  |   Docs  |   3rd Party Apps  |   Ices  |   Mailing List  |   Contact
Icecast Logo



= 0) { return "Prev"; } else { return ""; } } function getNextLink($current, $pagesize, $rowcounter) { global $search; global $sgenre; global $stype; if ($rowcounter < $pagesize) { return ""; } $next = $current + $pagesize; $extra = ""; if ($search) { $extra .= "&search=".urlencode($search); } if ($sgenre) { $extra .= "&sgenre=".urlencode($sgenre); } if ($stype) { $extra .= "&stype=".urlencode($stype); } return "Next"; } function getContentTypes() { $query = "select distinct(server_type) from server_details"; $result = mysql_query($query); if (!$result) { print "
Mysql Error: ".mysql_error()."!

"; } $result_string = "Format Search
"; $result_string .= ""; return $result_string; } function getTotalListeners() { $query = "select sum(listeners) from servers where yp_status = 'verified'"; $result = mysql_query($query); if (!$result) { print "
Mysql Error: ".mysql_error()."!

"; } $row = mysql_fetch_row($result); if ($row) { return $row[0]; } } function getTotalServers() { $query = "select count(*) from servers a, server_details b where a.id = b.parent_id and a.yp_status = 'verified'"; $result = mysql_query($query); if (!$result) { print "
Mysql Error: ".mysql_error()."!

"; } $row = mysql_fetch_row($result); if ($row) { return $row[0]; } } function buildStreamDescription($listeners, $url, $server_name, $bgcolor) { $urllink = ""; if ($url != "") { if (substr($url, 0, 7) != "http://") { $url = "http://".$url; } $urllink = ''.substr($server_name, 0, 60).''; } else { $urllink = ''.substr($server_name, 0, 60).''; } $streamLine = '
'.$urllink.'
'.$clustertext.'
'.$server_type.'
'.$description_tag.'Now playing on '.$mountpoint.' :  '.substr($current_song, 0, 100).'
'.substr($genre, 0, 30).'
'.$audio_info.'
Listen
Streams
Genre
Audio Info
'; $nav_text = '
'.getPrevLink($start, $pagesize, $printed).'   '.getNextLink($start, $pagesize, $printed).'
'; print $nav_text; print $directory_data; print $nav_text; ?> Search
Genre


Freeform Search


Statistics
Total Servers: