<%@ codepage ="936" %>
<!-- #include file="setup.asp" -->
<%
forumid=Request("forumid")
TimeLimit2=Request.querystring("TimeLimit")
if isnumeric(""&forumid&"") = flase then
error("<li>非法操作")
end if
sql="select bbsname,moderated,pass from bbsconfig where id="&forumid&""
rs.Open sql,Conn,0,1
if rs.eof then
message=message&"<li>数据库中不存在ID为 "&forumid&" 的数据"
error(""&message&"")
end if
bbsname=rs(0)
b_moderated=rs(1)
B_PASS=RS(2)
rs.close
if b_moderated<>"" then
master=split(b_moderated,"|")
for i = 1 to ubound(master)-1
masterlist=""+masterlist+"<option>"+master(i)+"</option>"
next
end if
b_forumid=Request.querystring("forumid")
passre=Request.querystring("passre")
IF B_PASS<>"" and grade<>10 then
	IF passre="" THEN
		Conn.close
		set rs=nothing
		set rs1=nothing
		set conn=nothing
		response.write "<script>window.location.href='forumdisplay.asp?forumid=" & b_forumid & "&passre='+window.prompt('内部论坛 请输入访问密码\n※ 如果这是门派内部论坛请联系本门总掌门索取密码','')</script>"
		response.end
	ELSEIF B_PASS<>passre then
		error("拒绝访问：密码错误")
        end if
end if
acturl="forumdisplay.asp?forumid=" & b_forumid & "#" & bbsname
top
%>
<style>
TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}
TD{BORDER-RIGHT:0px;BORDER-TOP:0px}
.login {
	BORDER: #a4b6d7 1px solid;  FONT-SIZE: 9pt; BACKGROUND: #ffffff; 
}
</style>
<title><%=bbsname%></title>
<table width="100%" align="center" border="0">
<tr>
<td vAlign="top" width="30%"></td>
<td vAlign="center" align="top">&nbsp;&nbsp;<img src="images/closedfold.gif" border="0">&nbsp;&nbsp;<a href="index.asp"><%=clubname%></a><br>
&nbsp;&nbsp;<img src="images/bar.gif" border="0"><img src="images/openfold.gif" border="0">&nbsp;&nbsp;<a href=forumdisplay.asp?forumid=<%=forumid%>&passre=<%=passre%>><%=bbsname%></a></td>
</tr>
</table>
<br>
<script>
function Check(){var Name=document.form.topage.value;
document.location='?forumid=<%=forumid%>&order=<%=Request("order")%>&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=TimeLimit2%>&topage='+Name+'';
}
function loadThreadFollow(ino){
var targetImg =eval("followImg" + ino);
var targetDiv =eval("follow" + ino);
if (targetDiv.style.display!='block'){
targetDiv.style.display="block";
targetImg.src="images/minus.gif";
if (targetImg.loaded=="no"){document.frames["hiddenframe"].location.replace("loading.asp?id="+ino+"");}
}else{
targetDiv.style.display="none";
targetImg.src="images/plus.gif";
}
}
</script>
<IFRAME HEIGHT=0 WIDTH=0 NAME=hiddenframe></IFRAME>
<!-- #include file="inc/line.asp" -->
<%
forumidonline=conn.execute("Select count(forumid)from online where forumid="&forumid&"")(0)
openlinelist="打开详细列表"
if Request.Cookies("openlinelist")="1" then
dim O_username,O_bbsname,O_cometime,O_lasttime,O_userwin,O_userie
sql="select username,bbsname,cometime,lasttime from online where forumid="&forumid
rs.Open sql,Conn,0,1
SET O_username=RS(0)
SET O_bbsname=RS(1)
SET O_cometime=RS(2)
SET O_lasttime=RS(3)
NO_count=1
do while not rs.eof
if O_username<>"" and O_username<>"客人" then
 myhttp="'../yamen/mt.asp?action="&O_username&"' target=_blank"
else
 myhttp="# target=_self"
