<!--#include file="../fuction.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="../webconfig.asp"-->
<!--#include file="../line.asp"-->
<%
 '-----------djj add 200602150003

 bid	=	Request.querystring("bid")
 class1	=	Request.querystring("class1")
 class2	=	Request.querystring("class2")
 class3	=	Request.querystring("class3")
  if class1 <> "" then
 bid = class1
 end if
 if bid <> "" then
 bid = cint(nosql(bid))
 else
 response.Write  ("参数错误！")
 response.End()
 end if
 if class2 <> "" then
 class2 = cint(nosql(class2))
 end if
 if class3 <> "" then
	  class3 = cint(nosql(class3))
 end if
  
'------------200602150003 end 
sub banzhu1()
dim str
	sql="select * from shop_user where manbid=" &bid   
	Set rebman=Conn.Execute(sql)                                         
	do while not rebman.eof
	str="<a href=Userlist_data.asp?username="&rebman("username")&">["&rebman("username")&"]</a>"
	rebman.movenext   
	response.write str                                                   
	loop                                                                   
	rebman.close
	set rebman=nothing 
end sub 
%>

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

<table width="940" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="6" colspan="3"></td>
  </tr>
  <tr>
    <td width="17"><img src="<%=weburl%>img/index_1.gif" width="15" height="16"></td>
    <td valign="bottom">
	<%
	sql="select * from board where bid=" & bid
	Set Rs=Conn.Execute(sql)
	bidname=rs("bidname")
	'---------------djj add 200602150004
	if class2 <> "" then
		sql2="select * from bbs_class2 where  class2_class1_id =" & bid & "  and  class2_id="& class2 
		Set Rs2=Conn.Execute(sql2)
		class2_name = rs2("class2_class2_name")
		class2_id	= rs2("class2_id")
		'-----预计增加分类连接  
		class_link = "<a href=cmd.asp?class1="& bid& " > "& bidname & "</a>" 
		bidname = class_link & " - " & class2_name
		if class3<> "" then 
			sql3="select * from bbs_class3 where  class3_class1_id =" & bid & "  and  class3_class2_id="& class2 & "and class3_id = " & class3 
			Set Rs3=Conn.Execute(sql3)
			class3_name = rs3("class3_class3_name")
			class3_id	= rs3("class3_id")
			class_link = class_link & " → <a href=cmd.asp?class1="& bid&"&class2="&class2_id &" > "& class2_name & "</a>"
					bidname = class_link & " - " & class3_name
		end if
	end if
	'---------------200602150004 end
	%>
	Your present position: <a href="<%=weburl%>"><%=webname%></a> -> <span class="table-shangxia"><span class="b14"><a href=index.asp><%=bbsname%></a> → <%=bidname%> → 帖子列表 </span></span></td>
    <td valign="bottom"></td>
  </tr>
  <tr>
    <td height="6" colspan="3"></td>
  </tr>
</table>
<!--#include file="top.asp"-->

<script language="JavaScript" type="text/JavaScript">
	function MM_openBrWindow(theURL,winName,features)
	{
	  window.open(theURL,winName,features);
	}
</script>
<% 

if rs("rzh")=1 and session("manbid")<>bid and session("manbid")<>20000 then
if session("manbid")="" then
response.write"<script language='javascript'>alert('您没有权限访问此版！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end 
end if
    username2=trim(rs("username"))	
	if username2<>"" then 
	  bsort2=split(username2,",")
	  for i=0 to ubound(bsort2)	
	 if session("username")=trim(bsort2(i)) then
	 ok="ok"
	 exit for
	 end if
	 next   	
	 end if 
else
ok="ok"
end if   
if ok="" then   
response.write"<script language='javascript'>alert('您没有权限访问此版！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end 
end if
%>
<%call bbs%>
<%sub bbs()%>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td>
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          
          <td valign="top">
            <TABLE width=100% border=0 align="center" cellPadding=0  cellSpacing=0>
              <TBODY>
                <%Set mm= Server.CreateObject("ADODB.Recordset")                              
sql="select top 5 * from smallpaper where bid="&bid&" order by ID desc"                              
mm.open sql,conn,1,1                              
%>
                <TR>
                  <TD height="20" align=middle>
                    <div align="left"></div>
                    <marquee onmouseover='this.stop()' onmouseout='this.start()' scrollAmount='1'   width='100%' height='20' align="bottom" scrolldelay="60"> 社区广播：    
                    <% do while not mm.eof %>
                                   <a href=Userlist_data.asp?username=<%=mm("username")%>>[<%=mm("username")%>]</a>：<a href="#" onClick="MM_openBrWindow('viewpaper.asp?id=<%=mm("id")%>','','width=500,height=400')"><%=mm("title")%></a>&nbsp;&nbsp;&nbsp;&nbsp;
                    <%                             
