<?php include("sql/conn.php"); 
session_start(); //开着身份验证，以后写

if($_GET['ys'])
{
$ys = 30*($_GET['ys']-1);
}	 
else
{
$ys = 0;
}

$_GET['gjc'] = str_replace(" ","",$_GET['gjc']);
$_GET['gjc'] = str_replace("<","",$_GET['gjc']);
$_GET['gjc'] = str_replace(">","",$_GET['gjc']);


?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><?php echo $_GET['gjc']; ?>|<?php include("adm/all/gjz.txt"); ?> 页游快讯</title>
<meta name="description" content="<?php echo $_GET['gjc']; ?>|<?php include("adm/all/description.txt"); ?> 页游快讯" />
<meta name="keywords" content="<?php echo $_GET['gjc']; ?>|<?php include("adm/all/gjz.txt"); ?> 页游快讯" />
<link  href="css/css<?php include("adm/all/css.txt"); ?>.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
#dh27 {
	width: 958px;
	overflow: hidden;

}
#dh28 {
	width: 688px;
	overflow: hidden;
	float: left;
	border-right-width: 1px;
	border-right-style: solid;
	border-right-color: #00FFFF;
	font-size: 16px;
	text-align: left;
}
#dh29 {
	width: 258px;
	overflow: hidden;
	float: right;
	white-space:nowrap;
	text-align: left;
}
-->
</style>



</head>

<?php
////////////////////////////////////////////////////////////////////////
$file = fopen("adm/tm.txt", "r") or exit("Unable to open file!");
while(!feof($file))
  {
$hang = fgets($file);
$res=explode("%%",$hang,20);
  }/////获得表格表头
///////////////////////////////////////////////////////////////////////////
?>


<?PHP
include("han2.php");
////////////////////////显示当前时间的函数
function gtime($tt)
  {
$hour = substr(date("H:i:s",$tt),0,2);
$hour=(int)$hour; 
$dl = array('【通宵推荐】','【通宵推荐】','【通宵推荐】','凌晨3点整','凌晨4点整','早晨5点整','早晨6点整','早晨7点整','上午8点整','上午9点整','上午10点整','中午11点整','中午12点整','下午13点整','下午14点整','下午15点整','下午16点整','晚上17点整','晚上18点整','晚上19点整','晚上20点整','晚上21点整','晚上22点整','【通宵推荐】');
$tt = date("m月d日",$tt);
return $tt;
  }
/////////////////////////
?>

<body >
<div id="top">
<?php include("user.php");  ?>
</div>
<?php include("gh.php");  ?>

<div align="center">
<?php include("logo.php");  ?>

<div id="dh" ><?php 
 if(file_exists("dh1.php"))
 {
include("dh1.php"); 
 }
 else
 {
include("action/dh1.php"); 
 }
?></div>

</div>

<div class="clear"></div>

<?php include("ad/ad3.txt"); ?>


<div class="clear"></div>


<div align="center">
<div id="nr">



<div class="RoundedCorner">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>

<div id="dh27">


<div id="dh28">




<div id="dh3">

<?php 
 if(file_exists("topx.php"))
 {
include("topx.php"); 
 }
 else
 {
include("action/topx.php"); 
 }
?>

</div>

<div class="clear"></div>







<br><h3 align="center">相关[<?php echo $_GET['gjc']; ?>]文章列表</h3><hr />
<?php
include("adm/zysj.php");

$result = mysql_query("SELECT * FROM wz where fl = 'web1' and nr like '%".$_GET['gjc']."%' ORDER BY id DESC LIMIT ".$ys.",".$wzs);
while($row = mysql_fetch_array($result))
{
echo "<p>◆<a href=wz_". $row['id']. ".html target=_blank >";

$tm = mysubstr($row['tm'],0,32); 

//////////////////循环替换////////////////////
$result8 = mysql_query("SELECT * FROM ck");
while($row8 = mysql_fetch_array($result8))
  {
$tm = str_replace($row8['old'],$row8['new'],$tm);
  }
//////////////////循环替换////////////////////
echo $tm;

echo "</a>";
echo "........";
  $tim = date("m-d-H:i:s",$row['time']);
echo  $tim;
echo "</p>";
}
?>

<br /><hr>


<?php 

$result = mysql_query("SELECT * FROM wz where fl = 'web1' and nr like '%".$_GET['gjc']."%' ");//查看总留言数并分页
$num = mysql_num_rows($result);
echo "符合条件的文章总数".$num." 个";
$ys = ceil($num/$wzs);

if($ys>10){
$ys=10;
}

for ($i=1; $i<=$ys; $i++)
{
if ($_GET['ys']!=$i)
echo "〖<a href=?ys=".$i.">".$i."</a>〗";
else
echo "<strong>[".$i."]</strong>";

}

echo "</p>";

?> 


</div>

<div id="dh29">

<?php 
 if(file_exists("right.php"))
 {
include("right.php"); 
 }
 else
 {
include("action/right.php"); 
 }
?>

</div>



</div>

<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
</div>



</div></div>

<div class="clear"></div>


<?php 
 if(file_exists("foot.php"))
 {
include("foot.php"); 
 }
 else
 {
include("action/foot.php"); 
 }
?>
</body>
