<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"--> 
<%
response.Charset="UTF-8"
dim id,title,content,pubdate
id=request.QueryString("id")
if(id<>"") then
	id=Clng(id)
else
	response.Write("error")
	response.End()
end if
set rs=server.CreateObject("adodb.recordset") 
rs.open "select Title,ModiTime,Content from news where id="&id,conn,3,1
if not rs.eof then
	title=rs(0)
	pubdate=rs(1)
	content=FormatText(rs(2))
end if
rs.close
set rs=nothing
%>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta name="viewport" content="width=device-width; initial-scale=1.3; minimum-scale=1.0; maximum-scale=2.0"/>
<meta name="MobileOptimized" content="240"/>
<title><%=title%>-<%=SiteName%></title>
<link href="css/index.css" rel="stylesheet" type="text/css" />
</head>
 
<body>  
<div class="wrap">
<div class="logo"><img src="images/logo.jpg" width="200" /></div>
<div class="t1"><img src="images/ent-arrow.gif" /><a href="index.asp">首页 </a>&gt;<a href="news.asp?id=<%=id%>"> <%=ctitle%></a></div>
<div class="s"><%=title%></div>
<div class="gt"><%=pubdate%></div>
<div class="msg"><%=content%></div>
<div class="s">
<form action="news.asp" method="get">
  关键字
  <input name="key" class="i1" id="key" value="<%=key%>" size="12" />
<input type="submit" value="查询" />
</form>
<p></p>
</div>
<div class="b3"><a href="news.asp?id=3">国内</a> | <a href="news.asp?id=4">国际</a> | <a href="news.asp?id=5">社会</a></div>
<div class="footer">
    <p><img src="images/9e440e80.gif" alt="" /> <a href="/"><%=SiteName%></a> </p>
    <p class="f1"><img src="images/ae9e8e3d.gif" alt="" />[<%=date()%>]</p>
</div>
</div>
</body>
</html>
<%
Function FormatText(s)
	dim content
	content=s
	content=replace(content,"</p>","##")
	content=replace(content,"</p>","##")
	content=replace(content,"<br>","##")	
	content=replace(content,"style","")
	content=replace(content,"width","")
	content=replace(content,"height","")
	content=RemoveHTML(content)
	content=replace(content,"##","<br>&nbsp;")
	FormatText=content
end function
Function RemoveHTML(strHTML) 
	if(len(strHTML)<=0) then
		exit Function
	end if
	Dim objRegExp, Match, Matches 
	Set objRegExp = New Regexp 	
	objRegExp.IgnoreCase = True 
	objRegExp.Global = True 
	'取闭合的<> 
	'objRegExp.Pattern = "<.+?>" 
	objRegExp.Pattern = "<.+?>" 
	'进行匹配 
	if strHTML<>"" then
		Set Matches = objRegExp.Execute(strHTML)
		For Each Match in Matches 
			strHtml=Replace(strHTML,Match.Value,"") 
		Next 
		RemoveHTML=strHTML 
	else
		RemoveHTML=strHTML
	end if
	Set objRegExp = Nothing 
End Function

call connclose()
%>