📄 x1.asp
字号:
<%
'功能:查看新闻
'参数:request("id")=int #新闻ID
%>
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<%
'response.buffer=false
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
news_id=request("id") '新闻ID
'------------------------------------------------
'------------------------------------------------取记录
'取要查看的新闻记录 (返回rs对象)
'
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select tbioaInfoStyle.newsort as boardname,tbioaInfomation.* from tbioaInfomation,tbioaInfoStyle where tbioaInfomation.newsort=tbioaInfoStyle.id and tbioaInfomation.id=" & news_id
rs.open sql,oConn,1,1
'------------------------------------------------加查看计数器
oConn.execute "update tbioaInfomation set Hits=hits+1 where id=" & news_id
'------------------------------------------------
'------------------------------------------------添加阅读人
set rs1=Server.CreateObject("ADODB.RecordSet")
sql_stmt="SELECT count(*) from tbioaInfoRead where userid=" & LoginID & " and newsid=" &rs("id")
rs1.open sql_stmt,oConn,1,1
if rs1(0)=0 then
oConn.execute "insert into tbioaInfoRead (newsid,userid,sdate) values (" & news_id & "," & LoginID & ",'" & now() & "')"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
</head>
<body topmargin="10" leftmargin="10">
<br>
<table width="100%" cellspacing="1" cellpadding="2" class="tab">
<tr>
<td width="100%" class="tdTop">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="tdTop">
<p align="left"><img border="0" src="../images/icon_title.gif" align="left">新闻内容</p>
</td>
<td width="60" class="tdTop">
<p align="left"><img border="0" src="../images/icon_return.gif" align="left">
<a href="JavaScript:window.close();" class="linkTop">关闭</a></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="td1" align="center">
<table width="90%">
<tr>
<td>
<div align="center"><b><%=rs("title")%></b><hr size="1" color="#000000"></div>
<%=rs("content")%><br><hr size="1" color="#000000">
<div align="right">
( <a href="news_list.asp?Style=<%=rs("newsort")%>"><%=rs("boardname")%></a>
发布日期:<%=formatdatetime(rs("newsdate"),1)%> 浏览次数:<%=rs("hits")%> 次 )
</div>
<hr size="1" color="#000000">
已阅人:<br>
<%
set rs1=Server.CreateObject("ADODB.RecordSet")
sql="select * from tbioaInfoRead where newsid=" & news_id
rs1.open sql,oConn,1,1
do while not rs1.eof
response.write GetUserName(rs1("userid"))&"("&year(rs1("sdate"))&"-"&month(rs1("sdate"))&"-"&day(rs1("sdate"))&") "
rs1.movenext
loop
%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="tdbottom"></td>
</tr>
</table>
</body>
</html>
<%'释放对象变量
rs.close
oConn.close
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -