📄 shownews2.asp
字号:
<%
option explicit
dim PageName
PageName="shownews"%>
<!--#include file=conn.asp -->
<!--#include file="const.asp"-->
<!--#include file=function.asp -->
<%
dim newsID,Title,titleurl,about,Author,Original,AuthorR,OriginalR,UpdateTime,Content,hot,SpecialName,SmallClassName,click,image,username
dim ifclass,gburl,ifand
NewsID=request("NewsID")
sql="select * from News where checked=1 and NewsID=" & NewsID
rs.open sql,conn,1,1
titleurl=rs("titleurl")
BigClassName=rs("BigClassName")
SmallClassName=rs("SmallClassName")
Title=rs("Title")
about=trim(rs("about"))
Author=trim(rs("Author"))
if Author<>"" then AuthorR=" 作者:"
Original=trim(rs("Original"))
if Original<>"" then OriginalR=" 来源:"
image=rs("image")
UpdateTime=rs("UpdateTime")
content=rs("Content")
hot=rs("hot")
SpecialName=rs("SpecialName")
click=rs("click")
username=rs("username")
ifclass="SmallClassName='"&SmallClassName&"'"
rs.Close
dim ReaderLevel,UserLevel
sql="select ReaderLevel from SmallClass where BigClassName='"&BigClassName&"' and SmallClassName='"&SmallClassName&"'"
rs.open sql,conn,1,1
ReaderLevel=rs("ReaderLevel") '取得文章浏览等级
rs.close
if ReaderLevel<>0 then
if readfree=0 then '如果不允许非会员浏览
if (isnull(session("xpUser")) or isnull(session("xpPwd")) or session("xpUser")="" or session("xpPwd")="") and readFree=0 then
conn.close
set conn=nothing
Response.Redirect "userlogin.asp"
Response.End
end if
if not(isnull(session("xpUser")) or isnull(session("xpPwd")) or session("xpUser")="" or session("xpPwd")="") then
sql="select * from Users where UserName='"&Session("xpUser")&"' and PassWord='"&Session("xpPwd")&"'"
rs.Open sql,conn,1,3
if rs.eof then
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language=javascript>
history.back()
alert("对不起,会员帐号或密码错误!请重新登陆。")
</script>
<%
Response.End
elseif rs("UserLevel")<ReaderLevel and rs("UserLevel")<>7 and rs("UserLevel")<>8 and rs("UserLevel")<>9 then
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language=javascript>
history.back()
alert("你的等级不够,请继续努力!")
</script>
<%
Response.End
else
rs("readnews")=rs("readnews")+1
rs("UserPoint")=rs("UserPoint")+1
rs("LimitPoint")=rs("LimitPoint")+1
if rs("UserLevel")<>7 and rs("UserLevel")<>8 and rs("UserLevel")<>9 then
if int(rs("UserPoint"))>=int(point(rs("UserLevel")+1)) then rs("UserLevel")=rs("UserLevel")+1
end if
rs.Update
end if
rs.close
end if
end if
end if
conn.execute("update News Set Click=click+1 where NewsID=" & NewsID )
if titleurl="" or isnull(titleurl) then
sql="select * from News where username='"&username&"'"
rs.open sql,conn,1,1
dim InputCount
InputCount=rs.RecordCount
rs.Close
gburl="NewsID="&request("NewsID")
%>
<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="top4.asp"-->
<table border="0" style="border-collapse: collapse" width="760" cellspacing="0" cellpadding="0" bgcolor="<%=MainBColor%>" height="338">
<tr>
<%=OutTable("left")%>
<td align="left" valign="top" bgcolor="<%=CenterCColor%>">
<table border="0" cellpadding="0" cellspacing="0" width="98%" style="TABLE-LAYOUT: fixed" align="center">
<tr>
<td align=center valign="bottom" style="WORD-WRAP: break-word" colspan="2">
<br>
<br>
<b><font class=ReadNewsTitle><%=title%></font><br>
</b></td>
</tr>
<tr>
<td align=center colspan="2">
<hr width="100%" align="center" noshade size="1">
</td>
</tr>
<tr>
<td colspan="2" align=center class=NEWSREADME>发表时间:<%=updateTime%><%=originalR%><%=original%><%=authorR%><%=author%> 阅读<%=click%>次</td>
</tr>
<tr>
<td align="center" colspan="2">
<table border="0" cellspacing="0" cellpadding="0" align="center" style="TABLE-LAYOUT: fixed">
<tr>
<td height="40"> </td>
</tr>
<tr>
<td style="WORD-WRAP: break-word" Class=news>
<%Response.Write HtmlSelfEnCode(content,image)%>
</td>
</tr>
</table>
</td>
</tr>
<tr align="right">
<td colspan="2">
<p> </p>
<p>录入:<%=username%> [共 <%=InputCount%> 篇] <br>
<br>
</p>
</td>
</tr>
<tr>
<td colspan="2">
·上一条:<%movenews("-")%><br>
·下一条:<%movenews("+")%>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td valign="top">
<%aboutnews%>
</td>
<td valign="top">
<%thisspecial%>
</td>
</tr>
</table>
<%
if ShowGBook=1 then
dim gbtitle,ifgburl,add
dim Totalcount,name,gbcontenta,gbcontent,lentotal,strWord,id,gburl1
dim thistitle,tcols,g
%>
<!--#include file=gbookshow.asp-->
<%end if%>
</td>
<%
InTable("right")%>
<!--右栏开始-->
<td width="160" align="right" valign="top" bgcolor="<%=RightBgColor%>">
<!--#include file=goodnews.asp-->
<!--#include file=hotimg.asp-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="<%=RightBColor%>" height="100%">
<tr>
<td bgcolor="<%=RightCColor%>" height="100%"> </td>
</tr>
</table>
<%=OutTable("right")%>
<!--右栏结束-->
</tr>
</table>
<%
else
set rs=nothing
conn.close
set conn=nothing
Response.Redirect titleurl
end if
function thisspecial
Response.Write "<table border='0' cellspacing='1' cellpadding='0' width='100%' align='center' bgcolor='"&CenterTColor&"'><tr><TD background=""images/hline.gif"" HEIGHT=""1""></TD></tr><tr><td width='100%' bgcolor='"&CenterTColor&"' height='18' Class=maintitle> 相关专题:<a Class=maintitle href='Special.asp?SpecialName="& specialname &"' target=_self>" & specialname &"</a></td></tr><tr><TD background=""images/hline.gif"" HEIGHT=""1""></TD></tr><tr><td bgcolor='"&CenterCColor&"'><table width='100%' border='0' cellspacing='5' cellpadding='0'><tr height=100><td width='100%' valign=top>"
sql="select top 5 "& NoContent &" from News where (checked=1 and NewsID<>" & NewsID & " and SpecialName='" & SpecialName & "') order by NewsID DESC"
rs.open sql,conn,1,1
if SpecialName="无" or rs.EOF or rs.bof then
Response.Write " 尚无信息"
else
while not rs.EOF
Response.Write "· "
Response.Write showTitle("MainContentS",32)
Response.Write showImg
Response.Write showTime&"<BR>"
rs.MoveNext
wend
Response.Write "<div align='right'><a Class='MainMore' href='Special.asp?SpecialName="& specialname &"' target=_self>>>更多</a> </div>"
end if
Response.write "</td></tr></table></td></tr></table>"
rs.Close
end function
function aboutnews
sql="select top 5 "&NoContent&" from news where checked=1 and about like '%" & about & "%' and title not like '" & title & "' order by newsid desc"
rs.open sql,conn,1,1
Response.Write "<table border='0' cellspacing='1' cellpadding='0' width='100%' align='center' bgcolor='"&CenterTColor&"'><tr><TD background=""images/hline.gif"" HEIGHT=""1""></TD></tr><tr><td width='100%' bgcolor='"&CenterTColor&"' height='18' class=maintitle> 相关信息:"&about&"</td></tr><tr><TD background=""images/hline.gif"" HEIGHT=""1""></TD></tr><tr><td bgcolor='"&CenterCColor&"'><table width='100%' border='0' cellspacing='5' cellpadding='0'><tr height=100><td valign=top>"
if not rs.EOF then
do while not rs.eof
Response.write shownewf
Response.write showTitle("MainContentS",32)
Response.write showImg
Response.write showTime
rs.movenext
loop
Response.Write "<div align='right'><a Class='MainMore' href='showsearch.asp?keyword=" & about &"' target=_self>>>更多</a> </div>"
else
Response.Write " 尚无信息"
end if
Response.Write "</td></tr></table></td></tr></table>"
rs.close
end function
function movenews(strmove)
sql="select "& NoContent &" from News where checked=1 and NewsID=" & NewsID &strmove&"1"
rs.open sql,conn,1,1
if not rs.EOF then
Response.write showTitle("MainContentS",70)
Response.write showImg
Response.write showTime
else
Response.write "已经没有了"
end if
rs.close
end function
set rs=nothing%>
<!--#include file="copyright.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -