<?php
date_default_timezone_set('PRC');
require('function.php');

$url = trim($_GET['url']);
$filename = 'data/'.date('Y-m').'.txt';


if (!empty($url)) {
	$url = getShortUrl($url);
	$domain = getDomain($url);
}

if (!file_exists($filename)) {
	$fp_1 = fopen($filename, "a");
	fwrite($fp_1, $url);
	fwrite($fp_1, "|");
	fclose($fp_1);
} else {
	$fp_2 = fopen($filename, "r");
	$file_content = fread($fp_2, filesize($filename));
	fclose($fp_2);

	$file_arr = explode('|', $file_content, -1);
	$count = count($file_arr);
	if (!in_array($url, $file_arr)) {
		$fp_3 = fopen($filename, "a");
		fwrite($fp_3, $url);
		fwrite($fp_3, "|");
		fclose($fp_3);
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
if (empty($url)) {
?>
<title>最近查询网站-114cb站长工具</title>
<meta name="Keywords" content="IP及地理位置，服务器状态，Alexa世界排名，Google PageRank，搜狗(Sogou)评级，网站收录，搜索引擎收录，反向链接" />
<meta name="Description" content="网站综合信息查询包括（IP及地理位置，服务器状态，Alexa世界排名，Google PageRank，搜狗(Sogou)评级，网站收录，搜索引擎收录，反向链接）。网站收录/反向链接查询结果包括：谷歌(Google)、百度(baidu)、必应(Bing)、雅虎(Yahoo)、搜搜(Soso)、搜狗(Sogou)、有道(Youdao)、AltaVista、AlltheWeb等搜索引擎）。" />
<?php
} else {
?>
<title><?php echo $url;?>的网站综合信息-114cb站长工具</title>
<meta name="Keywords" content="<?php echo $url;?>，IP及地理位置，服务器状态，Alexa世界排名，Google PageRank，搜狗(Sogou)评级，网站收录，搜索引擎收录，反向链接" />
<meta name="Description" content="<?php echo $url;?>的网站综合信息查询结果包括（IP及地理位置，服务器状态，Alexa世界排名，Google PageRank，搜狗(Sogou)评级，网站收录，搜索引擎收录，反向链接）。<?php echo $url;?>的网站收录/反向链接查询结果包括：谷歌(Google)、百度(baidu)、必应(Bing)、雅虎(Yahoo)、搜搜(Soso)、搜狗(Sogou)、有道(Youdao)、AltaVista、AlltheWeb等搜索引擎）。" />
<?php
}
?>
<meta name="Copyright" content="Powered By 114cb.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Pragma" content="no-cache" />
<script type="text/javascript" src="jquery.js"></script>
<?php
if (!empty($url)) {
?>
<script type="text/javascript">
$(document).ready(function() {
	var url = "<?php echo $url;?>";
	var domain = "<?php echo $domain?>";
	var queryurl = "query.php";
	var loading = "<img src='skin/loading.gif' align='absmiddle' />";
	
	var ip_info = function() {$("#ip_info").html(loading); $.ajax({type: "GET", url: queryurl, data: "type=ip&url=" + url, cache: false, success: function(data) {$("#ip_info").html(data);}});} ();
		
	var status_info = function() {$("#status_info").html(loading); $.ajax({type: "GET", url: queryurl, data: "type=status&url=" + url, cache: false, success: function(data) {$("#status_info").html(data);}});} ();
	
	var pr_info = function() {$("#pr_info").html(loading); $.ajax({type: "GET", url: queryurl, data: "type=pr&url=" + url, cache: false, success: function(data) {$("#pr_info").html(data);}});} ();
	
	var alexa_info = function() {$("#alexa_info").html(loading); $.ajax({type: "GET", url: queryurl, data: "type=alexa&url=" + url, cache: false, success: function(data) {$("#alexa_info").html(data);}});} ();
	
	var srank_info = function() {$("#srank_info").html(loading); $.ajax({type: "GET", url: queryurl, data: "type=srank&url=" + url, cache: false, success: function(data) {$("#srank_info").html(data);}});} ();
	
	var crank_info = function() {$("#crank_info").html(loading); $.ajax({type: "GET", url: queryurl, data: "type=crank&url=" + url, cache: false, success: function(data) {$("#crank_info").html(data);}});} ();
	
    $('#sobody tr[name]').each(function(i, n) {var name = $(n).attr('name'); if (name == '') {return false;} $(n).children('td[rel]').each(function(j, m) {var rel = $(m).attr('rel'); $.ajax({type: "GET", url: queryurl, data: "type=" + rel + "&name=" + name + "&url=" + url, success: function(data) {var num_box = $(m).find('a'); if(data.state != 1) {data.number = '-';} num_box.html(data);}});});});
	
})
</script>
<?php
}
?>
<link href="skin/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="topbar">网站导航：<a href="http://tool.114cb.com/" >首页</a> | <a href="http://www.114cb.com/" target="_blank">网址导航</a> | <a href="http://www.zzdag.com/" target="_blank">站长档案</a> | <a href="http://bbs.114cb.com/" target="_blank">同城社区</a></div>
<div id="container">
	<div id="header">
    	<div id="logo"></div>
    	<div id="search">
			<div id="adbox">
			</div>
        	<form name="myso" method="get" action="">
           	  <span style="font: bold 16px normal;">http://</span> <input name="url" id="url" type="text" size="55" class="sipt" value="<?php echo $url;?>" />
                <input type="submit" class="sbtn" value="查 询" />
              	<div class="tips">示例：<a href="javascript: void(0);" onclick="$('#url').attr('value', '114cb.com')">114cb.com</a>，<a href="javascript: void(0);" onclick="$('#url').attr('value', 'www.114cb.com')">www.114cb.com</a>，带"www"与不带"www"的查询结果不同</div>
                <div class="domain_info"><a href="domain.php?type=today" target="_blank">今天删除域名名单</a>　　<a href="domain.php?type=tomorrow" target="_blank">明天拟删除域名名单</a>　　<a href="domain.php?type=yesterday" target="_blank">昨天删除域名名单</a>　　<a href="domain.php?type=day_before_yesterday" target="_blank">前天删除域名名单</a>　　<a href="domain.php?type=day_after_tomorrow" target="_blank">后天拟删除域名名单</a></div>
          </form>
        </div>
	</div>
	<?php
    if (!empty($url)) {
	?>
	<div id="mainer">
      <div class="ip_status"><div class="ip_status_left"><span id="ip_info"></span></div><div class="ip_status_right"><span id="status_info"></span></div></div>
	  <table width="100%" border="0" cellspacing="1" cellpadding="0" class="table_bg mag" id="sobody">
        <tr class="syndata">
          <td colspan="10">&nbsp;访问：<a href="<?php echo getFullUrl($url);?>" target="_blank"><?php echo $url;?></a>　　国内排名：<span id="crank_info" class="red"></span> - <a href="http://www.chinarank.org.cn/overview/Info.do?url=<?php echo $url;?>" target="_blank">[官方数据]</a>　　搜狗评级：<span class="gre" id="srank_info"></span> / 100 - <a href="http://www.sogou.com/web?query=<?php echo $url;?>" target="_blank">[官方数据]</a>　　PageRank：<span class="gre" id="pr_info"></span>　　AlexaRank：<span class="gre" id="alexa_info"></span> - <a href="http://www.alexa.com/siteinfo/<?php echo $domain;?>" target="_blank">[官方数据]</a></td>
        </tr>
        <tr class="table_th">
          <td width="10%"><strong>&nbsp;搜索引擎</strong></td>
          <td width="10%"><a href="http://www.google.com.hk/" target="_blank"><img src="skin/google.gif" alt="Google" border="0" /></a></td>
          <td width="10%"><a href="http://www.baidu.com/" target="_blank"><img src="skin/baidu.gif" alt="百度" border="0" /></a></td>
          <td width="10%"><a href="http://cn.bing.com/" target="_blank"><img src="skin/bing.gif" alt="必应" border="0" /></a></td>
          <td width="10%"><a href="http://www.yahoo.cn/" target="_blank"><img src="skin/yahoo.gif" alt="雅虎" border="0" /></a></td>
          <td width="10%"><a href="http://www.soso.com/" target="_blank"><img src="skin/soso.gif" alt="搜搜" border="0" /></a></td>
          <td width="10%"><a href="http://www.sogou.com/" target="_blank"><img src="skin/sogou.gif" alt="搜狗" border="0" /></a></td>
          <td width="10%"><a href="http://www.youdao.com/" target="_blank"><img src="skin/youdao.gif" alt="有道" border="0" /></a></td>
          <td width="10%"><a href="http://www.altavista.com/" target="_blank"><img src="skin/altavista.gif" alt="AltaVista" border="0" /></a></td>
          <td width="10%"><a href="http://www.alltheweb.com/" target="_blank"><img src="skin/alltheweb.gif" alt="AlltheWeb" border="0" /></a></td>
        </tr>
        <tr name="site" class="table_tr">
          <td class="table_td"><strong>&nbsp;收录情况</strong></td>
          <td rel="google"><a href="http://www.google.com.hk/search?hl=zh-CN&amp;source=hp&amp;q=site:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="baidu"><a href="http://www.baidu.com/s?wd=site:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="bing"><a href="http://cn.bing.com/search?q=site:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="yahoo"><a href="http://sitemap.cn.yahoo.com/search?p=<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="soso"><a href="http://www.soso.com/q?w=site:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="sogou"><a href="http://www.sogou.com/web?query=site:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="youdao"><a href="http://www.youdao.com/search?q=site:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="altavista"><a href="http://www.altavista.com/web/results?itag=ody&kgs=0&kls=0&q=site:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="alltheweb"><a href="http://www.alltheweb.com/search?cat=web&cs=utf8&rys=0&itag=crv&_sb_lang=any&q=site:<?php echo $url;?>" target="_blank">-</a></td>
        </tr>
        <tr name="link" class="table_tr">
          <td class="table_td"><strong>&nbsp;反向链接</strong></td>
          <td rel="google"><a href="http://www.google.com.hk/search?hl=zh-CN&amp;source=hp&amp;q=link:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="baidu"><a href="http://www.baidu.com/s?wd=link:<?php echo $url;?>" target="_blank">-</a></td>
          <td>-</td>
          <td rel="yahoo"><a href="http://sitemap.cn.yahoo.com/search?bwm=i&amp;p=<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="soso"><a href="http://www.soso.com/q?w=link:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="sogou"><a href="http://www.sogou.com/web?query=link:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="youdao"><a href="http://www.youdao.com/search?q=link:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="altavista"><a href="http://www.altavista.com/web/results?itag=ody&kgs=0&kls=0&q=linkdomain:<?php echo $url;?>" target="_blank">-</a></td>
          <td rel="alltheweb"><a href="http://www.alltheweb.com/search?cat=web&cs=utf8&rys=0&itag=crv&_sb_lang=any&q=linkdomain:<?php echo $url;?>" target="_blank">-</a></td>
        </tr>
      </table>
    </div>
	<?php
	}
	?>
    <div id="history" class="border mag">
    	<h3 class="title">最近查询历史</h3>
        <ul class="urllist">
        <?php
		$history = array('www.baidu.com','www.qq.com','www.google.cn','www.music.com','www.sohu.com','www.114cb.com','www.yahoo.com','www.zzdag.com','bbs.114cb.com','www.163.com', 'www.114la.com', 'www.chinaz.com', 'www.admin5.com', 'tool.114cb.com','www.35dir.com','www.dedecms.com','www.cnzz.com','www.cnzz.cn','tool.cnzz.com','www.webmasterhome.cn','www.im286.com','www.chinahtml.com','www.zzchn.com','www.236z.com','www.linezing.com','www.phome.net','www.chinazhan.net','www.265.com','www.2345.com','www.hao123.com');
		if ($count < 40) {
			for ($j = 0; $j < count($history); $j++) {
				echo '<li><a href="?url='.$history[$j].'">'.$history[$j].'</a></li>';
			}
		} else {
				$rand_keys = array_rand($file_arr, 40);
				for ($i = 0; $i <= 39; $i++) {
					$file_line = $file_arr[$rand_keys[$i]];
					echo '<li><a href="?url='.$file_line.'" title="'.$file_line.'">'.$file_line.'</a></li>';
				}
		}
		unset($file_arr);
		?>
        </ul>
        <div class="clear"></div>
    </div>
	<div style="margin-top: 15px;">
	<div class="ip_status">文字广告：<a href="http://www.zzdag.com/" target="_blank">站长档案馆</a> | <a href="http://www.114cb.com/" target="_blank">网址导航</a> | <a href="http://bbs.114cb.com/" target="_blank">同城社区</a></div></div>
	
			<div style="margin-top: 15px;">
	<script type="text/javascript">/*760*75，创建于2010-12-14*/ var cpro_id = 'u314255';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
</div>

    <div id="footer" class="clear">Copyright &copy; 2006-2010 <a href="http://www.114cb.com/" target="_blank" style="color: #FF0000; font-weight: bold;">114CB.COM</a> All Rights Reserved<br /></div>
</div>
</body>
</html>