<?php echo $sitename; ?> Requests \r\n"; ?>

Library Builder

Local library is being rebuilt. This may take some time.
\r\n"; $result = buildlibrary ($libdir); echo $result."

\r\n"; ?>
"; file_put_contents ($path."index.php", $i); } else { return "$errno: $errstr. Build aborted. \r\n"; } } $path .= "/"; } file_put_contents ($path."TS.sdb", time()); foreach ($line as $f => $value) { $filename = $path.$f.".sdb"; file_put_contents ($filename, $line[$f]); } } Return "Library built successfully.\r\n"; } function getrequests ($studiohost, $studioport) { $command = "List requests\r\n"; $fp = @fsockopen("$studiohost", $studioport, $errno, $errstr, 10); //open connection if ($fp !== false) { fwrite ($fp, $command); $buffer = trim (fgets ($fp)); while (!empty ($buffer) && ($buffer != "OK")) { $line[] = $buffer; $buffer = trim (fgets ($fp)); } fclose ($fp); } else { return "ERROR $errno: $errstr\r\n"; } return $line; } function listrequests ($studiohost, $studioport) { $list = getrequests ($studiohost, $studioport); if (is_array ($list)) { $results_page = "\r\n". "\r\n". "\r\n". "\r\n". "\r\n". "\r\n"; $c = count($list); for ($i=0; $i<$c; $i++) { if (empty ($list[$i])) continue; list ($timestamp, $artist, $title) = explode ("|", $list[$i]); $results_page .= "\r\n"; } $results_page .= "
Request TimeArtistTitle
$timestamp$artist$title
\r\n"; } else if (empty ($list)) { $results_page = "There are no pending requests. \r\n"; } else { return $list; } return $results_page; } function getrandomartists ($howmany) { global $studiohost, $studioport; // Send search command $command = "Search=*\r\n"; $fp = @fsockopen("$studiohost", $studioport, $errno, $errstr, 10); //open connection if ($fp !== false) { fwrite ($fp, $command); $buffer = trim (fgets ($fp)); while (!empty ($buffer) && ($buffer != "Not Found")) { $line[] = $buffer; $buffer = trim (fgets ($fp)); } fclose ($fp); } else { return "$errno: $errstr\r\n"; } if (is_array ($line)) { $artists = array (); for ($n=0; $n<$howmany; $n++) { do { $i = mt_rand (0, count($line)-1); list ($artist, $title, $filename) = explode ("|", $line[$i]); } while (in_array ($artist, $artists) || empty ($artist)); $artists[] = $artist; } return $artists; } } function getartistlinks ($howmany) { global $script; $artists = getrandomartists ($howmany); if (is_array ($artists)) { foreach ($artists as $artist) { $link[] = "".$artist.""; } } return $link; } function timediff ($timestamp, $detailed=false, $n = 0){ $now = time(); #If the difference is positive "ago" - negative "away" ($timestamp >= $now) ? $action = 'away' : $action = 'ago'; $diff = ($action == 'away' ? $timestamp - $now : $now - $timestamp); # Set the periods of time $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade"); $lengths = array(1, 60, 3600, 86400, 604800, 2630880, 31570560, 315705600); # Go from decades backwards to seconds $i = sizeof($lengths) - 1;# Size of the lengths / periods in case you change them $time = "";# The string we will hold our times in while ($i >= $n) { if($diff > $lengths[$i-1]) {# if the difference is greater than the length we are checking... continue $val = floor($diff / $lengths[$i-1]);# 65 / 60 = 1.That means one minute.130 / 60 = 2. Two minutes.. etc $time .= $val ." ". $periods[$i-1].($val > 1 ? 's ' : ' ');# The value, then the name associated, then add 's' if plural $diff -= ($val * $lengths[$i-1]);# subtract the values we just used from the overall diff so we can find the rest of the information if(!$detailed) { $i = 0; }# if detailed is turn off (default) only show the first set found, else show all information } $i--; } # Basic error checking. if($time == "") { return "later"; } else { return "in ".rtrim ($time); } } ?>

Welcome To

Search for:

0) { $ts = @file_get_contents ($path."TS.sdb"); if ($ts > 0) $elapsed = time() - $ts; else $elapsed = $buildlib*3600; if ($elapsed >= ($buildlib*3600)) { echo "

Local library is being rebuilt. This may take some time.
\r\n"; flush(); $result = buildlibrary ($libdir); echo $result."

\r\n"; } } echo "

List songs by artist names beginning with "; echo "

\r\n"; for ($i = 0; $i < strlen ($string); $i++) { $l = substr ($string, $i, 1); echo "\r\n"; } echo "\r\n"; echo "
".$l."Others

\r\n"; ?>
Sorry, you are not allowed to use this request form. \r\n"; exit; } } // Get current count from cookie if (!isset ($_COOKIE["SPS1"])) { $day = time ()+86400; $value = $requestsperday.":".$day; $daycount = $requestsperday; setcookie ("SPS1", $value, $day); $errormsg = "Cookies must be enabled in your browser in order to use this request feature. \r\n"; } else { list ($daycount, $day) = explode (":", $_COOKIE["SPS1"]); } if (!isset ($_COOKIE["SPS2"])) { $hour = time ()+3600; $value = $requestsperhour.":".$hour; $hourcount = $requestsperhour; setcookie ("SPS2", $value, $hour); } else { list ($hourcount, $hour) = explode (":", $_COOKIE["SPS2"]); } $script = $_SERVER["SCRIPT_NAME"]; if (!empty ($libdir)) $path = $libdir."/"; $func = $_REQUEST["func"]; if ($func == "Send Your Request") { // Insert request // Validate request if (empty ($_POST["rq"])) { $errormsg .= "No request was selected. Please try again. \r\n"; $func = "Search"; } else if (($namefield == 2) && empty ($_POST["name"])) { $errormsg .= "Your name is required. Please try again. \r\n"; $func = "Search"; } else if (($locationfield == 2) && empty ($_POST["location"])) { $errormsg .= "Your location is required. Please try again. \r\n"; $func = "Search"; } else if (($daycount > 0) && ($hourcount > 0)) { $rq = rawurldecode ($_POST["rq"]); if (get_magic_quotes_gpc ()) $rq = stripslashes ($rq); $name = rawurldecode ($_POST["name"]); if (get_magic_quotes_gpc ()) $name = stripslashes ($name); $location = rawurldecode ($_POST["location"]); if (get_magic_quotes_gpc ()) $location = stripslashes ($location); if ($expire > 0) $exp = time()+($expire*86400); else $exp = 0; setcookie ("SPS3", "$name|$location", $exp); // Insert request $command = "Insert Request=".$rq."|".$_SERVER["REMOTE_ADDR"]; if ($namefield || $locationfield) $command .= "|".$name."|".$location; $command .= "\r\n"; $fp = @fsockopen("$studiohost", $studioport, $errno, $errstr, 10); //open connection if ($fp !== false) { fwrite ($fp, $command); $errormsg = fgets ($fp); fclose ($fp); if (stripos ($errormsg, "has been submitted") !== false) { $daycount -= 1; setcookie ("SPS1", "$daycount:$day", $day); $hourcount -= 1; setcookie ("SPS2", "$hourcount:$hour", $hour); } } else { $errormsg .= "$errno: $errstr\r\n"; } } else { // Request limit reached $errormsg = "Sorry, you've reached your request limit. Please try again "; if ($daycount == 0) $errormsg .= timediff ($day, 1, 2); else $errormsg .= timediff ($hour, 1, 2); $errormsg .= ".\r\n"; } } if ($func == "Search") { // Lookup request if (isset ($_COOKIE["SPS3"])) { list ($name, $location) = explode ("|", $_COOKIE["SPS3"]); } if (!empty ($_REQUEST["searchtext"])) { $searchtext = rawurldecode ($_REQUEST["searchtext"]); if (get_magic_quotes_gpc ()) $searchtext = stripslashes ($searchtext); // Send search command $command = "Search=*".$searchtext."*\r\n"; if (strpos ($searchtext, "*|") !== false) { $command = "Search=".$searchtext."*\r\n"; if ($buildlib != 0) { $f = $path.str_replace ("*|", "", $searchtext).".sdb"; $line = @file ($f, FILE_IGNORE_NEW_LINES); } } if (!is_array ($line)) { $fp = @fsockopen("$studiohost", $studioport, $errno, $errstr, 10); //open connection if ($fp !== false) { fwrite ($fp, $command); $buffer = trim (fgets ($fp)); while (!empty ($buffer) && ($buffer != "Not Found")) { $line[] = $buffer; $buffer = trim (fgets ($fp)); } fclose ($fp); } else { $errormsg .= "$errno: $errstr\r\n"; } } if (is_array ($line)) { $results_page = "\r\n". "\r\n". "\r\n". "\r\n". "\r\n". "\r\n"; for ($i=0; $i \r\n"; } } $body .= "

Searching for: ".str_replace ("*|", "", $searchtext)."

\r\n"; if (!empty ($results_page)) { $results_page .= "
SelectArtistTitle
$artist$title
\r\n"; $body .= "

Select the song you want to hear by clicking its radio button then click the submit button.

\r\n"; $body .= "

\r\n"; $body .= $results_page; if ($namefield || $locationfield) { $body .= "

"; $body .= "

\r\n"; if ($namefield) { $body .= "\r\n"; } if ($locationfield) { $body .= "\r\n"; } $body .= "
"; if ($namefield == 2) $body .= "*"; $body .= "Your Name:
"; if ($locationfield == 2) $body .= "*"; $body .= "Your Location:
\r\n"; } $body .= "

"; $body .= "\r\n"; $body .= "\r\n"; $body .= "\r\n"; $body .= "

\r\n"; } else { // No matches found $errormsg = "Sorry, no matches were found. \r\n"; } } } ?> <?php echo $sitename; ?> Requests \r\n"; ?>

Pending Requests

0) && ($hourcount > 0)) { ?>

Make A Request

You have requests remaining this hour, Type part of a song title or artist's name in the search box and click the search button.

Thank you for your requests. You've reached your limit for now. Please try again



Home