end if
allline=""&allline&"<td width=16% style=word-break:break-all><a href="&myhttp&" TITLE='目前位置："&O_bbsname&vbCrlf&"来访时间："&O_cometime&""&vbCrlf&"活动时间："&O_lasttime&"'>"&O_username&"</a></td>"
if NO_count = 6 then
allline=""&allline&"</tr><tr>"
NO_count=1
else
NO_count=NO_count+1
end if
rs.movenext
loop
rs.close
openlinelist="关闭详细列表"
allline="<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=1 width=100% align=center border=1><TBODY><TR><TD align=middle width=46 bgColor=ecf5ff height=2><IMG height=20 src=images/online.gif width=20></TD><TD vAlign=top bgColor=f2f8ff height=2><TABLE cellSpacing=0 cellPadding=3 width=100% border=0><TBODY><TR>"&allline&"</TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"
end if
if Request("order")="Views" then
order="Views"
elseif Request("order")="replies" then
order="replies"
elseif Request("order")="username" then
order="username"
elseif Request("order")="topic" then
order="topic"
elseif Request("order")="lastname" then
order="lastname"
else
order="lasttime"
end if
if TimeLimit2<>"" then
TimeLimit="and lasttime>=#"&Format_D(now()-TimeLimit2)&"#"
else
TimeLimit=""
end if
alltb2="id,username,topic,forumid,lastname,lasttime,views,replies,posttime,goodtopic,polltopic,locktopic,toptopic"
if Request("search")="author" then
count=conn.execute("Select count(id)from forum where deltopic<>1 and forumid="&forumid&" and username='"&Request("key")&"'")(0)
sql="select " & alltb2 & " from forum where deltopic<>1 and forumid="&forumid&" and username='"&Request("key")&"' order by "&order&" Desc "
elseif Request("search")="goodtopic" then
count=conn.execute("Select count(id)from forum where deltopic<>1 and forumid="&forumid&" and goodtopic=1")(0)
sql="select " & alltb2 & " from forum where deltopic<>1 and forumid="&forumid&" and goodtopic=1 order by "&order&" Desc "
else
count=conn.execute("Select count(id)from forum where deltopic<>1 and forumid="&forumid&" "&TimeLimit&"")(0)
sql="select " & alltb2 & " from forum where deltopic<>1 and forumid="&forumid&" "&TimeLimit&" order by toptopic Desc,"&order&" Desc"
end if
on error resume next '找不到论坛帖子时忽略错误
pagesetup=20 '设定每页的显示数量
rs.Open sql,Conn,0,1
If Count/pagesetup > (Count\pagesetup) then
TotalPage=(Count\pagesetup)+1
else TotalPage=(Count\pagesetup)
End If
PageCount= 0
RS.MoveFirst
B_ToPage=Request.QueryString("ToPage")
if B_ToPage<>"" then PageCount = cint(B_ToPage)
if PageCount <=0 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
RS.Move (PageCount-1) * pagesetup
%>
<TABLE cellSpacing=0 cellPadding=0 width=100% align=center bgColor=a4b6d7 border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=1 cellPadding=6 width="100%" border=0>
<TBODY></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=0 width=100% align=center border=1>
<TBODY>
<TR>
<TD width=694 bgColor=c4d4e5 height=25>　<B>■ </B>目前论坛总在线 <B><%=onlinemany%></B>
人，<font color="#333333">本分论坛共有 <b><%=forumidonline%></b> 人在线。</font><a href="cookies.asp?menu=openlinelist" target="_self"><%=openlinelist%></a></TD>
<TD align=middle width=50 bgColor=c4d4e5 height=25>
<a href="javascript:this.location.reload()">
<IMG src="images/refresh.gif" border="0"></a></TD></TR></TBODY></TABLE>
<%=allline%>
<br>
<TABLE height=30 cellSpacing=0 cellPadding=0 width=100% align=center border=0>
<TBODY>
<TR>
<TD align=left width=148><a href=newtopic.asp?forumid=<%=forumid%>>
<img src=images/sbutton-post2.gif border=0 alt=发表文章></a></TD>
<TD align=right width=602>

