<!-- #include file="setup.asp" -->
<%
top

forumid=int(Request("forumid"))
sql="select * from bbsconfig where id="&forumid&""
Set Rs=Conn.Execute(sql)
bbsname=rs("bbsname")
toltopic=rs("toltopic")
moderated=rs("moderated")
followid=rs("followid")
hide=rs("hide")
pass=rs("pass")
password=rs("password")
userlist=rs("userlist")
foruminfo=Rs("foruminfo")
focus=rs("focus")
rs.close

%>


<!-- #include file="inc/validate.asp" -->

<meta http-equiv=refresh content=300>
<script>
var key_word="<%=Request.Cookies("key_word")%>"
var cookieusername="<%=Request.Cookies("username")%>"
</script>


<title><%=bbsname%> - Powered By TCBBS</title>
	<table border="0" width="<%=dkuan%>" align="center" cellspacing="1" cellpadding="4" class=a2>
		<tr class=a3>
			<td colspan=2><table border="0" width="100%" cellspacing="0" cellpadding="0"><tr>
				<td height="18">&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → <%ForumTree(followid)%><%=ForumTreeList%> <a href=ShowForum.asp?forumid=<%=forumid%>><%=bbsname%></a></td>
                                <td height="18" align="right"><a onmouseover="showmenu(event,'<div class=menuitems><a href=supervise.asp?forumid=<%=forumid%>>论坛管理</a></div><div class=menuitems><a href=admin_setup.asp?menu=addaffiche>发布公告</a></div><div class=menuitems><a href=ShowBBS.asp>帖子审核</a></div>')" style=cursor:default>╄论坛选项╃</a></td>
</td></table>
</td>
</tr>
<%
ShowForum=1
sql="Select * From bbsconfig where followid="&forumid&" and hide=0 order by SortNum"
Set Rs1=Conn.Execute(sql)
if not Rs1.eof then
do while not rs1.eof
if ""&Rs1("password")&""="" then:password=0:else:password=1:end if
%><script>ShowList("<%=Rs1("pass")%>","<%=Rs1("id")%>","<%=Rs1("bbsname")%>","<%=Rs1("icon")%>","<%=Rs1("intro")%>","<%=Rs1("moderated")%>","<%=Rs1("today")%>","<%=Rs1("toltopic")%>","<%=Rs1("tolrestore")%>","<%=Rs1("lasttime")%>","<%=Rs1("lastname")%>","<%=Rs1("lasttopic")%>","<%=password%>");</script>
<%
rs1.movenext
loop
Set Rs1 = Nothing

ShowForum=0
end if


%>
</table><%=colors%>

<br>

<%if foruminfo<>"" then%>
<%foruminfo=ybbcode(foruminfo)%>
<table border="0" width="<%=dkuan%>" align="center" cellspacing="0" cellpadding="0">
<tr><td>
<div class=a3 style=" PADDING-TOP: 10px; PADDING-BOTTOM: 10px;PADDING-LEFT: 10px;  PADDING-RIGHT: 10px;  BORDER-RIGHT:#ccc 1px dotted; BORDER-TOP:#ccc 1px dotted; BORDER-LEFT:#ccc 1px dotted; BORDER-BOTTOM:#ccc 1px dotted;">
<%=foruminfo%></div><br>
</tr></td>
</table>
<%end if%>


<!-- #include file="inc/line.asp" -->
<!-- #include file="ybbcode.asp" -->
<%

if ShowForum=1 or SortShowForum=1 then

forumidonline=conn.execute("Select count(sessionid)from online where forumid="&forumid&"")(0)
regforumidonline=conn.execute("Select count(sessionid)from online where forumid="&forumid&" and username<>''")(0)
%><table cellspacing="1" cellpadding="0" width="<%=dkuan%>" align="center" border="0" class="a2"><tr><td width="93%" height="25" class="a1">　<img loaded="no" src="images/plus.gif" id="followImg0" style="cursor:hand;" onclick="loadThreadFollow(0,<%=forumid%>)"> 目前论坛总在线  <b><%=onlinemany%></b> 人，本分论坛共有 <b><%=forumidonline%></b> 人在线。其中注册用户 <b><%=regforumidonline%></b> 人，访客 <b><%=forumidonline-regforumidonline%></b> 人。</td><td align="middle" width="7%" height="25" class="a1"><a href="javascript:this.location.reload()"><img src="images/refresh.gif" border="0"></a></td></tr><tr height="25" style="display:none" id="follow0"><td id="followTd0" align="left" class="a4" width="94%" colspan="5">
  Loading...</td></tr></tr></table>
