📄 showannounce.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/char.asp" -->
<!-- #include file="inc/const.asp" -->
<!--#include file="inc/code.asp"-->
<!--#include file="inc/stats.asp"-->
<!--#include file="inc/grade.asp"-->
<!--#include file="inc/badwords.asp"-->
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0" CHARSET="GB2312">
<title><%=ForumName%>--浏览贴子</title>
<link rel="stylesheet" type="text/css" href="forum.css">
<script language="javascript">
function popwin3(path)
{ window.open(path,"","height=300,width=450,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
</head>
<!--#include file="inc/theme.asp"--><body bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin="0">
<br>
<%
dim AnnounceID
dim RootID
dim BoardID
dim cname
dim rs
dim sql
dim FoundErr
dim ErrMsg,con
dim boardtype
FoundError=false
if request("boardid")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定论坛版面。"
elseif not isInteger(request("boardid")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的版面参数。"
else
boardid=request("boardid")
end if
if request("id")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
elseif not isInteger(request("id")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
else
AnnounceID=request("id")
end if
if request("RootID")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
elseif not isInteger(request("RootID")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
else
RootID=request("RootID")
end if
if founderr=true then
call error()
else
cname=Session.Contents("UserName")
set rs=server.createobject("adodb.recordset")
sql="update bbs1 set hits=hits+1 where announceID="&AnnounceID
rs.open sql,conn,3,3
sql="select bbs1.username,bbs1.topic,bbs1.body,bbs1.dateandtime,bbs1.layer,bbs1.orders,bbs1.parentid,bbs1.ip,bbs1.Expression,bbs1.signflag,[user].useremail,[user].homepage,[user].oicq,[user].sign,[user].article,[user].userclass,[user].face,[user].adddate,[user].width,[user].height,board.boardtype from bbs1,[user],board where bbs1.username=[user].username and board.boardID="&BoardID&" and bbs1.boardid=board.boardid and bbs1.AnnounceID="&AnnounceID
rs.open sql,conn,1,1
if err.number<>0 then
Errmsg=Errmsg+"<br>"+"<li>数据库操作失败:"&err.description
founderror=true
else
if rs.eof and rs.bof then
Errmsg=Errmsg+"<br>"+"<li>该贴子的内容找不到,或者该论坛没有此帖子"
founderror=true
else
%>
<TABLE border=0 width="95%" align=center>
<TBODY>
<TR>
<TD vAlign=top width=30%><a href="<%=HostURL%>"><img border="0" src="<%=logo%>"></a></TD>
<TD valign=middle align=top>
<img src="<%=picurl%>closedfold.gif" border=0> <a href="index.asp"><%=ForumName%></a><br>
<img src="<%=picurl%>bar.gif" border=0 width=15 height=15><img src="<%=picurl%>closedfold.gif" border=0> <a href="list.asp?boardid=<%=boardid%>&skin=<%=request("skin")%>"><%=rs("boardtype")%></a>
<br>
<img src="<%=picurl%>bar.gif" border=0 width=15 height=15><img src="<%=picurl%>openfold.gif" border=0> <%=htmlencode(rs("Topic"))%>
</TD></TR></TBODY></TABLE>
<br>
<table cellpadding=1 cellspacing=0 border=0 width="95%" align=center>
<tr>
<td align=center width=2 valign=middle> </td>
<td align=left width=130 valign=bottom> <a href="announce.asp?boardid=<%=boardid%>&skin=<%=request("skin")%>"><img src="<%=picurl%>newthread.gif" border="0" alt="发表一个新主题" width=106 height=23></a>
</td>
<td valign=bottom align=left width=90> <img src="<%=picurl%>printpage.gif" border=0 width=16 height=16 alt="显示可打印的版本"> <a href="printpage.asp?boardid=<%=boardid%>&rootid=<%=rootid%>&id=<%=announceid%>">文字版本</a>
</td>
<td valign=bottom align=left width=90> <img src="<%=picurl%>pag.gif" border=0 width=16 height=16 alt="把本贴打包邮递"> <a href="javascript:openScript('pag.asp?boardid=<%=boardid%>&rootid=<%=rootid%>&id=<%=announceid%>',350,180)">打包邮递</a>
</td>
<td valign=bottom align=left width=100>
<IMG SRC="<%=picurl%>fav_add.gif" BORDER="0" width=15 height=15 alt="把本贴加入论坛收藏夹"> <a href="favadd.asp?boardid=<%=boardid%>&rootid=<%=rootid%>&id=<%=announceid%>">加入收藏夹</a>
</td>
<td valign=bottom align=left width=100>
<img src="<%=picurl%>emailtofriend.gif" border=0 width=16 height=16 alt="发送本页面给朋友"> <a href="sendpage.asp?boardid=<%=boardid%>&rootid=<%=rootid%>&id=<%=announceid%>">发送给朋友</a>
</td>
<td align=center valign=bottom width="94"><img src="PIC/quote.gif" width="16" height="14" alt="返回到上页..."><a href="javascript:history.go(-1)">返回到上页</a></td>
<td align=right valign=bottom width=97><a href="javascript:this.location.reload()"><img src="<%=picurl%>refresh.gif" border=0 alt="刷新本主题" width=38 height=12></a>
</td>
<td align=center width=2 valign=middle>
</td>
</tr>
</table>
<br>
<table width="95%" border='0' cellspacing='1' cellpadding='2' align='center' bgcolor='#FF8000'>
<tr bgcolor='#FFFFFF'>
<td width=20% valign=top>
<img src=<%=rs("face")%> width=<%=rs("width")%> height=<%=rs("height")%>><br>
<%=htmlencode(rs("username"))%>
<br>
<%
if rs("userclass")=user_level1 then response.write " <img src="&picurl&""&level1_pic&"><br>"
if rs("userclass")=user_level2 then response.write " <img src="&picurl&""&level2_pic&"><br>"
if rs("userclass")=user_level3 then response.write " <img src="&picurl&""&level3_pic&"><br>"
if rs("userclass")=user_level4 then response.write " <img src="&picurl&""&level4_pic&"><br>"
if rs("userclass")=user_level5 then response.write " <img src="&picurl&""&level5_pic&"><br>"
if rs("userclass")=user_level6 then response.write " <img src="&picurl&""&level6_pic&"><br>"
if rs("userclass")=user_level7 then response.write " <img src="&picurl&""&level7_pic&"><br>"
if rs("userclass")=user_level8 then response.write " <img src="&picurl&""&level8_pic&"><br>"
if rs("userclass")=user_level9 then response.write " <img src="&picurl&""&level9_pic&"><br>"
%>
用户等级:<%=rs("userclass")%><br>
发表文章:<%=rs("article")%><br>
注册时间:<br> <%=rs("adddate")%><br>
</td>
<td width=80% valign=top bgcolor="#FFFFFF"> <a href="javascript:openScript('messanger.asp?action=new&touser=<%=HTMLEncode(rs("username"))%>',420,320)"><img src="<%=picurl%>message.gif" border=0 width=16 height=16 alt="给<%=HTMLEncode(rs("username"))%>发送一个短消息">短消息</a>
<a href="javascript:openScript('dispuser.asp?name=<%=HTMLEncode(rs("username"))%>',350,300)"><img src="<%=picurl%>profile.gif" border=0 width=16 height=16 alt="查看admin的个人资料">查看</a>
<%if rs("useremail")<>"" then%>
<A href="mailto:<%=htmlencode(rs("useremail"))%>"><IMG alt="点击这里发送电邮给<%=HTMLEncode(rs("username"))%>" border=0 src="<%=picurl%>email.gif">邮件</A>
<%end if%>
<%if rs("homepage")<>"" then%>
<A href="<%=htmlencode(rs("homepage"))%>" target=_blank><IMG alt="访问<%=HTMLEncode(rs("username"))%>的主页" border=0 src="<%=picurl%>homepage.gif">主页</A>
<%end if%>
<%if rs("oicq")<>"" then%>
<a href='http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=htmlencode(rs("oicq"))%>' target=_blank><img src='<%=picurl%>oicq.gif' alt='<%=HTMLEncode(rs("username"))%>的OICQ状态和号码:<%=htmlencode(rs("oicq"))%>' border=0 width=16 height=16'>OICQ</a>
<%end if%>
<a href="showannounce.asp?boardid=<%=boardid%>&rootid=<%=rootid%>&id=<%=announceid%>&reply=true&skin=<%=request("skin")%>"><img src="<%=picurl%>reply.gif" border=0 width=16 height=16 alt="引用回复这个贴子">引用回复</a> <a href="#发表贴子"><img src="<%=picurl%>replynow.gif" border="0" alt="回复贴子" width=16 height=16>直接回复</a>
<a href='queryResult.asp?type=7&name=<%=htmlencode(rs("username"))%>'><img src='<%=picurl%>find2.gif' border=0 width=14 height=14 alt='搜索<%=htmlencode(rs("username"))%>发表过的所有文章'>搜索</a>
<hr size='1' width='95%'><blockquote>
<img src='images/<%=rs("Expression")%>'>
<%=ubbcode(rs("body"))%>
<%
if rs("signflag")=1 then
if rs("sign")<>"" then
%>
<p align="right">--------------------------------------------------------------------------------<br>
<%=ubbcode(rs("sign"))%>
<%
end if
end if
%>
</blockquote><hr size='1' width='95%'>
<%
if session.contents("username")<>"" then
if rs("username")=session.contents("username") or session("userclass") = user_level8 or session("userclass") = user_level9 then
%>
<a href="editannounce.asp?boardid=<%=boardid%>&rootid=<%=rootid%>&id=<%=announceid%>&skin=<%=request("skin")%>"><img src="pic/edit.gif" border=0 width=16 height=16 alt="编辑这个贴子">编辑</a>
<%
end if
end if
%>
发贴时间:<%=rs("Dateandtime")%>
<img src='pic/ip.gif' border=0 width=14 height=14 alt='<%if IpFlag=0 then%>已设置保密<%else%><%=rs("ip")%><%end if%>'>
</td>
</tr>
</table>
<%
rs.close
%>
<p align="center"><font color="#999999">本帖子版权属于原作者所有,转载请与原作者联 系并注明出处 - <%=CompanyName%>
</font><font color=green>[<%=HostURL%>]</font>
<p>
<%
sql="select AnnounceID,boardID,UserName,Topic,hits,length,RootID,layer,orders,Expression,dateandtime from bbs1 where boardid="&cstr(boardid)&" and rootid="&request("rootid")&" order by rootid desc,orders"
rs.open sql,conn,1,1
response.write "<b> 相关贴子</b>"
showlist()
rs.close
sql="select body,topic,locktopic from bbs1 where AnnounceID="&AnnounceID
rs.open sql,conn,1,1
topic=rs("topic")
con=rs("body")
%>
<hr size="1" width="96%">
<%
if rs("locktopic")=1 then
response.write "<p align=center>本贴子已被锁定,不能发表回复。"
else
call showReForm()
end if
%>
<!--#include file="inc/Form1.asp"-->
<%
end if
end if
rs.close
end if
if Founderror=true then
call error()
end if
rem ------显示跟随贴子------
sub showlist()
dim outtext
dim bytestr
response.write "<ul>"
dim layer
layer=1
do while not (rs.eof or err.number<>0)
do while layer<> rs("layer")
if rs("layer")> layer then
outtext=outtext & "<ul>"
layer=layer+1
else
outtext=outtext & "</ul>" & chr(13) & chr(10)
layer=layer-1
end if
loop
outtext=outtext & "<li>"
outtext=outtext & "<img src=images/"&rs("Expression")&">"
outtext=outtext & "<a href='ShowAnnounce.asp?boardID="&boardID&"&RootID="&cstr(rs("RootID"))&"&ID="&Cstr(rs("announceID"))&"&skin="&request("skin")&"'>"
dim t
if rs("Length")=0 then
t=" "
else
t=" "
end if
outtext=outtext & htmlencode(rs("Topic")+t)
outtext=outtext & "</a> -- <font color='#E10071'>「作者:<a href=javascript:openScript('dispuser.asp?name="&htmlencode(rs("username"))&"',350,300) title='作者资料'><font color='#E10071'>"
bytestr="("+cstr(rs("length"))
if not WINNT_CHINESE then
if rs("Length")-1=1 then
bytestr=bytestr+" Byte)"
else
bytestr=bytestr+" Bytes)"
end if
else
bytestr=bytestr+"字)"
end if
outtext=outtext & HTMLEncode(rs("UserName"))
outtext=outtext & "</font></a>」</font> [ID:"+cstr(rs("announceID"))+" 点击:"&rs("Hits")&" <font color=green><i>"&rs("dateandtime")&"</i></font>] "+bytestr+""+chr(13)+chr(10)
if trim(rs("DateAndTime"))<>"" and isdate(rs("DateAndTime")) then
if cbool(cdate(rs("DateAndTime"))>(date()-1))=true then
outtext=outtext & "<img src='images/new.gif'>"+chr(13)+chr(10)
end if
end if
rs.movenext
response.write outtext
outtext=""
loop
if layer<>0 then
dim i
for i=1 to layer
outtext=outtext & "</ul>"
next
end if
outtext=outtext & "</ul>"
response.write outtext
end sub
set rs=nothing
call endConnection()
%>
<!--#include file="footer.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -