<?php
header("Content-Type:text/html;charset=gb2312");
session_start();?>
<?php
require ("inc/function.php");
$site=$_GET["site"];
axing_connect();
$sql="select * from base where url='$site'";
$result=mysql_query($sql);
if (mysql_num_rows($result))
{
$myrow=mysql_fetch_assoc($result);


//ip
date_default_timezone_set('PRC');
require('function.php');

$url = $myrow[url];

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);
	}
}

?>

<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>
<title><?echo(FSubstr(($myrow[title]),0,10))?> - <?echo($myrow[url])?> - 内容预览 - <?echo($webtitle)?></title>
<style>
.style6{
width: 700px;
margin: 0px auto;
text-align:left;
margin-bottom:20px;
margin-top:50px;
border:1px solid #92B0DD;
background-color: #FFFFFf
}
.style6 h5{
margin: 1px;
padding:3px;
background-color: #E2EAF8;
height: 24px;
}
</style>
</head>
<body style="text-align:center">
<div class="style6"><h5 style="width:108%"><?echo(FSubstr(($myrow[title]),0,40))?> 内容预览</h5>
<ul style="font-size:14px;list-style-type:none; margin:20px">
<li style="border-bottom:#92B0DD 1px solid"><img src="http://open.thumbshots.org/image.aspx?url=<?echo($myrow[url]);?>" border="0px" style="width:250px;height:200px"></li>
<li style="border-bottom:#92B0DD 1px solid">此网站已经收录！</li>
<li style="border-bottom:#92B0DD 1px solid">由： <?php echo($webtitle)?> [<?php echo($weburl)?>] 提供免费收录。</li>
<li style="border-bottom:#92B0DD 1px solid">标题：<?php if ($myrow[title]==''){?><?echo(FSubstr($myrow[url],0,24));?><?php } else {?><?echo(FSubstr($myrow[title],0,12));?><?php }?>...</li>
<li style="border-bottom:#92B0DD 1px solid">网址：<a href="<?echo($myrow[url])?>" target="_blank"><?echo($myrow[url])?></a></li>
<li style="border-bottom:#92B0DD 1px solid">网站关键词：<?echo($myrow[keywords])?></li>
<li style="border-bottom:#92B0DD 1px solid">网站描述：<?echo($myrow[description])?></li>
<li style="border-bottom:#92B0DD 1px solid">内容预览：<?echo($myrow[content])?>...</li>
<li style="border-bottom:#92B0DD 1px solid">加入时间：<?echo($myrow[addtime])?></li>
<li style="border-bottom:#92B0DD 1px solid">更新时间：<?echo($myrow[updatetime])?></li>
<li style="border-bottom:#92B0DD 1px solid">最近点入：<?echo($myrow[cometime])?></li>
<li style="border-bottom:#92B0DD 1px solid">网站流量：<img src='http://traffic.alexa.com/graph?w=500&h=280&r=3m&y=r&u=<?echo($myrow[url]);?>' style='width:500px;height:280px;border:solid 1px #ccc' onerror="this.style.display='none'"></li>
<li style="border-bottom:#92B0DD 1px solid">热点标签：<?php
axing_connect();
$sql="select * from tag where able='yes' order  by count desc limit 50";
$result=mysql_query($sql);
while ($myrow=mysql_fetch_assoc($result))
{
?>
<a href="search.php?tag=<?echo(urlencode($myrow[tag]));?>" target="_blank"><?echo($myrow[tag]);?></a>
<?PHP
}
mysql_free_result($result);
mysql_close();
?></li>
<li style="border-bottom:#92B0DD 1px solid">网站信息：
  <div id="mainer">
      <div class="ip_status"><div class="ip_status_left"><span id="ip_info"></span> - <a href="http:///baidu/?url=<?php echo $url;?>" target="_blank"></a> - <a href="http:///whois/?url=<?php echo $url;?>" target="_blank"></a></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 width="80%">&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>　　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>
      </table>
    </div>

</li>
</ul>
</div>

</body>
<?php
}
else
{
echo "对不起，该网站还未通过审核或已经被管理员删除，<a href='index.php'>点此返回</a>网站首页！";
}
?>