mm.movenext                                              
loop %>
                    </marquee><div align="right"></div></TD>
                </TR>
              </TBODY>
            </TABLE>
            <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="8"></td>
              </tr>
            </table>            <table width="100%" height="30"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td>版主:
                <%call banzhu1%>                </td>
                <td width="90" bgcolor="#FFFFFF"><div align="center"><a href="reg.asp" target="_blank"> </a><a href="post.asp?bid=<%=bid%>&class2=<%=class2%>&class3=<%=class3%>"><img src="images/fb.gif" width="80" height="20" border="0"></a></div></td>
                <td width="90" bgcolor="#FFFFFF"><div align="center"><span class="table-shangxia"><span class="b14" style="font-weight: bold"><span style="color: #000000"><a href="jinhua.asp?bid=<%=bid%>&class2=<%=class2%>&class3=<%=class3%>"><img src="images/jh.gif" width="80" height="20" border="0"></a></span></span></span></div>                  </td>
                <td width="90" bgcolor="#FFFFFF"><div align="center"><span class="table-shangxia"><span class="b14" style="font-weight: bold"><span style="color: #000000"><span class="b14" style="font-weight: bold"><span style="color: #000000"><a href="smallpaper.asp?bid=<%=bid%>"><img src="images/xb.gif" width="80" height="20" border="0"></a></span></span></span></span></span></div>                  </td>
              </tr>
            </table>
            <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="8"></td>
              </tr>
            </table>
            <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="999999">
              <tr bgcolor="#CCCCCC">
                <td width="7%" class="norightbuttonborder2">
                <div align="center" style="font-weight: bold">状态</div></td>
                <td width="36%" class="norightbuttonborder2">
                &nbsp;<span style="font-weight: bold">主题</span></td>
                <td width="12%" class="norightbuttonborder2">
                <div align="center" style="font-weight: bold"> 作者</div></td>
                <td width="10%" class="norightbuttonborder2">
                <div align="center" style="font-weight: bold"> 回复</div></td>
                <td width="10%" class="norightbuttonborder2"><div align="center" style="font-weight: bold">点击次</div></td>
                <td width="30%" height="20" class="norightbuttonborder2">
                <div align="center" style="font-weight: bold"> 最后更新</div></td>
              </tr>
              <% findstr=trim(request("findstr"))               
Set rs = Server.CreateObject("ADODB.Recordset")   
if class2 = "" then
topsql="where  bid="&bid&" and type=0  or gd=2" 
else 
	if class3 = "" then
	topsql="where  bid="&bid&"and bbs_book_class2_id = "& class2&" and type=0  or gd=2" 
	else
	topsql="where  bid="&bid&"and bbs_book_class2_id = "& class2&" and bbs_book_class3_id = "&class3&" and type=0  or gd=2" 
	end if
end if                                                  
                                                       
if findstr <> "" then
	sql="select * from book where (title like '%" &findstr& "%' or username like '%" &findstr& "%' or body like '%" &findstr& "%') and type=0 and bid=" &bid& " order by ldate desc" 
else 
	sql = "SELECT * FROM book  "&topsql&"   order by gd desc,ldate desc"
end if
rs.open sql, conn, 1, 3                                                                            
shownum=20            
totalrecord=rs.recordcount                    
rs.pagesize=shownum                    
maxpage=rs.pagecount      
requestpage=clng(request.querystring("page")) 
if requestpage="" or requestpage=0 then                    
   requestpage=1                      
end if                    
if resquestpage>maxpage then                   
    resquestpage=maxpage                        
end if  
if not requestpage=1 then                   
rs.move (requestpage-1)*rs.pagesize                   
end if                   
for i=1 to rs.pagesize and not rs.bof %><tr  bgcolor="#ffffff" onMouseOver='JavaScript:this.style.backgroundColor="#F7FEFF"' onMouseOut='JavaScript:this.style.backgroundColor="ffffff"'> <script>bbslist("<%=rs("id")%>","<%=rs("faceimg")%>","<%=rs("title")%>","<%=rs("username")%>","<%=rs("reply")%>","<%=rs("hits")%>","<%=rs("ldate")%>","<%=rs("lastname")%>","<%=rs("gd")%>","<%=rs("good")%>","<%=rs("lock")%>","<%=rs("vote_title")%>","<%if rs("hits")>=50 and rs("reply")>=10  then
response.Write("1")
else
response.Write("0")
end if%>",<%if datediff("d",rs("wdate"),now)<=3 then
response.Write("1")
else
response.Write("0")
end if%>);</script>
              </tr><%                               
rs.movenext                 
if rs.eof then exit for                 
next                      
%>
            </table>
            <table width="100%" height="60" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="50%"></td>
                <td width="50%"></td>
              </tr>
              <tr>
                <td width="50%">页次：
                    <%if request.querystring("page")="" then %>
                    1
                    <%else%>
                    <%=request.querystring("page")%>
                    <%end if%>
      / <%=maxpage%>页 每页：<%=shownum%> 主题数：<%=totalrecord%></td>
                <td width="50%">
                  <p align="right">
                    <%                                                                                                                                                       
if requestpage-1 mod 10=0 then                                                                                                                                                       
 p=(requestpage-1) \ 10                                                                                                                                                       
else                                                                                                                                                       
 p=(requestpage-1) \ 10                                                                                                                                                       
end if                                                                                                                                                       
if requestpage=1 then                                                                                                                                                       
 response.write "<font face=webdings color=""#FF0000"">9</font>"                                                                                                                                                       
else                                                                                                                                                       
 response.write "<a href=list.asp?bid="&bid&"&findstr="&findstr&"&page=1 title=首页><font face=webdings>9</font></a>"                                                                                                                                                       
end if                                                                                                                                                       
if p*10>0 then response.write "<a href=list.asp?bid="&bid&"&findstr="&findstr&"&page="&p*10&" title=上十页><font face=webdings>7</font></a>"                                                                                                                                                       
response.write "<b>"                                                                                                                                                      
for ii=p*10+1 to P*10+10                                                                                                                                                       
   if ii=requestpage then                                                                                                                                                       
  response.write "<font color=""#FF0000"">"&ii&"</font> "                                                                                                                                                       
 else
 
   if  totalrecord>0  then                                  
  response.write "<a href=list.asp?bid="&bid&"&findstr="&findstr&"&page="&ii&">"&ii&"</a>   "       
   end if                                                                                                                                              
 end if                                                                                                                                                       
 if ii=maxpage then exit for                                                                                                                                                       
next                                                                                                                                                       
response.write "</b>"                                                                                                                                                       
if ii<maxpage then response.write "<a href=list.asp?bid="&bid&"&findstr="&findstr&"&page="&ii&" title=下十页><font face=webdings>8</font></a>"                                                                                                                                                       
if requestpage=maxpage then                                                                                                                                                       
 response.write "<font face=webdings color=""#FF0000"">:</font>   "                                                                                                                                                       
else                                                                                                                                                       
 response.write "<a href=list.asp?bid="&bid&"&findstr="&findstr&"&page="&maxpage&" title=尾页><font face=webdings>:</font></a>"                                                                                                                                                       
end if                                                                                                                                                       
response.write"    总共有"&maxpage&"页   "                                                                                                                                                        
rs.Close                                                                                                                                                                   
set rs=nothing                                                                                                                                                       
%>
                </td>
              </tr>
              <tr>
                <form method="post" action="list.asp?bid=<%=bid%>&class2=<%=class2%>&class3=<%=class3%>">
                  <td width="50%">快速查找：
                      <input name="findstr" type="text" class="wenbenkuang" size="20">
                      <input name="Submit2" type="submit" class="go-wenbenkuang" value="查 找"></td>
                </form>
                <td width="50%">
                  <p align="right">
                    <select name="select" onChange="if(this.options[this.options.selectedIndex].value!='0')window.location.href='List.asp?bid=' + this.options[this.options.selectedIndex].value ">
                      <option value='0'>论坛跳转至……</option>
                      <%                               
    set rs1=server.createobject("adodb.recordset")                               
    sqlstr="select * from board order by px"                               
    rs1.open sqlstr,conn,1,1     
    do while not rs1.eof                               
    %>
                      <option value='<%=rs1("bid")%>'><%=rs1("bidname")%></option>
                      <%rs1.movenext                                         
loop                        
   rs1.Close                    
set rs1=nothing %>
                    </select>
                </td>
              </tr>
            </table>
            <div align="center"><font color="666666"><br>
            栏目图例&nbsp;<img src="images/Order_16.gif" align="absmiddle" />&nbsp;总固顶主题 ‖<img src="images/top.gif" align="absmiddle" />&nbsp;固顶主题 ‖ <img src="images/Order_18.gif" align="absmiddle" />&nbsp;精华帖子 ‖ <img src="images/Order_19.gif" align="absmiddle" />&nbsp;投票贴子 ‖ <img src="images/Order_15.gif" align="absmiddle" />&nbsp;锁定的主题 ‖ <img src="images/Order_13.gif" align="absmiddle" />&nbsp;开放的主题</font><br>
            <br>
            </div>
            <div align="center"></div>
            <p>&nbsp;</p>
          <p>&nbsp;</p></td>
        </tr>
    </table></td>
  </tr>
</table><%end sub%>
<!--#include file="../copyright.asp"-->                                                                                                 
