<!--#include file="conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="../webconfig.asp"-->
<!--#include file="../fuction.asp"-->

<!--#include file="../webtop.asp"-->
<%id=int(Request.querystring("id"))
set rsx=server.createobject("adodb.recordset")
rsx.open "Select * From book where id="&id,conn,1,1
if rsx.recordcount=0 then 
response.write"<SCRIPT language=JavaScript>alert('该帖子不存在，可能已被删除！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end 
end if
forumid=Conn.Execute("Select bid From book where id="&id)(0)
sql="select * from board where bid="&forumid&""
Set Rs1=Conn.Execute(sql)

if rs1.EOF or rs1.bof  then
response.write"<SCRIPT language=JavaScript>alert('该帖子不存在，可能已被删除！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end 
end if
bidname=rs1("bidname")
bid=rs1("bid")
if rs1("rzh")=1 and session("manbid")<>20000 then
username2=rs1("username")
	username2=trim(username2)
	if username2<>"" then 
	  bsort2=split(username2,",")
	  for i=0 to ubound(bsort2)
	  bsortb2=bsort2(i)
	  bsortb2=trim(bsortb2)
	  user_name=session("username")
	       if instr(user_name,bsortb2)>0 then
		        if ll=0 then%>
               <%call bbs%>
               <%else%>
                   <%if session("username")="" then
                   response.redirect"login.asp"
                   else%>
                   <%call bbs%>
                   <%end if%>
                <%end if
	       end if
	  
	   next
	 end if
	else
	       if ll=0 then%>
           <%call bbs%>
           <%else%><%
              if session("username")="" then
              response.redirect"login.asp"
              else%><%call bbs%>
             <%end if%>
           <%end if
end if
%>
<%sub bbs()
set rs=server.createobject("adodb.recordset")
if Request.querystring("action")="next" then
sql="select top 1 * from book where id < "&id&"  and bid="&forumid&" and type=0"
elseif Request.querystring("action")="Previous" then
sql="select top 1 * from book where id > "&id&"  and bid="&forumid&" and type=0  "
else
sql="select * from book where ID="&id&" or fid=" &id& ""
end if

rs.open sql,conn,1,3

if rs.EOF or rs.bof  then
response.write"<SCRIPT language=JavaScript>alert('到顶了！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end 
end if

%>
<table width="1000" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="6" colspan="3"></td>
  </tr>
  <tr>
    <td width="20"></td>
    <td valign="bottom"><img src="<%=weburl%>images/arrow01.gif" width="11" height="11" /> Your present position: <a href="<%=weburl%>"><%=webname%></a> -> <span class="table-shangxia"><span class="b14"><a href=index.asp><%=bbsname%></a> → <a href=list.asp?bid=<%=bid%>><%=bidname%></a> → <%=rs("title")%> <%=bsortb2%></span></span></td>
    <td valign="bottom"></td>
  </tr>
  <tr>
    <td height="6" colspan="3"></td>
  </tr>
</table>
<!--#include file="top.asp"-->

<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="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="8"></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">

              <tr >
                <td height="20" colspan="2"><table width="100%" height="30"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td><img src="images/Order_27.gif" width="13" height="12" align="absmiddle"> <a href="?action=Previous&id=<%=rs("id")%>">上一篇</a>&nbsp; <img src="images/Order_28.gif" width="13" height="12" align="absmiddle"> <a href="javascript:this.location.reload()">刷 新</a>&nbsp;<a href="?action=next&id=<%=rs("id")%>">下一篇</a> <img src="images/Order_30.gif" width="13" height="12" align="absmiddle"> </td>
                <td width="90" align="center" bgcolor="#FFFFFF"><div align="center"><a href="reg.asp" target="_blank"> </a><a href="post.asp?bid=<%=bid%>"><img src="images/fb.gif" width="80" height="20" border="0"></a></div></td>
                <td width="90" align="center" bgcolor="#FFFFFF"><a href="reply.asp?bid=<%=bid%>&id=<%=id%>&title=<%=rs("title")%>"><img src="images/hf.gif" width="80" height="20" border="0"></a></td>
                <td width="90" align="center" bgcolor="#FFFFFF"><a href="smallpaper.asp?bid=<%=bid%>"><img src="images/xb.gif" width="80" height="20" border="0"></a></td>
                </tr>
            </table>
                  <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="8"></td>
                    </tr>
                  </table>
                  <div align="center">
                      <center>
                        <table width="100%"  border="0" cellpadding="1" cellspacing="1" bgcolor="999999">
                          <%shownum=10                  
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                 
number=1                
for i=1 to rs.pagesize and not rs.bof  

body=rs("body")
body=forhtml(body)
'''''''投票''''''''
if rs("vote_title")<>"" then
if rs("vote_dx")=1 then
vote_dx="checkbox"
else
vote_dx="radio"
end if
body=""&body&"<form action=vote.asp?id="&rs("id")&" method=POST><table><tr><td><table>"
vote=split(rs("vote_title"),"|")
for n = 0 to ubound(vote)
if not vote(n)="" then
body=""&body&"<tr><td height=22 valign=bottom>"&n+1&".<input type="&vote_dx&" value="&n&" name=postvote id=postvote"&n&"><label for=postvote"&n&">"&vote(n)&"</label></td></tr>"
end if
next
body=""&body&"</table></td><td><table>"
allticket=0
vote=split(rs("vote_body"),"|")
for m = 0 to ubound(vote)
if not vote(m)="" then
body=""&body&"<tr><td height=22 valign=bottom>票数："&vote(m)&"</td></tr>"
allticket=vote(m)+allticket
end if
next
body=""&body&"</table></td><td><table>"
vote=split(rs("vote_body"),"|")
for mm = 0 to ubound(vote)
if not vote(mm)="" and allticket<>0 then
body=""&body&"<tr><td height=22 valign=bottom><img src=images/0.gif width="&vote(mm)/allticket*100&" height=10> ["&formatnumber(vote(mm)/allticket*100)&"%]</td></tr>"
end if
next
body=""&body&"</table></td></tr><TR><TD align=center><INPUT type=submit value=投　票  class=go-wenbenkuang></TD><td colspan=5 align=center><a href=vote.asp?menu=look&id="&id&">[查看参与投票的用户列表]</a></td></TR></table></form>"
end if


