<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/count.asp"-->
<!--#include file="../page.asp"-->
<!--#include file="../count.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
if isChkInteger(request("web_id")) then
web_id=request("web_id")
else
Response.Redirect ("../../index.asp")
end if
if isChkInteger(request("id")) then
id=request("id")
else
Response.Redirect ("../../index.asp")
end if
s = request.querystring("s")
if nosql(request("action"))="reply" then
title=nosql(trim(Replace(Request.Form("title"),vbcrlf," ")))
body=nosql(request.form("body"))
username=nosql(session("user"))
web_id=web_id
if len(body)<1  then
response.write"<script language='javascript'>alert('对不起，内容不能小于一个字符')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from snsn_bbs"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("body")=body
rs("username")=username
rs("faceimg")=1
rs("hits")=0
rs("reply")=0
rs("wdate")=now()
rs("ldate")=now()
rs("userid")=web_id
rs("replyid")=id
rs.update


'雨露(会员回贴非自已)
Set hua1= Server.CreateObject("ADODB.Recordset") 
hua1.open "select snsn_bbs.username,snsn_user.id from snsn_bbs,snsn_user where snsn_bbs.username=snsn_user.username and snsn_bbs.id="&id,conn,1,3
if hua1(0) <>session("user")   then

Set hua= Server.CreateObject("ADODB.Recordset") 
hua.open "select * from snsn_hua where userid="&hua1(1),conn,3,3
if not hua.eof then 
if hua("yl")<hua("max1")  then
if datediff("d",hua("yldate"),now)>=1 then
hua("dayyl")=0
hua("yldate")=now()
hua.update
end if
if hua("dayyl")<8 then
hua("dayyl")=hua("dayyl")+1
hua("yl")=hua("yl")+1
hua.update

end if
end if
end if
end if
'end 雨露




rid=rs("id")
rs.close
set rs=nothing
set rs1=conn.execute("update snsn_bbs set reply=reply+1 where id="&id&"")
Response.Redirect ("view.asp?web_id="&web_id&"&id="&id&"&#r"&rid&"")
elseif nosql(request("action"))="del" then
sql="delete from [snsn_bbs] where id="&id
conn.execute sql
Response.Redirect ("bbs.asp?web_id="&web_id&"")
else
sql="select * from snsn_bbs where userid="&web_id&" and id="&id
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,3
	if rs.eof and rs.bof then
response.write "<script language='javascript'>"
response.write "alert('没有此页，请确认后或联系管理员再访问本页！');"
response.write"this.location.href='bbs.asp';</SCRIPT>"
response.end
	else