<br>



<table height="30" cellspacing="0" cellpadding="0" width="<%=dkuan%>" align="center" border="0"><tr><td align="left" width="20%"><a href="newtopic.asp?forumid=<%=forumid%>"><img src="images/skins/<%=Request.Cookies("skins")%>/post.gif" border="0" alt="发表文章"></a>
<a onmouseover="showmenu(event,'<div class=menuitems><a href=favorites.asp?menu=add&url=forum&name=<%=forumid%>>收藏论坛</a></div><div class=menuitems><a href=favorites.asp?menu=del&url=forum&name=<%=forumid%>>取消收藏</a></div>')" style=cursor:default><img src="images/skins/<%=Request.Cookies("skins")%>/cang.gif"></a>
<a onmouseover="showmenu(event,'<div class=menuitems><a href=?forumid=<%=forumid%>&TimeLimit=1>查看一天内的主题</a></div><div class=menuitems><a href=?forumid=<%=forumid%>&TimeLimit=3>查看三天内的主题</a></div><div class=menuitems><a href=?forumid=<%=forumid%>&TimeLimit=7>查看一星期内的主题</a></div><div class=menuitems><a href=?forumid=<%=forumid%>&TimeLimit=14>查看两星期内的主题</a></div><div class=menuitems><a href=?forumid=<%=forumid%>&TimeLimit=30>查看一个月内的主题</a></div><div class=menuitems><a href=?forumid=<%=forumid%>&TimeLimit=90>查看三个月内的主题</a></div><div class=menuitems><a href=?forumid=<%=forumid%>&TimeLimit=180>查看六个月内的主题</a></div>')" href=?forumid=<%=forumid%>><img src="images/skins/<%=Request.Cookies("skins")%>/zhuti.gif" border="0"></a>
<a href="ShowForum.asp?forumid=<%=forumid%>&search=goodtopic"><img src="images/skins/<%=Request.Cookies("skins")%>/jinghua.gif" border="0"></a>
</td><td align="right" width="20%">
<SCRIPT>
var moderated="<%=moderated%>"
var listmoderated=""
var list= moderated.split ('|'); 
for(i=0;i<list.length;i++) {
if (list[i] !=""){
listmoderated=listmoderated+"<div class=menuitems><a href=profile.asp?username="+list[i]+">"+list[i]+"</a></div>";
}
}
document.write("<img src=images/team.gif> <a onmouseover=\"showmenu(event,'"+listmoderated+"')\" style=cursor:default>论坛版主</a>");
</SCRIPT>  
</td></tr></table>
<table  cellspacing="1" cellpadding="4" class=a2 width="<%=dkuan%>" align="center" border="0">
  <tr class="a3">
    <td height="24">
 <% 
response.Write("<a href=?forumid="&forumid&" style=color:FF0000>&nbsp;&nbsp;专题：</a>")
if focus<>empty then
focus=split(focus,"|")
for i = 1 to ubound(focus)
response.Write"<font face='Old English Text MT'><b>"&i&"</b></font> [<a href=?forumid="&forumid&"&class="&i&">"&focus(i)&"</a>]  "
next
end if
%>
</td>
  </tr>
</table>


<SCRIPT>valigntop()</SCRIPT>
<table cellspacing="1" cellpadding="0" width="<%=dkuan%>" align="center" border="0" class="a2"><tr height="25" id=TableTitleLink><td width="3%" class="a1"><td width="3%" class="a1"><td align="middle" height="24" class="a1" width="45%"><a href="ShowForum.asp?forumid=<%=forumid%>&order=id&search=<%=Request("search")%>&TimeLimit=<%=Request("TimeLimit")%>">主题</a></td><td align="middle" width="9%" height="24" class="a1"><a href="ShowForum.asp?forumid=<%=forumid%>&order=username&search=<%=Request("search")%>&TimeLimit=<%=Request("TimeLimit")%>">作者</a></font></td><td align="middle" width="6%" height="24" class="a1"><a href="ShowForum.asp?forumid=<%=forumid%>&order=replies&search=<%=Request("search")%>&TimeLimit=<%=Request("TimeLimit")%>">回复</a></td><td align="middle" width="7%" height="24" class="a1"><a href="ShowForum.asp?forumid=<%=forumid%>&order=Views&search=<%=Request("search")%>&TimeLimit=<%=Request("TimeLimit")%>">点击</a></td><td width="20%" height="24" class="a1" align="center"><a href="ShowForum.asp?forumid=<%=forumid%>&search=<%=Request("search")%>&TimeLimit=<%=Request("TimeLimit")%>">最后更新</a></td></tr>


