readnews.asp
来自「这是一个学生毕业时做的教务系统」· ASP 代码 · 共 244 行
ASP
244 行
<%@ Language=VBScript%>
<!--#include file=include/conn.asp -->
<!--#include file=include/function.asp -->
<%
NewsID=Request.QueryString("NewsID")
' request_BigClassID=Request.QueryString("BigClassID")
request_BigClassName=trim(Request.QueryString("BigClassName"))
' request_SmallClassID=Request.QueryString ("SmallClassID")
request_SmallClassName=trim(Request.QueryString("SmallClassName"))
set rs1=server.CreateObject("ADODB.RecordSet")
rs1.Source="select top 5 * from review where NewsID=" & NewsID & " order by reviewid desc"
rs1.Open rs1.Source,conn,1,1
conn.execute("update News Set Click=click+1 where NewsID=" & NewsID )
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from News where NewsID=" & NewsID
rs.Open rs.Source,conn,1,1
BigClassName=rs("BigClassName")
Title=trim(rs("Title"))
Author=trim(rs("Author"))
Original=trim(rs("Original"))
image=rs("image")
UpdateTime=trim(rs("UpdateTime"))
News_Content=trim(rs("Content"))
hot=rs("hot")
SpecialID=rs("SpecialID")
click=rs("click")
EnCode=trim(rs("EnCode"))
rs.Close
if request_BigClassName="" then
rs.Source="select * from BigClass where BigClassName=" & request_BigClassName
rs.Open rs.Source, conn,1,1
request_BigClassName=trim(rs("BigClassName"))
rs.Close
end if
if request_SmallClassName="" then
rs.Source="select * from SmallClass where SmallClassName=" & request_SmallClassName
rs.Open rs.Source, conn,1,1
request_SmallClassName=trim(rs("SmallClassName"))
rs.Close
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=title%>_<%=request_SmallClassName%>_<%=request_BigClassName%>_校园网</title>
<LINK href=news.css rel=stylesheet>
<link href="../css.css" rel="stylesheet" type="text/css">
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body background="../image/beijing2.jpg" topmargin="0">
<SCRIPT language=JavaScript>
var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",50);
}
function sc(){
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
</script>
<!--#include file=include/top.asp -->
<div align="center">
<table width="778" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5" background="images/bgimg_left.gif"> </td>
<td><table width="768" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#ffffff">
<tr>
<td> <table width="766" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="648" height="25"> <font color="#000000">当前位置:</font><font color="#FFFFFF"><a class=bai1 href="./" >首页</a><font color="#000000">>></font><a class=bai1 href="BigClass.asp?BigClassName=<%=request_BigClassName%>" ><%=request_BigClassName%></a><font color="#000000">>></font></font><%=request_SmallClassName%></td>
<td width="90" height="25"><font color="#000000">双击自动滚屏</font></td>
<td width="28"> </td>
</tr>
</table></td>
</tr>
</table>
<table border="1" style="border-collapse: collapse" bordercolor="#ffffff" width="768" align=center cellspacing="0" cellpadding="0" bgcolor="#F3F3F3">
<tr>
<td width="100%"> <table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="95%" align="middle" valign="top"> <table width="100%" border="0" bgcolor="#FFFFFF">
<tr>
<td width="69%" height="261" align="middle" valign="top">
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="100%" align=center style="font-size:14px" height="60"><font color="#000066"><b><%=title%></b></font></td>
</tr>
<tr>
<td width="100%" align=center style="font-size:9pt" height="50"><font color="#666666"><%=updateTime%> <%=original%> <%=author%> 阅读<%=click%>次</font></td>
</tr>
<tr>
<td width="100%" style="font-size:14px" align="center">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="25"> </td>
</tr>
<tr>
<td style="font-size:14px">
<%
select case EnCode
case "self"
Response.Write SelfEnCode(News_Content,image)
case "ubb"
Response.Write UBBEnCode(News_Content)
case "html"
Response.Write HtmlSelfEnCode(News_Content,image)
end select
%>
</td>
</tr>
</table></td>
</tr>
<tr>
<td width="100%" style="font-size:14px" height="25">
<div align="right">
<p> </p>
</div></td>
</tr>
<%
if SpecialID<>0 then
Response.Write "<tr><td width=100% ><hr size=1></td></tr><tr><td height=8></td></tr>"
Response.Write "<tr><td width=100% style=font-size:14px><B>[相关信息]</b></td></tr><tr><td height=8></td></tr>"
rs.Source="select top 10 NewsID,Title,BigClassName,SmallClassName,SpecialID,updatetime,click from News where (NewsID<>" & NewsID & " and SpecialID=" & SpecialID & ") order by NewsID DESC"
rs.Open,conn,1,1
if rs.EOF then
Response.Write "<tr><td width=100% >没有相关信息</td></tr>"
else
while not rs.EOF
Response.Write "<tr><td width=100% > <img src=images/dian.gif> <a class=bai1 target=_top href=ReadNews.asp?NewsID=" & rs("NewsID") & "&BigClassName=" & rs("BigClassName") & "&SmallClassName="& rs("SmallClassname") & "&SpecialID="& rs("SpecialID") & ">" & trim(rs("Title")) & "</a><font color=#666666>(" & trim(rs("UpdateTime")) &")[<font color=#ff0000>" & trim(rs("click")) & "</font>]</font></td></tr>"
rs.MoveNext
wend
Response.Write "<tr><td width=98% align=right height=18><a class=bai1 href=Special_News.asp?SpecialID=" & SpecialID &">[更多... ]</a></td></tr>"
end if
rs.Close
set rs=nothing
end if
if rs1.EOF then NoReview=1
Response.Write "<tr><td width=100% ><hr size=1></td></tr><tr><td height=8></td></tr>"
Response.Write "<tr><td width=100% style=font-size:14px><B>[相关评论]</b></td></tr><tr><td height=8></td></tr>"
%>
<tr>
<td width="100%">
<%
if NoReview then
Response.Write " 该信息当前没有评论"
end if
%>
</td>
</tr>
<%
if not NoReview then
while not rs1.EOF
author=server.HTMLEncode(trim(rs1("author")))
email=server.HTMLEncode(trim(rs1("email")))
content=trim(rs1("content"))
content=replace(content,"<","<")
content=replace(content,">",">")
content=replace(content,chr(13),"<BR>")
TrString="<tr><td width=100% bgcolor=D1E4FC>发表人:" & author & "<BR>发表人邮件:" & email & "</td></tr>"
TrString=TrString & "<tr><td> " & content & "</td></tr>"
Response.Write TrString
Response.Write "<tr><td width=100% ><hr size=1></td></tr><tr><td height=8></td></tr>"
rs1.MoveNext
wend
end if
rs1.Close
conn.close
set conn=nothing
%>
<tr>
<td width="100%" height="28"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table width="768" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td> <table width="768" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F7F7F7">
<tr>
<td width="20"> </td>
<td width="334" height="40" valign="middle" style="font-size:14px"><a class=bai1 href=review.asp?NewsID=<%=NewsID%> target=_blank ><img src="images/icon1.gif" width="18" height="18" border="0">
发表、查看更多关于该信息的评论</a></td>
<td style="font-size:14px" width="294" height="40"> </td>
<td style="font-size:14px" width="100"><img src="images/printer.gif" width="16" height="14"><a class=bai1 href="javascript:window.print()">
打印本页</a></td>
</tr>
<tr valign="top" bgcolor="#ffffff">
<td height="1" width="20"></td>
<td height="1" colspan="2"></td>
<td height="1" width="100"></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="5" background="images/bgimg_right.gif"> </td>
</tr>
</table>
</div>
<!--#include file=include/bottom.asp -->
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?