select_db($database) or OnError(0,"MYSQL Query in updater program. Could not select mysql database \"$database.\" Please check config file for permissions", __LINE__,__FILE__,0,1); $sqlquery = "SELECT * from `$lwbstatsdb`.`tune-in_data` WHERE servernum=$stream"; $results = $lwbdb->query($sqlquery) or OnError(0,"Error with the MYSQL Query in updater program. It could not do select. The query was: $sqlquery\r\nThe error was:".$lwbdb->error."\r\n",__LINE__,__FILE__,0,1); $row = $results->fetch_assoc(); /*$linkarr = array(); while ($resultsarr = $resultsid->fetch_row()) { $servernum = $resultsarr[0]; $linkarr[$servernum] = $resultsarr[3]; }*/ $link = trim($row["streamlink"]); } else { $link = $stream; } header("Expires: Mon, 26 Jul 2001 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 header("Cache-control: private"); if ($type == "pls") { header("Content-Type: audio/scpls"); header("Content-Disposition: inline; filename=listen.pls"); echo "[playlist]\r\nNumberOfEntries=1\r\nFile1=$link\r\n"; } elseif ($type=="asx") { header("Content-Type: video/x-ms-asf"); header("Content-Disposition: attachment; filename=listen.asx"); echo "\r\n\r\n\r\n\r\n"; echo "\r\n\r\n\r\n\r\n\r\n"; echo "\r\n\r\n\r\n\r\n"; echo "\r\n\r\n\r\n\r\n"; echo "\r\n\r\n\r\n"; } elseif ($type == "ram") { header("Content-Type: audio/x-pn-realaudio"); header("Content-Disposition: attachment; filename=listen.ram"); echo $link; } elseif ($type == "vlc") { header("Location: $link"); } ?>