<%

if Request("order")<>"" then
order=HTMLEncode(Request("order"))
else
order="lasttime"
end if

gz_class=int(request.QueryString("class"))
if gz_class>0 then
gz_class=" and addtion='"&focus(gz_class)&"'"
else
gz_class=""
end if

if Request("TimeLimit")<>"" then TimeLimit="and lasttime>"&SqlNowString&"-"&int(Request("TimeLimit"))&""

if Request("search")="goodtopic" then search="and goodtopic=1 "

if Request.Cookies("pagesetup")=empty then
pagesetup=20   '设定每页的显示数量
else
pagesetup=int(Request.Cookies("pagesetup"))
if pagesetup > 30 then pagesetup=20
end if

PageCount = cint(Request.QueryString("ToPage"))
if PageCount<=1 then
set RS=conn.execute("select * from [forum] where (toptopic>1 or (toptopic=1 and forumid in ("&forumid&"))) "&search&" "&TimeLimit&yusi_class&" order by toptopic Desc,"&order&" Desc")
if not rs.eof then
toplist=true
response.Write("<tr><td colspan=7 height=22  class=a3>  <b>&nbsp;&nbsp;&nbsp;&nbsp;置顶主题</b></td></tr>")
end if
do while not RS.eof
if Not Response.IsClientConnected then responseend
newtopic=""
if rs("posttime")+1>now() then newtopic="<img src=images/new.gif>"
addtion=""
if rs("replies")<98 and rs("Views")<>"" then
addtion=rs("Views")
end if

%>

<script>ShowForum("<%=rs("ID")%>","<%=rs("topic")%>","<%=newtopic%>","<%=rs("username")%>","<%=rs("Views")%>","<%=rs("icon")%>","<%=rs("toptopic")%>","<%=rs("locktopic")%>","<%=rs("pollresult")%>","<%=rs("goodtopic")%>","<%=rs("replies")%>","<%=rs("lastname")%>","<%=rs("lasttime")%>");</script>
<%
RS.MoveNext
loop
RS.Close
if toplist then
response.Write("<tr><td colspan=7 height=22  class=a3>  <b>&nbsp;&nbsp;&nbsp;&nbsp;其他主题</b></td></tr>")
end if
end if
sql="where deltopic=0 and forumid="&forumid&" "&search&" "&TimeLimit&gz_class&" and toptopic=0"
count=conn.execute("Select count(id) from [forum] "&sql&"")(0)
TotalPage=cint(count/pagesetup)  '总页数
if TotalPage < count/pagesetup then TotalPage=TotalPage+1

if PageCount > TotalPage then PageCount = TotalPage
if PageCount < 1 then PageCount = 1
sql="select top "&pagesetup*PageCount&" * from [forum] "&sql&" order by toptopic Desc,"&order&" Desc"

if PageCount>100 then
rs.Open sql,Conn,1
else
Set Rs=Conn.Execute(sql)
end if
if TotalPage>1 then RS.Move (PageCount-1) * pagesetup


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

newtopic=""
if rs("posttime")+1>now() then newtopic="<img src=images/new.gif>"
id=rs("id")
if Conn.Execute("Select market From forum where id="&id).eof then
market=0
else
market=Conn.Execute("Select market From [forum] where id="&id)(0)
end if
if Conn.Execute("Select color From forum where id="&id).eof then
colors=0
else
colors=Conn.Execute("Select color From [forum] where id="&id)(0)
end if
if rs("addtion")<>empty then %>
<script>ShowForum("<%=rs("ID")%>","[<%=rs("addtion")%>]<%=rs("topic")%>","<%=newtopic%>","<%=rs("username")%>","<%=rs("Views")%>","<%=rs("icon")%>","<%=rs("toptopic")%>","<%=rs("locktopic")%>","<%=rs("pollresult")%>","<%=rs("goodtopic")%>","<%=rs("replies")%>","<%=rs("lastname")%>","<%=rs("lasttime")%>","<%=market%>","<%=forumid%>","<%=colors%>");</script>
<% else %>
<script>ShowForum("<%=rs("ID")%>","<%=rs("topic")%>","<%=newtopic%>","<%=rs("username")%>","<%=rs("Views")%>","<%=rs("icon")%>","<%=rs("toptopic")%>","<%=rs("locktopic")%>","<%=rs("pollresult")%>","<%=rs("goodtopic")%>","<%=rs("replies")%>","<%=rs("lastname")%>","<%=rs("lasttime")%>","<%=market%>","<%=forumid%>","<%=colors%>");</script>
<%
end if


