📄 readnews.asp
字号:
<%@ Language=VBScript%>
<!--#include file=include/conn.asp -->
<!--#include file=include/fun.asp -->
<!--#include file=include/config.asp -->
<%
NewsID=Request.QueryString("NewsID")
request_BigClassName=trim(Request.QueryString("BigClassName"))
request_SmallClassName=trim(Request.QueryString("SmallClassName"))
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"))
about=trim(rs("about"))
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%>_<%=redcaff%></title>
<LINK href=news.css rel=stylesheet>
</head><script language="JavaScript">
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</script>
<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>
<body topmargin="0">
<!--#include file=include/top2.asp -->
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="<%=border%>">
<tr valign="top">
<td height="1" width="1"></td>
<td height="1" width="748"></td>
<td height="1" width="1"></td>
</tr>
<tr valign="top">
<td bgcolor="<%=border%>" width="1"></td>
<td width="748" bgcolor="<%=t_m_bg%>"> </td>
<td bgcolor="<%=border%>" width="1"></td>
</tr>
<tr valign="top">
<td height="1" width="1" bgcolor="<%=border%>"></td>
<td height="1" width="748" bgcolor="<%=border%>"></td>
<td height="1" width="1" bgcolor="<%=border%>"></td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="<%=border%>">
<tr>
<td>
<table width="748" border="0" cellspacing="0" cellpadding="0" bgcolor="#A7CCFA" align="center">
<tr>
<td width="20"> </td>
<td width="530" height="20">当前位置:<a class=class href="./" >教育管理首页</a>>><a class=class href="BigClass.asp?BigClassName=<%=request_BigClassName%>" ><%=request_BigClassName%></a>>><%=request_SmallClassName%></td>
<td width="107" height="20">双击自动滚屏</td>
<td width="91"><input type="button" name="close" value="关闭窗口" onClick="window.close();return false;"></td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" style="border-collapse: collapse" width="750" align=center cellspacing="1" cellpadding="0" bgcolor="<%=border%>">
<tr>
<td width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="95%" align="middle" valign="top">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="69%" align="middle" valign="top" bgcolor="<%=m_main%>">
<table border="0" cellpadding="0" cellspacing="0" width="85%" align="center">
<tr>
<td width="100%" align=center style="font-size:18px" height="60" valign="bottom">
<font face="楷体_GB2312" size="5" color=red><b><%=title%><br>
</b></font> </td>
</tr>
<tr>
<td width="100%" align=center>
<hr width="100%" align="center" noshade size="1">
</td>
</tr>
<tr>
<td width="100%" align=center style="font-size:9pt"><%=updateTime%> <%=original%> <%=author%> 阅读<%=click%>次</td>
</tr>
<tr>
<td width="100%" align="center">
<table border="0" cellspacing="0" cellpadding="0" align="center" style="TABLE-LAYOUT: fixed">
<tr>
<td width="100%" align=center>
</td>
</tr>
<tr>
<%
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from News where NewsID=" & NewsID
rs.Open rs.source,conn,1,1
Title=trim(rs("Title"))
image=rs("image")
%>
<td style="WORD-WRAP: break-word"><%if rs("pos")="文章前" then%>
<% for i=1 to image
if DelectImageFile(NewsID,i)="" then
Response.Write ""
else
Response.Write "" &DelectImageFile(NewsID,i) & ""
end if
next
end if
%>
<font class=news>
<%
flashwidth="width=" & 300
imgwidth=""
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
%>
</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="25">
<div align="center">
<%if rs("pos")="文章后" then%>
<% for i=1 to image
if DelectImageFile(NewsID,i)="" then
Response.Write ""
else
Response.Write "" &DelectImageFile(NewsID,i) & "<br>"
end if
next
rs.close
set rs=nothing
%><%end if%>
</div>
</td>
</tr>
<%
if SpecialID<>0 then
Response.Write "<tr><td width=100% ><hr size=1></td></tr><tr><td height=8></td></tr>"
set rs4=server.CreateObject("ADODB.RecordSet")
rs4.Source="select * from special where SpecialID=" & SpecialID
rs4.Open,conn,1,1
Response.Write "<tr><td width=100% height=18><B>相关专题:</b><a class=lift href='Special_News.asp?SpecialID=" & SpecialID &"'>" & trim(rs4("specialname")) &"</a></td></tr>"
rs4.Close
set rs4=nothing
Response.Write "<tr><td width=100% height=18><B>专题信息:</b></td></tr><tr><td height=8></td></tr>"
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select top 5 * 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% height=18> <img src=images/goxp.gif> <a class=middle 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>" & rs("click") & "</font>]</font></td></tr>"
rs.MoveNext
wend
Response.Write "<tr><td width=98% align=right height=18><a class=lift href='Special_News.asp?SpecialID=" & SpecialID &"'>[更多... ]</a></td></tr>"
end if
rs.Close
set rs=nothing
end if
'------------------------------------------------------------------------------------------------------------------------------------
Response.Write "<tr><td width=100% ><hr size=1></td></tr><tr><td height=8></td></tr>"
Response.Write "<tr><td width=100% height=18><B>相关信息:</b></td></tr><tr><td height=8></td></tr>"
if about<>"" then
sql="select top 5 * from news where about like '%" & about & "%' and title not like '%" & title & "%' order by newsid desc"
set rs=conn.execute(sql)
do while not rs.eof
Response.write "<tr><td height=18> <img src=images/goxp.gif> <a class=middle 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>" & rs("click") & "</font>]</font></td></tr>"
rs.movenext
loop
Response.Write "<tr><td width=98% align=right height=18><a class=lift href='Result.asp?keyword=" & about &"'>[更多... ]</a></td></tr>"
else
Response.write "<tr><td width=100% > 没有相关信息</td></tr>"
end if
'rs.close
set rs=nothing
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
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% ><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>")
ContentLen=len(Content)
%>
<tr>
<td colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="D1E4FC">
<td colspan="2">发表人:<%=author%></td>
</tr>
<tr bgcolor="D1E4FC">
<td colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>发表人邮件:<a href='mailto:<%=email%>'><%=email%></a></td>
<td align="right">发表时间:<%=rs1("updatetime")%></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor=ffffff colspan="2">
<%
If ContentLen=<180 then
DisplayContent=Content
Response.Write " " & displaycontent
%>
</td>
</tr>
<%
else
%>
<tr>
<td height=20 bgcolor=ffffff colspan="2">
<%
DisplayContent=mid(Content,1,180)
Response.Write " " & displaycontent & "... <a href='readview.asp?reviewID=" & rs1("reviewID") &"&NewsID=" & newsID &"' target=_blank >详细内容</a>"
end if
%>
</td>
</tr>
</table>
<hr size="1" noshade>
</td>
</tr>
<%
rs1.MoveNext
wend
end if
rs1.Close
set rs1=nothing
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="750" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="<%=border%>">
<tr>
<td>
<table width="748" border="0" cellspacing="0" cellpadding="0" bgcolor="#A7CCFA" align="center">
<tr>
<td width="20"> </td>
<td width="255" height="20"><a href=review.asp?NewsID=<%=NewsID%> target=_blank class=bottom><img src="images/icon1.gif" width="18" height="18" border="0">
发表、查看更多关于该信息的评论</a></td>
<td width="214" height="20"><a href=send.asp?NewsID=<%=NewsID%> target=_blank class=bottom><img src="images/mail.gif" width="16" height="16" border="0">
将本信息发给好友</a></td>
<td width="168"><img src="images/printer.gif" width="16" height="14"><a href="javascript:window.print()" class=bottom>
打印本页</a></td>
<td width="91"><input type="button" name="close" value="关闭窗口" onClick="window.close();return false;"></td>
</tr>
<tr valign="top" bgcolor="<%=border%>">
<td height="1" width="20"></td>
<td height="1" colspan="2" width="469"></td>
<td height="1" width="259" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file=include/bottom.asp -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -