<!--webbot bot="PurpleText" PREVIEW="
=============================================
《BBSXP新闻模式》-VER.1.0.2 注重商业应用

仅供内部测试，不授权提供给任何第三方下载使用！
非授权使用，请勿非法拷贝，违者将受到商业诉讼！
=============================================
出品公司：济南承信商务总行 [大周帝国.com]
网址：http://www.smallweek.om 
作者：张波 联系电话：0531-8350510
电子信箱：cv2@163.com QQ：82655128
=============================================
         承信商务，提供专业服务！
=============================================
" -->
<!-- #include file="setup.asp" -->

<head>
<meta http-equiv="Content-Language" content="zh-cn">
</head>

<%
top
id=int(Request("id"))
forumid=Conn.Execute("Select forumid From forum where id="&id)(0)
sql="select * from bbsconfig where id="&forumid&""
Set Rs=Conn.Execute(sql)
bbsname=rs("bbsname")
moderated=rs("moderated")
logo=rs("logo")
followid=rs("followid")
pass=rs("pass")
password=rs("password")
userlist=rs("userlist")

sql="select username from online where username<>'' and eremite<>1"
Set Rs=Conn.Execute(sql)
onlinelist="|"
Do While Not RS.EOF
onlinelist=""&onlinelist&""&rs("username")&"|"
rs.movenext
loop
Set Rs = Nothing



if Request("action")="next" then
sql="select top 1 * from forum where id > "&id&" and forumid="&forumid&" and deltopic<>1"
elseif Request("action")="Previous" then
sql="select top 1 * from forum where id < "&id&" and forumid="&forumid&" and deltopic<>1 order by id Desc"
else
sql="select * from forum where ID="&id&""
end if
Set Rs=Conn.Execute(sql)

if rs.eof or rs.bof then error"<li>系统不存在该帖子的资料"
if rs("deltopic")=1 and membercode<4 then error"<li>该主题不存在！"
%> <!-- #include file="inc/validate.asp" -->
<script language="JavaScript">
	function doZoom(size){
		document.getElementById('zoom').style.fontSize=size+'px'
	}
	</script><title><%=rs("topic")%> - Powered By Smallweek.com</title>
	<script>
function copyText(obj) {var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.select();rng.execCommand('Copy');}

var i=0;

var onlinelist= "<%=onlinelist%>";
var badlist= "<%=badlist%>|<%=Request.Cookies("badlist")%>";
var moderated= "|<%=moderated%>|";
var topic="<%=rs("topic")%>"
var topicid="<%=Request("ID")%>"

if ("<%=logo%>"!=''){logo.innerHTML="<img border=0 src=<%=logo%> onload='javascript:if(this.height>60)this.height=60;'>"}
</script>
	<body leftmargin="0" rightmargin="0" bottommargin="0"><div align="center">
	<table border="1" width="<%=dkuan%>" cellspacing="0" class=a3 cellpadding="0" bordercolor="#89959B" style="border-collapse: collapse">
	<tr>
		<td colspan="2" height="60" class=a4>
		<p align="center"><font size="4"><b><%=rs("topic")%></b></font></td>
	</tr>
	<tr>
		<td colspan="2" height="25">
		　<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → <%ForumTree(followid)%><%=ForumTreeList%> <a href=ShowForum.asp?forumid=<%=forumid%>><%=bbsname%></a> → <%=rs("topic")%></td>
	</tr>
	<tr>
		<td width="77%">
		<div align="center">
		<table border="0" width="97%" cellspacing="1">
			<tr>
				<td height="30">
				<p align="center">来源：<%=clubname%> 出处：<%=bbsname%> 作者：<%=rs("username")%> 【<a href="javascript:doZoom(16)">大</a> 
                  <a href="javascript:doZoom(14)">中</a> <a href="javascript:doZoom(12)">小</a>】|
				<a href="javascript:location.reload()">刷新</a> | <a href=ShowPost.asp?id=<%=id%>>
				论坛模式</a></td>
			</tr>
			<tr>
				<td>
				<hr></td>
			</tr>
			<tr>
				<td height="20">
				<p align="center">&nbsp;发表时间：<%=rs("posttime")%></a> 阅读： <%=rs("views")%></td>
			</tr>
			<tr>
				<td id="zoom" height="20" style="line-height: 150%"><br><%=rs("content")%><br></td>
			</tr>
			<tr>
				<td>
				<hr></td>
			</tr>
			<tr>
				<td>
				&nbsp;&nbsp;&nbsp; 评论：[<a href="retopic.asp?id=<%=rs("id")%>&topic=<%=rs("topic")%>">发表评论</a>] </td>
			</tr>
			<tr>
				<td>
				<%
Set Rs1 = Nothing

id=rs("id")
act=rs("topic")
replies=rs("replies")
locktopic=rs("locktopic")
goodtopic=rs("goodtopic")
toptopic=rs("toptopic")


if replies > 0 then
pagesetup=9 '设定每页的显示数量
TotalPage=cint(replies/pagesetup)  '总页数
if TotalPage < replies/pagesetup then TotalPage=TotalPage+1
PageCount = cint(Request.QueryString("ToPage"))
if PageCount < 1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage

sql="select * from reforum where topicid="&id&" order by id"

if PageCount>100 then
rs.Open sql,Conn,1
else
Set Rs=Conn.Execute(sql)
end if
on error resume next '指定页数无帖子时 忽略错误
if TotalPage>1 then RS.Move (PageCount-1) * pagesetup

i=0
Do While Not RS.EOF and i<pagesetup
i=i+1

sql="select * from [user] where username='"&rs("username")&"'"
Set Rs1=Conn.Execute(sql)
sign=replace(""&rs1("sign")&"",chr(34),"'")
content=replace(rs("content"),chr(34),"'")
postcount=rs1("posttopic")+rs1("postrevert")
%><table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#8C969C" style="border-collapse: collapse">
					<tr>
						<td class=a3 height="25">&nbsp; 作者：<%=rs("username")%>  发表时间：<%=rs("posttime")%></td>
					</tr>
					<tr>
						<td height="25">
						<div align="center">
							<table border="0" width="97% cellspacing="0" cellpadding="0" style=TABLE-LAYOUT:fixed>
								<tr>
									<td style="WIDTH: 100%; WORD-WRAP: break-word"><br><script>document.write(ybbcode("<%=content%>"))</script><br><br></td>
								</tr>
							</table>
						</div>
						</td>
					</tr>
				</table><%
Set Rs1 = Nothing
RS.MoveNext
loop
RS.Close

if i=0 then
replies=conn.execute("Select count(id)from reforum where topicid="&id&"")(0)
conn.execute("update [forum] set replies="&replies&" where id="&id&"")
end if

end if


if TotalPage=0 then
TotalPage=1
PageCount=1
end if
%>
				</td>
			</tr>
			<tr>
				<td>
				<hr></td>
			</tr>
			<tr>
				<td>
				<p align="right">&nbsp;| <a href="EditTopic.asp?id=<%=id%>&retopicid=yuzi&topic=<%=rs("topic")%>">编辑</a> | <a href="manage.asp?menu=deltopic&id=<%=id%>&retopicid=yuzi">删除</a> 
				
				|  | <a href="javascript:location.reload()">刷新</a> | <a href="favorites.asp?menu=add&url=topic&name=<%=id%>">收藏帖子</a> | <a href="favorites.asp?menu=del&url=topic&name=<%=id%>">取消收藏</a> | <a href="#">返回页首</a> 
				|</td>
			</tr>
			<tr>
				<td>
				　<script>


PageCount=<%=TotalPage%> //总页数
topage=<%=PageCount%>   //当前停留页