RS.MoveNext
loop
RS.Close
%></table>
<SCRIPT>valignbottom()</SCRIPT>
<table cellspacing="1" cellpadding="1" width="<%=dkuan%>" align="center" border="0"><tr height="25"><td width="100%" height="2"><table cellspacing="0" cellpadding="3" width="100%" border="0"><tr><td height="2">
		<b>本论坛共有 <font color=red><%=TotalPage%></font> 页 [ 


<b>
<script>
PageCount=<%=TotalPage%>
topage=<%=PageCount%>
for (var i=1; i <= PageCount; i++) {
if (i <= topage+9 && 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("<font color=red> "+ i +" </font>");}
else{
document.write("<a href=?topage="+i+"&forumid=<%=forumid%>&order=<%=Request("order")%>&search=<%=Request("search")%>&TimeLimit=<%=Request("TimeLimit")%>&class=<%=int(request.QueryString("class"))%>>"+ i +"</a> ");
}
}
}
</script>

</b>]

</b></td><form name="form" action="search.asp?menu=ok&forumid=18&search=key&searchxm2=topic" method="post"><td height="2" align="right">快速搜索：<input name="content" size="20" onkeyup="ValidateTextboxAdd(this, 'btnadd')" onpropertychange="ValidateTextboxAdd(this, 'btnadd')" onfocus="javascript:focusEdit(this)" onblur="javascript:blurEdit(this)" value="关键词" helptext="关键词"> <input type="submit" value="搜索" name="submit" id='btnadd' disabled> <!----------论坛跳转代码开始------------>
<select size=1 onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}" >
<option selected>论坛跳转至。。。</option>
<%
if Request.Cookies("forumid")<>empty then
sql="select * from bbsconfig where id="&Request.Cookies("forumid")&" and hide=1"
Set Rs=Conn.Execute(sql)
if not Rs.eof then
%>

<%
end if
Rs.close
end if
ForumList(0)
%>
<%
sub ForumList(selec)
sql="Select * From bbsconfig where followid="&selec&" and hide=0 order by SortNum"
Set Rs5=Conn.Execute(sql)
do while not Rs5.eof
if ii=0 then
%>
<option value=ShowForum.asp?forumid=<%=Rs5("id")%>> ╋『<%=Rs5("bbsname")%>』</option>
<%
else
%>
<option value=ShowForum.asp?forumid=<%=Rs5("id")%>>│ ├<%=Rs5("bbsname")%></option>
<%
end if

ii=ii+1
if ii < int(floor) then ForumList Rs5("id")
ii=ii-1

Rs5.movenext
loop
Set Rs5 = Nothing
end sub
%>
<option value=Default.asp>返回首页</option>
</select>
<!----------论坛跳转代码结束-----------></td></form></tr></table></td></tr></table>

　<table cellspacing="4" cellpadding="0" width="65%" border="0" align=center><tr><td nowrap width="200"><img alt="" src="images/f_new.gif" border="0"> 打开主题 (有回复的主题)</td><td nowrap width="100"><img alt="" src="images/f_hot.gif" border="0"> 热门主题</td><td nowrap width="100"><img alt="" src="images/f_locked.gif" border="0"> 关闭主题</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"> 打开主题 (没有回复的主题)</td><td nowrap width="100"><img alt="" src="images/f_poll.gif" border="0"> 投票主题</td><td nowrap width="100"><img alt="" src="images/f_top.gif" border="0"> 置顶主题</td><td nowrap width="150"><img src="images/my.gif"> 自己发表的主题</td></tr></table></center></div>
<%

end if


htmlend


sub UpTolTopic
allarticle=conn.execute("Select count(forumid) from forum where deltopic<>1 and forumid="&forumid&"")(0)
if allarticle>0 then
allrearticle=conn.execute("Select sum(replies) from forum where deltopic<>1 and forumid="&forumid&"")(0)
else
allrearticle=0
end if
conn.execute("update [bbsconfig] set toltopic="&allarticle&",tolrestore="&allarticle+allrearticle&" where ID="&forumid&"")
end sub

%>