<!-- #include file="Setup.asp" -->
<!-- #include file="inc/ubb.asp" -->
<%
ThreadID=int(Request("ThreadID"))

sql="Select * From [BBSXP_Threads] where ID="&ThreadID&""
Rs.Open sql,Conn,1
if Rs.eof or Rs.bof then error"<li>系统不存在该帖子的资料"
if Rs("IsDel")=1 then error"<li>该主题在回收站中！"

ForumID=Rs("ForumID")
PostsTableName=Rs("PostsTableName")
Topic=Rs("Topic")
Rs.close
Topic=ReplaceText(Topic,"<[^>]*>","")

sql="select * from [BBSXP_Forums] where id="&ForumID&""
Set Rs=Conn.Execute(sql)
if Rs.Eof then error("<li>系统不存在此论坛的资料")
ForumName=Rs("ForumName")
Moderated=Rs("Moderated")
Rs.close
%>
<!-- #include file="inc/ForumPermissions.asp" --><%if PermissionsRead=0 then error("<li>您没有<a href=ShowForumPermissions.asp?ForumID="&ForumID&">权限</a>阅读帖子")%>
<title><%=Topic%></title>
<body onload="window.print()">

<table cellspacing="0" cellpadding="0" border="0" width="100%" class="mainbody">
	<tr>
		<td>- <b><%=SiteSettings("SiteName")%></b> ( <%=SiteSettings("SiteURL")%>Default.asp )<br>
		-- <b><%=ForumName%></b> ( <%=SiteSettings("SiteURL")%>ShowForum.asp?ForumID=<%=ForumID%> )<br>
		--- <b><%=Topic%></b> ( <%=SiteSettings("SiteURL")%>ShowPost.asp?ThreadID=<%=ThreadID%> ) <br><br><hr>
<%
sql="select * from [BBSXP_Posts"&PostsTableName&"] where ThreadID="&ThreadID&" order by id"
Set Rs=Conn.Execute(sql)
Do While Not Rs.EOF
%>
<p>作者：<%=Rs("UserName")%><br>
发表时间：<%=Rs("Posttime")%><br><br>
<%if Rs("lock")=1 then%>
==============================<br>　　　<font color=RED>该用户帖子已被屏蔽　　　</font><br>==============================
<%else%>
<%=UBBCode(Rs("content"))%></p>
<%end if%>
<hr>
<%
Rs.MoveNext
loop
Rs.Close
%></td>
</tr>
</table>

</body>
<%htmlend%>