include($_SERVER['DOCUMENT_ROOT']."/__includes/config.php"); include($_SERVER['DOCUMENT_ROOT']."/__langs/res.ru.php"); include($_SERVER['DOCUMENT_ROOT']."/__tool/common.php"); $url = urldecode($url); $url = $url && substr(strtolower($url), 0, 4) == 'http' ? $url : '/'; $url = str_replace('&', '&', $url); $url = str_replace('&', '&', $url); $url = trim($url); $html = false; if(strpos($HTTP_USER_AGENT, 'Mozilla') === 0 || strpos($HTTP_USER_AGENT, 'Opera') === 0) $html = true; $om = strpos($HTTP_USER_AGENT, "Opera Mini") > 0 ? true : false; $view_source_url = ''; //echo "========$url======"; if(strstr($HTTP_HOST,"wapplanet")) { $timer = 1; } else { $pattern = "/^http:\/\/(wap\.|www\.)?(([a-z0-9][a-z0-9\-]*[a-z0-9])\.(".str_replace('.', '\.', join('|',$config['domains'])).'))\/?([a-zA-Z0-9][a-zA-Z0-9_\-\.\/]*(\.wml|\.html|\.htm|\.xhtml|\.js|\.css|\.wmls|\.xml|\/)|)$/i'; if(preg_match($pattern, $url, $matches)) { // print_r($matches); $view_source_url = "http://wen.ru/source/?u=".$matches[2]."&f=".$matches[5].($html ? "&html=1" : ''); $timer = 5; } else { $timer = 1; } } $url = kill_bad_chars($url); $go_url = urlencode($url); $go_url = str_replace('%23', '#', $go_url); $go_url = str_replace('%26', '&', $go_url); $go_url = str_replace('%2F', '/', $go_url); $go_url = str_replace('%3A', ':', $go_url); $go_url = str_replace('%3B', ';', $go_url); $go_url = str_replace('%3D', '=', $go_url); $go_url = str_replace('%3F', '?', $go_url); if($html) { header("Content-type: text/html; charset=utf-8"); echo ''; echo '
'."\n"; if(!($om && $view_source_url)) echo ''; echo "\n";
}
echo $res['go'].': '.$url.''."\n";
if($view_source_url) {
// if($html)
// $view_source_url .= "&html=1";
echo "
".$res['view_source']."\n";
}
if($html)
echo "\n";
else
echo "\n