<IMG src="images/jt.gif"> 论题数:<%=Count%>　<IMG src="images/jt.gif">
<a href="forumdisplay.asp?forumid=<%=forumid%>&search=goodtopic&passre=<%=passre%>">论坛精华</a>　<img src="images/team.gif">
<select onchange=if(this.options[this.selectedIndex].value!=''){window.open(this.options[this.selectedIndex].value);}>
<option>论坛版主</option>
<%=masterlist%>
</select></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 width=100% align=center bgColor=a4b6d7 border=0>
<TBODY>
<TR>
<TD height=1></TD></TR></TBODY></TABLE>
<TABLE borderColor=a4b6d7 height=28 cellSpacing=0 cellPadding=1 width=100% align=center border=1>
<TBODY>
<TR bgColor=c4d4e5>
<TD align=middle width=46 bgColor=ecf5ff><IMG height=18 src="images/announce.gif" width=18 align=absMiddle></TD>
<td width="706" bgColor="#f2f8ff">&nbsp;&nbsp;江湖专用版论坛[酷屋网络]by:唯情</TD>
<TD width=200 bgColor=f2f8ff align="right"><SELECT onchange=if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}>
<OPTION value=forumdisplay.asp?forumid=<%=forumid%>&passre=<%=passre%>>查看所有的主题
<OPTION value=forumdisplay.asp?forumid=<%=forumid%>&TimeLimit=1&passre=<%=passre%>>查看一天内的主题
<OPTION value=forumdisplay.asp?forumid=<%=forumid%>&TimeLimit=2&passre=<%=passre%>>查看两天内的主题
<OPTION value=forumdisplay.asp?forumid=<%=forumid%>&TimeLimit=7&passre=<%=passre%>>查看一星期内的主题
<OPTION value=forumdisplay.asp?forumid=<%=forumid%>&TimeLimit=15&passre=<%=passre%>>查看半个月内的主题
<OPTION value=forumdisplay.asp?forumid=<%=forumid%>&TimeLimit=30&passre=<%=passre%>>查看一个月内的主题
<OPTION value=forumdisplay.asp?forumid=<%=forumid%>&TimeLimit=60&passre=<%=passre%>>查看两个月内的主题
<OPTION value=forumdisplay.asp?forumid=<%=forumid%>&TimeLimit=180&passre=<%=passre%>>查看半年内的主题</OPTION>
</SELECT></TD></TR></TBODY></TABLE>
<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=1 width=100% align=center bgColor=0bc000 border=1>
<TBODY>
<TR bgColor=c4d4e5 height=25>
<TD width=21>　</TD>
<TD width=22>　</TD>
<TD align=middle height=24>
<font color="#000000">
<a href="forumdisplay.asp?forumid=<%=forumid%>&passre=<%=passre%>&order=topic&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">主题</font></a></font></TD>
<TD align=middle width=70 height=24>
<font color="#000000">
<a href="forumdisplay.asp?forumid=<%=forumid%>&passre=<%=passre%>&order=username&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">作者</font></a></font></TD>
<TD align=middle width=40 height=24>
<a href="forumdisplay.asp?forumid=<%=forumid%>&passre=<%=passre%>&order=replies&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">回复</font></a></TD>
<TD align=middle width=32 height=24>
<a href="forumdisplay.asp?forumid=<%=forumid%>&passre=<%=passre%>&order=Views&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">点击</font></a></TD>
<TD width=200 height=24>　　
<a href="forumdisplay.asp?forumid=<%=forumid%>&passre=<%=passre%>&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">最后更新</font></a>　　　　 <font color=000000>
<a href="forumdisplay.asp?forumid=<%=forumid%>&passre=<%=passre%>&order=lastname&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">最后回复</font></a></font></TD></TR></TBODY></TABLE>
<%
set db_id = rs(0) 
set db_username = rs(1) 
set db_topic = rs(2) 
set db_forumid = rs(3) 
set db_lastname = rs(4) 
set db_lasttime = rs(5) 
set db_views = rs(6) 
set db_replies = rs(7) 
set db_posttime = rs(8) 
'set db_content = rs(9) 
set db_goodtopic = rs(9) 
set db_polltopic = rs(10) 
set db_locktopic = rs(11) 
set db_toptopic = rs(12) 
i=0
Do While Not RS.EOF and i<pagesetup
i=i+1
db_str_id = db_id 
db_str_username = db_username
db_str_topic = db_topic
db_str_forumid = db_forumid
db_str_lastname = db_lastname
db_str_lasttime = db_lasttime
db_str_views = db_views
db_str_replies = db_replies
db_str_posttime = db_posttime
'db_str_content = db_content
db_str_goodtopic = db_goodtopic
db_str_polltopic = db_polltopic
db_str_locktopic = db_locktopic
db_str_toptopic = db_toptopic
if db_str_toptopic=1 then
reimage="<img src=images/f_top.gif>"
elseif db_str_locktopic=1 then
reimage="<img src=images/f_locked.gif>"
elseif db_str_polltopic<>"" then
reimage="<img src=images/f_poll.gif>"
elseif db_str_replies>15 or db_str_views > 150 then
reimage="<img src=images/f_hot.gif>"
elseif db_str_replies>0 then
reimage="<img src=images/f_new.gif>"
else
reimage="<img src=images/f_norm.gif>"
end if
if db_str_goodtopic=1 then
reimage2="<img src=images/topicgood.gif>"
elseif db_str_username=""&Request.Cookies("username")&"" then
reimage2="<img src=images/my.gif>"
else
reimage2=""
end if
if db_str_replies>0 then
replies="<font color=red>["&db_str_replies&"]</font>"
else
replies=0 'Len(db_str_content)
end if
newtopic=""
topicpage=""
if db_str_posttime+1 > Now() then
newtopic="<img src=images/new.gif>"
end if
if db_str_replies > 15 then
topicpageend=(db_str_replies-1)/15+1
for topicpagestart=1 to topicpageend
topicpage=""&topicpage&" <b><a href=showtopic.asp?topage="& topicpagestart & "&passre=" & passre & "&forumid="&forumid&"&id="&db_str_id&">" & topicpagestart & "</a></b> "
next
topicpage=" ( <img src=images/multipage.gif>"&topicpage&") "
end if
%>
<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=1 width=100% align=center bgColor=0bc000 border=1>
<TBODY>
<TR bgColor=c4d4e5 height=25>
<TD align=middle width=21 bgColor=ecf5ff><%=reimage%>　</TD>
<TD width=22 bgColor=f2f8ff><%=reimage2%>　</TD>
<TD onmouseover="this.style.backgroundColor='f2f8ff'" onmouseout="this.style.backgroundColor=''" align=left bgColor=ecf5ff>
<img loaded="no" src=images/plus.gif id="followImg<%=db_str_id%>" style="cursor:hand;" onclick="loadThreadFollow(<%=db_str_id%>)">
<a href=showtopic.asp?id=<%=db_str_id%>&passre=<%=passre%>&forumid=<%=db_str_forumid%>><%=db_str_topic%></a> <%=topicpage%><%=newtopic%></TD>
<TD align=middle width=70 bgColor=f2f8ff><a href=../yamen/mt.asp?action=<%=db_str_username%> target="online_window"><%=db_str_username%></a>　</TD>
<TD align=middle width=40 bgColor=ecf5ff><%=replies%>　</TD>
<TD align=middle width=32 bgColor=f2f8ff><%=db_str_views%>　</TD>
<TD align=left width=200 bgColor=ecf5ff>&nbsp;<%=rs("lasttime")%> | <a href=../yamen/mt.asp?action=<%=db_str_lastname%> target="online_window"><%=db_str_lastname%></a></TD></TR>
</TBODY></TABLE>
<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=1 width=100% align=center bgColor=0bc000 border=1>
<TBODY>
<TR bgColor=c4d4e5 height=25 style="display:none" id="follow<%=db_str_id%>">
<TD width=21 bgColor=ecf5ff>　</TD>
<TD width=22 bgColor=f2f8ff>　</TD>
<TD id="followTd<%=db_str_id%>" align=left bgColor=f2f8ff>
<div onclick="loadThreadFollow(<%=db_str_id%>)"><table width=100% cellpadding=10><tr><td width=100%>Loading...</td></tr></table></div>
</TD>
</TR>
</TBODY></TABLE>
<%
RS.MoveNext
loop
RS.Close
%>
<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=1 width=100% align=center bgColor=0bc000 border=1>
<TBODY>
<TR bgColor=c4d4e5 height=25>
<TD height=2>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD height=2>&nbsp;<b>本论坛共有 <font color="#990000"><%=TotalPage%></font> 
页 [
<%
ii=PageCount-5
iii=PageCount+5
if ii < 1 then
ii=1
end if
if iii > TotalPage then
iii=TotalPage
end if
if PageCount > 6 then
Response.Write "<a href=?topage=1&forumid="&forumid&"&order="&Request("order")&"&search="&Request("search")&"&key="&Request("key")&"&TimeLimit="&Request("TimeLimit")&">1</a> ... "
end if
for i=ii to iii
If i<>PageCount then
Response.Write " <a href=?topage="& i &"&forumid="&forumid&"&order="&Request("order")&"&search="&Request("search")&"&key="&Request("key")&"&TimeLimit="&Request("TimeLimit")&">" & i & "</a> "
else
Response.Write " <font color=#000000><b>"&i&"</b></font> "
end if
next
if TotalPage > PageCount+5 then
Response.Write " ... <a href=?topage="&TotalPage&"&forumid="&forumid&"&order="&Request("order")&"&search="&Request("search")&"&key="&Request("key")&"&TimeLimit="&Request("TimeLimit")&">"&TotalPage&"</a>"
end if
%> ]</b></TD>
<form name=form method="POST" action=javascript:Check()>
<TD height=2 align="right">页码：<input style=FONT-SIZE:9pt maxLength="6" size="6" name="topage" value="<%=PageCount%>">
<input style=FONT-SIZE:9pt value="GO!" type="submit"></TD></form>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<br>
<center>
<table cellSpacing="4" cellPadding="0" width="651" border="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td noWrap width="200">
<img alt src="images/f_new.gif" border="0">&nbsp;打开主题 (有回复的主题)</td>
<td noWrap width="100">
<img alt src="images/f_hot.gif" border="0">&nbsp;热门主题 </td>
<td noWrap width="100">
<img alt src="images/f_locked.gif" border="0">&nbsp;锁定主题</td>
<td noWrap width="150">
<img src="images/topicgood.gif">
精华主题</td>
</tr>
<tr>
<td noWrap width="200">
<img alt src="images/f_norm.gif" border="0">&nbsp;打开主题 (没有回复的主题)</td>
<td noWrap width="100">
<img alt src="images/f_poll.gif" border="0">&nbsp;投票主题</td>
<td noWrap width="100">
<img alt src="images/f_top.gif" border="0">&nbsp;置顶主题</td>
<td noWrap width="150">
<img src="images/my.gif">
自己发表的主题</td>
</tr>
</table>
</center>
<%
htmlend
%>