rs("hits")=rs("hits")+1
rs.update
%>
<html>
<style type="text/css">
<!--
.style4 {color: #FF3300}
-->
</style>
<head><title>欢迎访问论坛-<%=rs("title")%></title>
<link rel="stylesheet" href="css.css" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #0000FF}
.style3 {
	color: #FF3300;
	font-weight: bold;
}
.style6 {color: #FF0000; font-weight: bold; }
-->
</style>
<body bgcolor="#ffffff">
<%while not rs.eof
retitle = rs("title") 
parent = rs("id")%>
<table width="420"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="420"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="1" height="1"></td>
          <td height="1" colspan="2" bgcolor="#CCCCCC"></td>
          <td width="1" height="1"></td>
        </tr>
        <tr>
          <td width="1" bgcolor="#CCCCCC"></td>
          <td width="30" bgcolor="#F1F1F1"><div align="center"><span class="M"><IMG 
                              src="img/icon_03.gif" 
                              name=image1754891 width="14" height="14" border=0></span></div></td>
          <td height="25" bgcolor="#F1F1F1"><span class="M"><FONT 
                              color=#000000><a href="web.asp?web_id=<%=web_id%>"><U><%=home%></U></a></FONT> -&gt; <FONT 
                              color=#000000><a href="bbs.asp?web_id=<%=web_id%>"><U><%=lt%></U></a></FONT> -&gt; <FONT 
                              color=#000000>
          <%set rs3=conn.execute("select * from [snsn_bbs_class] where id = "&rs("classid"))
	if rs3.eof and rs3.bof then
      response.write "总分类"
	else
	if rs3("xs")=1 then
  if session("id")="" then 
  response.write "<script language='javascript'>"
  response.write "alert('对不起，此分类只对登录会员显示！');"
  response.write"this.location.href='bbs.asp?web_id="&web_id&"';</SCRIPT>"
  response.end
  end if
end if
if rs3("xs")=2 and rs3("userid")<>session("id")  then
  u_id=session("id")
  if web_id<>u_id then 
  response.write "<script language='javascript'>"
  response.write "alert('对不起，此分类不对外显示！');"
  response.write"this.location.href='bbs.asp?web_id="&web_id&"';</SCRIPT>"
  response.end
  end if
end if%>
          <a href="bbs_c.asp?web_id=<%=web_id%>&id=<%=rs3("id")%>"><U><%=rs3("bbsname")%></U></a><font 
                              color=#000000>
          <%end if%>
          </font></FONT> -&gt; <FONT 
                              color=#000000><U>帖子</U></FONT> -&gt; <FONT 
                              color=#000000><a href="bbs_add.asp?web_id=<%=web_id%>"><U>发表新帖</U></a></FONT> </span></td>
          <td width="1" bgcolor="#CCCCCC"></td>
        </tr>
        <tr>
          <td width="1" height="1"></td>
          <td height="1" colspan="2" bgcolor="#CCCCCC"></td>
          <td width="1" height="1"></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="10" valign="bottom"></td>
  </tr>
</table>
<table width=410 align="center">
  <tr>
    <td><a href="bbs.asp?web_id=<%=web_id%>&s=<%=s%>"><font color="#FF0000"><b><img src="img/fh.gif" width="64" height="18" border="0"></b></font></a> <a href="bbs_add.asp?web_id=<%=web_id%>"><img src="img/fbbbs.gif" width="64" height="18" border="0"></a> <a href="bbs_reply.asp?web_id=<%=web_id%>&id=<%=id%>"><img src="img/hfbbs.gif" width="64" height="18" border="0"></a></td>
    <td width=10% align=center>&nbsp;</td>
  </tr>
</table>
<table cellspacing="1" cellpadding="4" width="410" border="0" class="a2" bgcolor="#CCCCCC" align="center">

<tr class="a1"><td bgcolor="efefef"><table width=100% border="0" cellpadding="0" cellspacing="0"><tr>
  <td width="81%"><b><img src="img/icon_03.gif" width="14" height="14"> 主题：<font color="#0000FF"><%=rs("title")%></font></b></td>
<td width=19% align=center><span class="style6">队长</span></td>
</tr></table></td>
</tr>

<tr class="a3"><td bgcolor="f9f9f9">&nbsp;作者：<%=rs("username")%>&nbsp;<img src=img/time.gif> <%=rs("ldate")%> 浏览：<span class="style1"><%=rs("hits")%></span> 回复：<span class="style2"><%=rs("reply")%></span></td>
</tr>

<tr class="a3"  style="word-break:break-all;">
  <td bgcolor="f9f9f9"><img src=img/Mood/<%=rs("faceimg")%>.gif width="20" height="20">
<%show=rs("body")
if rs("zshow")=1 then
response.write Plus_ChkPicWords(htmltotext(show))
else
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="\[qq@*([0-9]*)\]"
show=re.Replace(show,"&nbsp;<img src=../QQ/gif/$1.gif border=0 alt='点击看我超酷表演' onmouseover=ShowQQ('$1'); style='cursor: hand;border:1px border-collapse: collapse; border-style: dotted;'>")
response.write show
end if
%></td>

<tr class="a4">
  <td height=9 valign=top bgcolor="f9f9f9" class=365ye><img src="img/h.gif" width="5" height="11">
    <%
          url=""&weburl&"view.asp?web_id="&web_id&"&id="&id&""
		  url1="view.asp?web_id="&web_id&"&id="&id&""%>    <a href="<%=url1%>"><%=url%></a><a href=javascript: onclick=clipboardData.setData('Text','<%=url%>') >复制</a> <a href=#replay class="style4">回复</a> 
    <%if session("id")=cint(web_id) or session("user")=rs("username") then%>
   <a href="bbs_save.asp?web_id=<%=web_id%>&id=<%=rs("id")%>&bid=<%=id%>"> <span class="style1">编辑</span></a>
    <%end if%> <%if session("id")=cint(web_id) then%>
   <a href="?web_id=<%=web_id%>&action=del&id=<%=rs("id")%>"> <span class="style1">删除</span></a>
    <%end if%></td>
  </tr>
<%rs.movenext
wend
sql="select * from snsn_bbs where replyid = "& id &" order by id"
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof or rs.bof then 
response.write "&nbsp;暂无回复，您要<a href=#replay>回复</a>吗?" 
else
rs.PageSize =20 '每页记录条数
		iCount=rs.RecordCount '记录总数
		iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    	per_page=rs.PageSize
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	For i=1 To x
%>
<tr  height="10"><td height="20" bgcolor="#FFFFFF"></td>
</tr>

<tr class="a1"><td bgcolor="efefef"><table width=100% border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="81%"><span class="style3"><img src="img/icon_c5.gif" width="10" height="12"> <%=rs("title")%></span><a name="r<%=rs("id")%>"></a></td>
  <td width=19% align=center><strong>NO<font color="#FF0000"><%=rs("id")%></font></strong></td>
  </tr></table></td>
</tr>

<tr class="a3"><td bgcolor="#FFFFFF">&nbsp;作者：<%=rs("username")%>&nbsp;<img src=img/time.gif> <%=rs("ldate")%></td>

<tr class="a4" ><td height=19 valign=top bgcolor="#FFFFFF"  style="word-break:break-all;"><img src=img/Mood/<%=rs("faceimg")%>.gif width="20" height="20">
  <%show=rs("body")
if rs("zshow")=1 then
response.write Plus_ChkPicWords(htmltotext(show))
else
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="\[qq@*([0-9]*)\]"
show=re.Replace(show,"&nbsp;<img src=../QQ/gif/$1.gif border=0 alt='点击看我超酷表演' onmouseover=ShowQQ('$1'); style='cursor: hand;border:1px border-collapse: collapse; border-style: dotted;'>")
response.write show
end if
  %> </td></tr>
<tr class="a4">
  <td height=20 valign=top bgcolor="#FFFFFF" class=365ye><img src="img/h.gif" width="5" height="11">
    <%
          url=""&weburl&"view.asp?web_id="&web_id&"&id="&id&""
		  url1="view.asp?web_id="&web_id&"&id="&id&""%>    <a href="<%=url1%>"><%=url%></a><a href=javascript: onclick=clipboardData.setData('Text','<%=url%>') >复制</a> <a href=#replay class="style4">回复</a> 
    <%if session("id")=cint(web_id) or session("user")=rs("username") then%>
   <a href="bbs_save.asp?web_id=<%=web_id%>&id=<%=rs("id")%>&bid=<%=id%>"> <span class="style1">编辑</span></a>
    <%end if%> <%if session("id")=cint(web_id) then%>
    <a href="?web_id=<%=web_id%>&action=del&id=<%=rs("id")%>"><span class="style1">删除</span></a>
    <%end if%></td>
</tr>
<%RS.MoveNext
next
end if
%></table><TABLE width="100%" 
        border=0 align="center" cellPadding=4 cellSpacing=0>
            <TBODY>
              <TR>
                <TD class=M noWrap align=middle><%
					call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)
				  %></TD>
              </TR>
            </TBODY>
      </TABLE>
<%if session("user")<>"" then%><table cellspacing="1" cellpadding="2" width="410" border="0" class="a2" bgcolor="#FFFFFF" align="center">
<tr background="img/xbj.gif" height="1"><td height="1" background="img/xbj1.gif"></td></tr>
<form method="POST" action="?web_id=<%=web_id%>&action=reply&id=<%=id%>"><tr class="a1">
<td><br><b>　回复此内容帖</b><a name=#replay></a><b> ( 带 
<font color="#FF0000">*</font> 为必填选项 )</b></td></tr>
<tr class="a4">
  <td>　姓名：&nbsp;    <input name="username" type="text" class="wenbenkuang" id="username" value="<%=session("user")%>" size="21"  maxlength="8"> 
    <font color="#FF0000">*</font> </td>
  </tr>
<tr class="a4">
  <td>　标题：&nbsp;    <input name="title" type="text" class="wenbenkuang" value="回复：<%=retitle%>" size="34"  maxlength="25">    <font color="#FF0000">*</font></td>
  </tr>
<tr class="a3">
  <td>　内容：&nbsp;    <textarea name="body" cols="52" rows="6" class="wenbenkuang" id="body"></textarea> 
    <font color="#FF0000">*</font></td>
  </tr>
<tr class="a4"><td align="center"><input name="B1" type="submit" class="go-wenbenkuang" value="确认发表"> 　　<input name="B2" type="reset" class="go-wenbenkuang" value="取消发送"></td></tr>
</form></table>
<%end if
end if
end if%>
</body></html>