'''''''结束投票''''''''

 %>
                        

 <%set rs2=conn.execute("select * from shop_user where username='"&rs("username")&"' ")
 if not rs2.eof then
 this_zw = rs2("zw")
 end if
 
 if this_zw="普通会员" then
 dj="images/level2.gif"
 elseif this_zw="斑竹" then
  dj="images/level1.gif"
 elseif this_zw="管理员" then
   dj="images/level0.gif"
 elseif this_zw="超级管理员" then   
 dj="images/level.gif"
 else
 dj="images/level2.gif"
 end if
 %>                 
<script>show_bbs('<%=rs("title")%>','<%=rs("type")%>','<%=rs("hits")%>','<%=request.querystring("page")%>','<%=number%>','<%=rs2("username")%>','<%=rs2("pic")%>','<img src=<%=dj%> >','<%=rs2("zw")%>','<%=rs2("topic")%>','<%=year(rs2("adddate"))&"年"&month(rs2("adddate"))&"月"&day(rs2("adddate"))&"日"%>','<%=rs2("yucun")%>','<%=rs2("jifen")%>','<%=rs2("useremail")%>','<%=rs("lock")%>','<%=body%>','<%=rs2("content")%>','<%=year(rs2("adddate"))&"年"&month(rs2("adddate"))&"月"&day(rs2("adddate"))&"日"%>','<%=rs("wdate")%>','<%=rs("id")%>','<%=bid%>','<%=rs("gd")%>','<%=rs("lock")%>','<%=rs("good")%>','<%=rs("fid")%>','<%=weburl%>');                
</script>                
 <%                  
number=number+1                  
rs.movenext                 
if rs.eof then exit for                 
next                  
 %> 
                        </table>
                      </center>
                  </div></td>
              </tr>
            </table>
            <div align="center">
              <center>
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                  <tr>
                    <td width="387" bgcolor="#FFFFFF">本页贴数：<%=totalrecord%> 分页：
                        <%if request.querystring("page")="" then %>
          1
          <%else%>
          <%=request.querystring("page")%>
          <%end if%>
          / <%=maxpage%>页 每页：<%=shownum%></td>
                    <td width="375" bgcolor="#FFFFFF">
                      <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=?bid="&bid&"&id="&id&"&page=1 title=首页><font face=webdings>9</font></a>"                  
end if                  
if p*10>0 then response.write "<a href=?bid="&bid&"&id="&id&"&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                  
response.write "<a href=?bid="&bid&"&id="&id&"&page="&ii&">"&ii&"</a>"                  
end if                  
if ii=maxpage then exit for                  
next                  
response.write "</b>"                  
if ii<maxpage then response.write "<a href=?bid="&bid&"&id="&id&"&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=?bid="&bid&"&id="&id&"&page="&maxpage&" title=尾页><font face=webdings>:</font></a>"                  
end if                  
response.write" 总共有"&maxpage&"页"  %>
                    </td>
                  </tr>
                  <tr>
                    <form method="post" action="list.asp?bid=<%=bid%>">
                      <td width="387" bgcolor="#FFFFFF" rowspan="3">快速查找：
                          <input name="findstr" type="text" class="wenbenkuang" size="20">
                          <input name="Submit2" type="submit" class="go-wenbenkuang" value="查 找">
                    </form>
                    <td width="375" bgcolor="#FFFFFF">
                      <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>
                    </p></td>
                  </tr>
                </table>
              </center>
            </div>
            <%set rs2=conn.execute("select * from book  where ID="&id&" ")%>
            <%if session("username")=empty then                
  disabled="disabled"                 
  re_body="请登陆论坛"                
  end if%>
            <script language="javascript">                
function CheckForm(form){                
document.esung.submit.disabled = true;                
}</script>
            <form method="post" action="save_reply.asp?bid=<%=bid%>&id=<%=id%>"  name="esung" onSubmit="return CheckForm(this);">
              <div align="center">
                <center>
                  <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="8"></td>
                    </tr>
                  </table>
                  <table width="95%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="781">
                        <table border="0" cellpadding="0" cellspacing="0" width="758" height="128">
                          <tr>
                            <td width="127" height="30">
                              <p align="center">回复主题</td>
                            <td width="631" height="25"><input type="text" name="title" size="70" class="wenbenkuang" value="re:<%=rs2("title")%>"></td>
                          </tr>
                          <tr>
                            <td width="127" height="82">
                              <p align="center">回复内容</td>
                            <td width="631" height="82"><textarea rows="6" name="body" cols="80" class="wenbenkuang"><%=re_body%></textarea></td>
                          </tr>
                          <tr>
                            <td width="127" height="21"></td>
                            <td width="631" height="21">
                              <p>
                                <input type="submit" value="提交" name="submit" class="go-wenbenkuang" <%=disabled%>>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="reset" value="全部重写" name="B2" class="go-wenbenkuang"  <%=disabled%>>
                            </td>
                          </tr>
                      </table></td>
                    </tr>
                  </table>
                </center>
              </div>
            </form>
            <p>&nbsp;</p></td>
        </tr>
    </table></td>
  </tr>
</table>
<div align="center">
  <%end sub%>
  
  <!--#include file="../copyright.asp"--></div>  