www.gusucode.com > 仿MOP对开式论坛程序 1.0源码程序 > reply.asp

    <%@language="VBScript"%>
<!--#include file="title.asp"-->
<!--#include file="sub.asp"-->
<%
Dim id,recontent
id=Request.QueryString("id")
if IsNumeric(id) then
id=Clng(id)
else
id="0"
end if
contents=contents &"<title>回复帖子-"& caption &"</title>"&_
"</head>"&_
"<body>"&_
""&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"
if gbmaduser="" then
recontent=recontent &"document.write('<tr><td><br>你还没登陆或者已经掉线,请<a href=""../../login.asp"">登陆</a>。<br><br></td></tr>');"
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你还没登陆或者已经掉线。<br>请<a href=""login.asp"">登陆></a>,2秒后自动执行<Script Language=""JavaScript"">setTimeout(""location.href='login.asp'"",3000)</script>。<br><br></td></tr>"
else
if validate<>creatvalidate(gb+imprison,ip) then
recontent=recontent &"document.write('<tr><td><br>验证Cookies信息出错,请<a href=""../../login.asp"">重新登陆</a>。<br>引起该错误的原因可能是因为你手动修改了Cookies。<br><br></td></tr>');"
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>验证Cookies信息出错,请<a href=""login.asp"">重新登陆</a>。<br>引起该错误的原因可能是因为你手动修改了Cookies。<br><br></td></tr>"
else
if imprison="1" or imprison="4" or imprison="5" or imprison="7" then
recontent=recontent &"document.write('<tr><td><br>你因为违反社区条例,被禁止发贴。具体可以查看<a href=""../../report.asp"">异动报告</a>。<br><br></td></tr>');"
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你因为违反社区条例,被禁止发贴。具体可以查看<a href=""report.asp"">异动报告</a>。<br><br></td></tr>"
else
dim ntsql,nfsql,topicid,content,face,remark,aboutlink,imglink,anonymity,htmlyes,erryes,unreply,upyes,link,forumid,forumtype,savecookies,tempreply
topicid=Request.Form("topicid")
if IsNumeric(topicid) then
topicid=Clng(topicid)
else
topicid="0"
end if
htmlyes=Request.Form("htmlyes")
upyes=Request.Form("upyes")
if gb>99 and htmlyes="yes" then
content=Trim(contentcode(Request.Form("content"),1))
else
content=Trim(contentcode(Request.Form("content"),0))
end if
aboutlink=Trim(Replace(Replace(Request.Form("aboutlink"),"http://http://","http://"),"http://..",".."))
imglink=Trim(Replace(Replace(Request.Form("imglink"),"http://http://","http://"),"http://..",".."))
anonymity=Request.Form("anonymity")
face=Request.Form("face1") & Request.Form("face2")
savecookies=Request.Cookies(bbssn)("savecookies")
tempreply=Request.Cookies("temp")("reply")
if topicid>0 and content<>"" then
if IsNull(bbsadmin) or bbsadmin="" then
ntsql=" and typeshow=1"
nfsql=" and forumshow=1"
end if
rs.Open "Select forumid,link,unreply From topic Where id="& topicid,conn,1,1
if rs.Eof then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你要回复的帖子不存在。<br>请确定你是通过正常方式回复,如果依旧出错,请<a href=""sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><br></td></tr>"
erryes="yes"
elseif rs("unreply")=1 then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>帖子被设为禁止回复。<br>请确定你是通过正常方式回复,如果依旧出错,请<a href=""sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><br></td></tr>"
erryes="yes"
else
if Left(content,20)=tempreply then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你的回复已经提交了,请<a href=""topic/"& rs("link") &""">刷新帖子</a>。<br>引起该错误的原因可能是因为你重复提交该回复。<br>如果刷新帖子列表后依旧不能看到你发表的帖子请<a href=""sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><br></td></tr>"
erryes="yes"
end if
forumid=rs("forumid")
end if
rs.Close
if erryes<>"yes" then
rs.Open "forum Where id="& forumid & nfsql,conn,1,1
if rs.Eof then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你要回复的帖子所在版面不存在或者是隐藏的。<br>请确定你是通过正常方式回复,如果依旧出错,请<a href=""sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><br></td></tr>"
erryes="yes"
else
forumtype=rs("forumtype")
end if
rs.Close
end if
if erryes<>"yes" then
rs.Open "forumtype Where id="& forumtype & ntsql,conn,1,1
if rs.Eof then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你要回复的帖子所在版面不属于任何的分类或者是分类隐藏的。<br>请确定你是通过正常方式回复,如果依旧出错,请<a href=""sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><br></td></tr>"
erryes="yes"
end if
rs.Close
end if
if face>0 and face<100 then remark="<br><img src=""../../face/"& face &".gif"" border=""0"">"
if Left(aboutlink,7)<>"http://" then aboutlink=Replace("http://"& aboutlink,"http://..","..")
if Left(imglink,7)<>"http://" then imglink=Replace("http://"& imglink,"http://..","..")
if erryes<>"yes" then
rs.Open "Select userpwd,replypiece,gb From gbmaduser Where gbmaduser='"& gbmaduser &"'",conn,1,3
if Not rs.Eof then
if rs("userpwd")=userpwd then
rs("replypiece")=rs("replypiece")+1
if anonymity="yes" then rs("gb")=rs("gb")-anonymitygb
rs.Update
if savecookies="yes" then Response.Cookies(bbssn).expires=Date()+365
gb=rs("gb")
Response.Cookies(bbssn)("gb")=gb
Response.Cookies(bbssn)("validate")=creatvalidate(gb+imprison,ip)
else
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>密码验证错误,请<a href=""login.asp"">重新登陆</a>。<br>引起该错误的原因可能是因为你手动修改了Cookies。<br><br></td></tr>"
erryes="yes"
end if
else
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>不存在的用户,请<a href=""login.asp"">重新登陆</a>。<br>引起该错误的原因可能是因为你手动修改了Cookies。<br><br></td></tr>"
erryes="yes"
end if
rs.Close
end if
if erryes<>"yes" then
if anonymity<>"yes" then
rs.Open "remark Where gbmaduser='"& gbmaduser &"'",conn,1,3
if Not rs.Eof then
remark=remark & rs("content")
if rs("amount")=1 then
rs.Delete
else
rs("amount")=rs("amount")-1
rs.Update
end if
end if 
rs.Close
end if
rs.Open "reply Where id=0",conn,1,3
rs.AddNew
rs("content")=content
rs("remark")=remark
if anonymity="yes" then rs("anonymity")=anonymitycode(ip)
if bbsadmin>0 then rs("admincolor")=bbsadmin
rs("gbmaduser")=gbmaduser
rs("posttime")=Now()
rs("topicid")=topicid
if aboutlink<>"http://" then rs("aboutlink")=aboutlink
if imglink<>"http://" then rs("imglink")=imglink
rs.Update
rs.Close
rs.Open "Select reply,lastupdate,lastuser,link,unreply From topic Where id="& topicid,conn,1,3
if rs("reply")>198 then rs("unreply")=1
rs("reply")=rs("reply")+1
if upyes="yes" then rs("lastupdate")=Now()
if anonymity="yes" then
rs("lastuser")="神秘人物"& anonymitycode(ip)
else
rs("lastuser")=gbmaduser
end if
link=rs("link")
rs.Update
rs.Close
Response.Cookies("temp")("reply")=Left(content,20)
call creattopic(topicid)
call connclose
Response.Redirect "topic/"& link
end if
elseif id>0 then
rs.Open "Select posttime,click,reply,unreply,topictype From topic Where id="& id,conn,1,3
if Not rs.Eof then
rs("click")=rs("click")+1
unreply=rs("unreply")
'if (rs("reply")>10 or (Not IsNull(rs("topictype")))) and Datediff("d",rs("posttime"),Now())<30 then upyes="yes"
upyes="yes"
rs.Update
else
erryes="yes"
end if
rs.Close
if erryes="yes" then
recontent=recontent &"document.write('<tr><td><br>非法调用或者程序出错。<br>请确定你是通过正常方式进行操作,如果依旧出错,请<a href=""../../sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><br></td></tr>');"
elseif unreply=1 then
recontent=recontent &"document.write('<tr><td><br>帖子被设为禁止回复。<br><br></td></tr>');"
else
recontent=recontent &"function validinput()"&_
"{"&_
"if (document.reply.content.value.length==0){"&_
"alert(""请填写好回复内容。"");"&_
"document.reply.content.focus();"&_
"return false;"&_
"}"&_
"document.reply.button.disabled=""true"";"&_
"return true;"&_
"}"&_
"function showimg()"&_
"{"&_
"face_1=document.reply.face1.value;"&_
"face_2=document.reply.face2.value;"&_
"face=""../../face/""+face_1+face_2+"".gif"";"&_
"show_file='<img src='+face+'>';"&_
"document.all.show.innerHTML=show_file;"&_
"}"&_
"function resend()"&_
"{"&_
"if ((event.altKey==true && event.keyCode==83) || (event.ctrlKey==true && event.keyCode==13))"&_
"{"&_
"document.reply.button.click();"&_
"}"&_
"}"&_
"document.write('<tr class=""tds""><td>"&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" onkeydown=""resend();"" title=""可以使用Alt+S或者Ctrl+Enter直接提交发言。"">"&_
"<form name=""reply"" onsubmit=""return validinput();"" method=""post"" action=""../../reply.asp"">"&_
"<tr><td valign=""top"" width=""64"">回复内容:</td><td><textarea name=""content"" rows=""10"" cols=""50""></textarea><a id=""show""></a></td></tr>"&_
"<tr><td>相关链接:</td><td><input name=""aboutlink"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin"" value=""http://""></td></tr>"&_
"<tr><td>相关图片:</td><td><input name=""imglink"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin"" value=""http://""></td></tr>"&_
"<tr><td>  表情:</td><td><select name=""face1"" size=""1"" onchange=""showimg()""><option value=""0"">0</option><option value=""1"">1</option></select><select name=""face2"" size=""1"" onchange=""showimg()""><option value=""0"">0</option><option value=""1"">1</option><option value=""2"">2</option><option value=""3"">3</option><option value=""4"">4</option><option value=""5"">5</option><option value=""6"">6</option><option value=""7"">7</option><option value=""8"">8</option><option value=""9"">9</option></select>"&_
" <font title=""选择上之后你回复时帖子将被UP到列表前端""><input name=""upyes"" type=""checkbox"" value=""yes"""
if upyes="yes" then recontent=recontent &" checked"
recontent=recontent &">UP帖子</font>"
if gb>99 then recontent=recontent &" <font title=""选择上之后你回复的信息里就可以使用html语法了""><input name=""htmlyes"" type=""checkbox"" value=""yes"" checked>HTML</font>"
if gb>149 then recontent=recontent &" <font title=""选择上之后你的ID将显示为 神秘人物??????,但是会扣除"& anonymitygb & gbname &"""><input name=""anonymity"" type=""checkbox"" value=""yes"">隐身回复</font>"
recontent=recontent &" <input type=""hidden"" name=""topicid"" value="""& id &"""><input name=""button"" type=""submit"" value=""提交"" onmouseover=this.className=""over""; onmouseout=this.className=""out""; class=""out""></td></tr></form></table>"&_
"</td></tr>');"
end if
else
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>非法调用或者程序出错。<br>请确定你是通过正常方式进行操作,如果依旧出错,请<a href=""sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
end if
end if
end if
end if
contents=contents &"</table>"&_
""
if id>0 then
Response.Write recontent
call connclose
Response.End
end if
%>
<!--#include file="bottom.asp"-->