Ejemplo n.º 1
0
            $result = "fail";
        }
    }
}
if ($mydlink_num == "NULL" || $dlinkfootprint == "NULL") {
    $result = i18n("Unable to connect Mydlink.");
}
if ($result == "success") {
    $ret = do_post($post_str, $post_url, $withcookie);
    if ($ret == 0) {
        $result = read_result();
    } else {
        $result = $ret;
    }
    if ($action == $action_signin && $result == "success") {
        $cookie = read_cookie();
        if ($cookie == "NULL") {
            $withcookie = "";
        } else {
            $withcookie = "\r\nCookie: lang=en;" . $cookie;
        }
        if ($mydlink_num == "NULL" || $dlinkfootprint == "NULL") {
            $result = i18n("dlink number or foorprint not exist.");
        } else {
            //echo "num= ".$mydlink_num." foot= ". $dlinkfootprint;
            $ret = do_post($post_str_adddev, $post_url_adddev, $withcookie);
            if ($ret == 0) {
                $result = read_result();
                $add_success_ret = $mydlink_num . ":";
                //compare dlink_num only
                $ret = strstr($result, $add_success_ret);
Ejemplo n.º 2
0


<?php 
//check language setting. Propose switch
if (1 == 0) {
    $hval = get_hide();
}
//echo "hide: $hval";
if (1 == 0) {
    if ($hval != 1) {
        //never closed notice box
        if ($lang != "de") {
            //switch proposal only on english page
            $skip = 0;
            $cval = read_cookie("lang");
            $langIP = get_country();
            if ($langIP != "en") {
                // US default. Nothing to do
                if ($langIP != "") {
                    //only if we know where to go!
                    if ($langIP != "unset") {
                        //only if we know where to go!
                        //  if ($cval != $langIP) {  // first time visit, only propose in this case
                        //  if ($cval != "en") { // US market is default, no message
                        if (is_page()) {
                            if ($_SERVER["REQUEST_URI"] == "/") {
                                $posturlcom = "";
                                $posturlde = "";
                            } else {
                                $skip = 1;
Ejemplo n.º 3
0
function get_hide()
{
    //print "get region: ";
    global $wp_query;
    global $hide;
    //also check if language was defined -> no notification box!
    //$val = $wp_query->query_vars['lang'];
    //if ($val) return 1;
    $val = $wp_query->query_vars['hide'];
    $cval = read_cookie("hide");
    if ($val) {
        return 1;
    }
    return $cval;
}