for (var i=1; i <= PageCount; i++) {
if (i <= topage+3 && i >= topage-3 || i==1 || i==PageCount){
if (i > topage+4 || i < topage-2 && i!=1 && i!=2 ){document.write(" ... ");}
if (topage==i){document.write(" "+ i +" ");}
else{
document.write("<a href=?id=<%=id%>&topage="+i+">"+ i +"</a> ");
}
}
}
</script></td>
			</tr>
			<tr>
				<td>
				<p align="right"></td>
			</tr>
		</table>
		</div>
		</td>
		<td width="21%" class=a3 valign="top">
		<div align="center">
			<table border="0" width="97%" cellspacing="0" cellpadding="0">
				<tr><form name="form" action="search.asp?menu=ok&search=key&searchxm2=topic" method="post">
					<td height="30">
					<p align="center">
					<input name="content" value="输入关键字" onfocus="this.value = &quot;&quot;;" style="font-family: Tahoma,Verdana,宋体; font-size: 12px; line-height: 15px" size="16"> <input type="submit" value="搜索" name="submit" style="font-family: Tahoma,Verdana,宋体; font-size: 12px; line-height: 15px"></td>
				</tr></form>
				<tr>
					<td>
					<hr></td>
				</tr>
			</table>
		</div>
		</td>
	</tr>
	<tr>
		<td colspan="2" height="25">
		<p align="center">&nbsp;[<a href="showpost.asp?id=<%=id%>">查看相关评论</a>]&nbsp; <a href=javascript:window.print()>[打印此页]</a>&nbsp; 
<script>document.write("<a target=_blank href='mailto:?subject=<%=rs("topic")%>&body="+location.href+"'>");</script>[推荐好友]</a>&nbsp; 
<a href="javascript:window.external.AddFavorite(location.href,document.title)">[收藏本页]</a>&nbsp; 
<script>document.write("<a style=cursor:hand onclick=\"javascript:open('message.asp?menu=post&report=1&moderated=<%=moderated%>&body=【问题帖子】："+location.href+"','','width=320,height=170')\">");</script>[报告此页]</a> 
		[<a href="newtopic.asp?forumid=<%=rs("forumid")%>">发表文章</a>]</td>
	</tr>
	</table>

</div>
	<p align="center"><table cellspacing="0" cellpadding="0" width="97%" align="center" border="0"><tr><td align="middle">管理选项: <%
response.write "<a href=manage.asp?menu=movenew&id="&id&">拉前主题</a> | "
if locktopic=1 then
response.write "<a href=manage.asp?menu=dellocktopic&id="&id&">开放主题</a>"
else
response.write "<a href=manage.asp?menu=locktopic&id="&id&">关闭主题</a>"
end if
response.write " | "
if toptopic=2 then
response.write "<a href=manage.asp?menu=untop&id="&id&">取消总置顶</a>"
else
response.write "<a href=manage.asp?menu=top&id="&id&">主题总置顶</a>"
end if
response.write " | "
if toptopic=1 then
response.write "<a href=manage.asp?menu=deltoptopic&id="&id&">取消置顶</a>"
else
response.write "<a href=manage.asp?menu=toptopic&id="&id&">主题置顶</a>"
end if
response.write " | "
if goodtopic=1 then
response.write "<a href=manage.asp?menu=delgoodtopic&id="&id&">移出精华区</a>"
else
response.write "<a href=manage.asp?menu=goodtopic&id="&id&">添加到精华区</a>"
end if
%>| <a href="move.asp?id=<%=id%>">移动主题</a> | <a onclick="checkclick('您确定要删除主题?');" href="manage.asp?menu=deltopic&id=<%=id%>">删除主题</a> </td></tr></table> </p>


<%
conn.execute("update [forum] set Views=Views+1 where id="&id&"")

htmlend
%>
<!--webbot bot="PurpleText" PREVIEW="
=============================================
《BBSXP新闻模式》-VER.1.0.2 注重商业应用

仅供内部测试，不授权提供给任何第三方下载使用！
非授权使用，请勿非法拷贝，违者将受到商业诉讼！
=============================================
出品公司：济南承信商务总行 [大周帝国.com]
网址：http://www.smallweek.om 
作者：张波 联系电话：0531-8350510
电子信箱：cv2@163.com QQ：82655128
=============================================
         承信商务，提供专业服务！
=============================================
" -->