Esempio n. 1
0
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */
/** @require functions */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php";
/** @require config */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/config.inc.php";
if (isset($_GET["nowplaying"])) {
    // VLC contents supercedes file contents if enabled.
    $nowplaying = "";
    if (isset($settings["nowplaying_file"]) && $settings["nowplaying_file"] != "") {
        $nowplaying = file_get_contents($settings["nowplaying_file"]);
    }
    if (isset($settings["nowplaying_vlc_password"]) && $settings["nowplaying_vlc_password"] != "") {
        $username = "";
        $password = $settings["nowplaying_vlc_password"];
        $url = $settings["nowplaying_vlc_url"];
        $opts = array('http' => array('method' => "GET", 'header' => "Authorization: Basic " . base64_encode("{$username}:{$password}")));
        $context = stream_context_create($opts);
        if (!($result = file_get_contents($url, false, $context))) {
            $error = error_get_last();
            write_log("Error: " . $error["message"], __FILE__, __LINE__);
        }
        $json_data = json_decode($result, true);
        $nowplaying = $json_data["information"]["category"]["meta"]["now_playing"];
    }
    if (empty($nowplaying)) {
        $nowplaying = "Not playing";
    }
    echo tts_override($nowplaying);
    exit;
}
Esempio n. 2
0
    $rm_id = $arr["id"];
    $rm_text = $arr["text"];
    echo $rm_text;
    mysqli_query($GLOBALS["___mysqli_ston"], "\tUPDATE edtb_musings\n\t\t\t\t\t\t\t\t\t\t\t\tSET used = '1'\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE id = '" . $rm_id . "'\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1") or write_log(mysqli_error($GLOBALS["___mysqli_ston"]), __FILE__, __LINE__);
    is_null($___mysqli_res = mysqli_close($link)) ? false : $___mysqli_res;
    exit;
}
/*
*	current system short
*/
if (isset($_GET["sys_short"])) {
    $va_text .= "unknown";
    if (!empty($curSys["name"])) {
        $va_text = $curSys["name"];
    }
    echo tts_override($va_text);
    exit;
}
/*
*	distance to X
*/
if (isset($_GET["dist"])) {
    $to = $_GET["dist"];
    $distance = "";
    //write_log($to);
    $to = str_replace("system", "", $to);
    if (system_exists($to)) {
        if (valid_coordinates($curSys["x"], $curSys["y"], $curSys["z"])) {
            $res = mysqli_query($GLOBALS["___mysqli_ston"], "\tSELECT\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsqrt(pow((IFNULL(edtb_systems.x, user_systems_own.x)-(" . $curSys["x"] . ")),2)+pow((IFNULL(edtb_systems.y, user_systems_own.y)-(" . $curSys["y"] . ")),2)+pow((IFNULL(edtb_systems.z, user_systems_own.z)-(" . $curSys["z"] . ")),2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM edtb_systems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN user_systems_own ON edtb_systems.name = user_systems_own.name\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE edtb_systems.name = '" . mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $to) . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1") or write_log(mysqli_error($GLOBALS["___mysqli_ston"]), __FILE__, __LINE__);
            $arr = mysqli_fetch_assoc($res);
            $distance = number_format($arr["distance"], 1);
Esempio n. 3
0
    $arr = mysqli_fetch_assoc($res);
    $rm_id = $arr["id"];
    $rm_text = $arr["text"];
    echo $rm_text;
    mysqli_query($GLOBALS["___mysqli_ston"], "\tUPDATE edtb_musings\n\t\t\t\t\t\t\t\t\t\t\t\tSET used = '1'\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE id = '" . $rm_id . "'\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1") or write_log(mysqli_error($GLOBALS["___mysqli_ston"]), __FILE__, __LINE__);
    exit;
}
/**
 * current system short
 */
if (isset($_GET["sys_short"])) {
    $sys_short = "unknown";
    if (!empty($curSys["name"])) {
        $sys_short = $curSys["name"];
    }
    echo tts_override($sys_short);
    exit;
}
/**
 * distance to X
 */
if (isset($_GET["dist"])) {
    $to = $_GET["dist"];
    $distance = "";
    $to = str_replace("system", "", $to);
    if (!valid_coordinates($curSys["x"], $curSys["y"], $curSys["z"])) {
        $distance = "How can I calculate distances if I don't even know where we are?";
    } else {
        if (system_exists($to)) {
            $res = mysqli_query($GLOBALS["___mysqli_ston"], "\tSELECT\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsqrt(pow((IFNULL(edtb_systems.x, user_systems_own.x)-(" . $curSys["x"] . ")),2)+pow((IFNULL(edtb_systems.y, user_systems_own.y)-(" . $curSys["y"] . ")),2)+pow((IFNULL(edtb_systems.z, user_systems_own.z)-(" . $curSys["z"] . ")),2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM edtb_systems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN user_systems_own ON edtb_systems.name = user_systems_own.name\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE edtb_systems.name = '" . mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $to) . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1") or write_log(mysqli_error($GLOBALS["___mysqli_ston"]), __FILE__, __LINE__);
            $arr = mysqli_fetch_assoc($res);