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

    <%@language="VBScript"%>
<!--#include file="title.asp"-->
<!--#include file="sub.asp"-->
<%
contents=contents &"<title>回复管理-"& caption &"</title>"&_
"</head>"&_
"<body>"&_
""&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"
if gbmaduser="" then
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
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
Dim id,replyid,content,remark,aboutlink,imglink,delreply,replyer,deler,topicid,erryes,forumid,typeid,forumadmin,link
id=Request.QueryString("id")
if IsNumeric(id) then
id=Clng(id)
else
id="0"
end if
replyid=Request.Form("replyid")
if IsNumeric(replyid) then
replyid=Clng(replyid)
else
replyid="0"
end if
if gb<99 then
content=Trim(contentcode(Request.Form("content"),0))
else
content=Trim(contentcode(Request.Form("content"),1))
end if
aboutlink=Trim(Request.Form("aboutlink"))
imglink=Trim(Request.Form("imglink"))
delreply=Request.QueryString("delreply")
if IsNumeric(delreply) then
delreply=Clng(delreply)
else
delreply="0"
end if
if replyid>0 and content<>"" then
rs.Open "Select userpwd From gbmaduser Where gbmaduser='"& gbmaduser &"'",conn,1,1
if Not rs.Eof then
if rs("userpwd")<>userpwd then
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
if erryes<>"yes" then
rs.Open "Select gbmaduser,topicid From reply Where id="& replyid,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=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
replyer=rs("gbmaduser")
topicid=rs("topicid")
end if
rs.Close
end if
if erryes<>"yes" then
rs.Open "Select forumid,link 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=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
link=rs("link")
forumid=rs("forumid")
end if
rs.Close
end if
if erryes<>"yes" then
if forumid>0 then
rs.Open "forum Where id="& forumid,conn,1,1
if Not rs.Eof then
typeid=rs("forumtype")
if Instr(LCase(rs("forumadmin")),"{gb|mad}"& LCase(gbmaduser) &"{gb|mad}")>0 then forumadmin="yes"
end if
rs.Close
end if
if typeid>0 then
if forumadmin<>"yes" then
rs.Open "forumtype Where id="& typeid &" and typeadmin Like '%{gb|mad}"& gbmaduser &"{gb|mad}%'",conn,1,1
if Not rs.Eof then forumadmin="yes"
rs.Close
end if
end if
if LCase(replyer)=LCase(gbmaduser) or forumadmin="yes" or bbsadmin>2 then
rs.Open "Select content,aboutlink,imglink From reply Where id="& replyid,conn,1,3
rs("content")=content &"<br>"& vbcrlf &"<div class=""editer"">该回复最后被 "& gbmaduser &" 编辑于"& Now() &"。</div>"
rs("aboutlink")=aboutlink
rs("imglink")=imglink
rs.Update
rs.Close
call creattopic(topicid)
call connclose
Response.Redirect "topic/"& link
end if
end if
elseif id>0 then
rs.Open "reply Where id="& id,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=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
replyer=rs("gbmaduser")
content=Replace(Replace(Replace(rs("content"),"<br>"& vbcrlf,vbcrlf),"&lt;","<"),"&gt;",">")
aboutlink=rs("aboutlink")
imglink=rs("imglink")
remark=rs("remark")
topicid=rs("topicid")
deler=rs("deler")
end if
rs.Close
if erryes<>"yes" then
rs.Open "Select forumid 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=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
forumid=rs("forumid")
end if
rs.Close
end if
if erryes<>"yes" then
if forumid>0 then
rs.Open "forum Where id="& forumid,conn,1,1
if Not rs.Eof then
typeid=rs("forumtype")
if Instr(LCase(rs("forumadmin")),"{gb|mad}"& LCase(gbmaduser) &"{gb|mad}")>0 then forumadmin="yes"
end if
rs.Close
end if
if typeid>0 then
if forumadmin<>"yes" then
rs.Open "forumtype Where id="& typeid &" and typeadmin Like '%{gb|mad}"& gbmaduser &"{gb|mad}%'",conn,1,1
if Not rs.Eof then forumadmin="yes"
rs.Close
end if
end if
if LCase(replyer)=LCase(gbmaduser) or forumadmin="yes" or bbsadmin>2 then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">编辑回复</td></tr>"&_
"<tr class=""tds""><td>"&_
"<script language=""JavaScript"">"&_
"function validinput()"&_
"{"&_
"if (document.reply.content.value.length==0){"&_
"alert(""请填写好回复内容。"");"&_
"document.reply.content.focus();"&_
"return false;"&_
"}"&_
"document.reply.button.disabled=""true"";"&_
"return true;"&_
"}"&_
"</script>"&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">"&_
"<form name=""reply"" onsubmit=""return validinput();"" method=""post"" action=""replyedit.asp"">"&_
"<tr><td valign=""top"" width=""64"">回复内容:</td><td><textarea name=""content"" rows=""10"" cols=""50"">"& content &"</textarea></td></tr>"&_
"<tr><td valign=""top"">表情签名:</td><td>"& remark &"</td></tr>"&_
"<tr><td>相关链接:</td><td><input name=""aboutlink"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin"" value="""& aboutlink &"""></td></tr>"&_
"<tr><td>相关图片:</td><td><input name=""imglink"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin"" value="""& imglink &"""></td></tr>"&_
"<tr><td></td><td><input type=""hidden"" name=""replyid"" value="""& id &"""><input name=""button"" type=""submit"" value=""提交"" onmouseover=this.className=""over""; onmouseout=this.className=""out""; class=""out""></td></tr>"
if deler<>"" then
contents=contents &"<tr><td>其他操作:</td><td><a href=""JavaScript:history.back();"">返回</a> <a href=""replyedit.asp?delreply="& id &""">复原回复</a></td></tr>"
else
contents=contents &"<tr><td>其他操作:</td><td><a href=""JavaScript:history.back();"">返回</a> <a href=""replyedit.asp?delreply="& id &""">删除回复</a></td></tr>"
end if
contents=contents &"</form>"&_
"</table>"&_
"</td></tr>"
else
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>该回复不是你发布的,你没有权限编辑。<br>请确定你是通过正常方式进行操作,如果依旧出错,请<a href=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
end if
end if
elseif delreply>0 then
rs.Open "Select userpwd From gbmaduser Where gbmaduser='"& gbmaduser &"'",conn,1,1
if Not rs.Eof then
if rs("userpwd")<>userpwd then
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
if erryes<>"yes" then
rs.Open "Select gbmaduser,topicid From reply Where id="& delreply,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=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
replyer=rs("gbmaduser")
topicid=rs("topicid")
end if
rs.Close
end if
if erryes<>"yes" then
rs.Open "Select forumid,link 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=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
link=rs("link")
forumid=rs("forumid")
end if
rs.Close
end if
if erryes<>"yes" then
if forumid>0 then
rs.Open "forum Where id="& forumid,conn,1,1
if Not rs.Eof then
typeid=rs("forumtype")
if Instr(LCase(rs("forumadmin")),"{gb|mad}"& LCase(gbmaduser) &"{gb|mad}")>0 then forumadmin="yes"
end if
rs.Close
end if
if typeid>0 then
if forumadmin<>"yes" then
rs.Open "forumtype Where id="& typeid &" and typeadmin Like '%{gb|mad}"& gbmaduser &"{gb|mad}%'",conn,1,1
if Not rs.Eof then forumadmin="yes"
rs.Close
end if
end if
if LCase(replyer)=LCase(gbmaduser) or forumadmin="yes" or bbsadmin>2 then
rs.Open "Select gbmaduser,deler From reply Where id="& delreply,conn,1,3
if IsNull(rs("deler")) then
rs("deler")=gbmaduser
deler="yes"
else
if LCase(rs("deler"))=LCase(rs("gbmaduser")) or forumadmin="yes" or bbsadmin>2 then
rs("deler")=Null
else
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>该回复被管理员或发贴者删除,你没有权限复原。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
end if
end if
rs.Update
rs.Close
if erryes<>"yes" then
call creattopic(topicid)
if forumadmin="yes" or bbsadmin>2 then
Session("tempadmin")="yes"
if deler="yes" then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">管理员设置</td></tr>"&_
"<form name=""setgb"" method=""post"" action=""setgb.asp"">"&_
"<input type=""hidden"" name=""matter"" value=""删除回复:id="& delreply &"""><input type=""hidden"" name=""username"" value="""& replyer &""">"&_
"<tr class=""tds""><td>删除回复原因:<input name=""cause"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin"" value=""灌水。""><br>扣除发帖人"& gbname &":<input name=""minusgb"" type=""text"" maxlength=""10"" size=""10"" class=""iptwin"" value=""10""> <input name=""button"" type=""submit"" value=""提交"" onmouseover=""this.className='over';"" onmouseout=""this.className='out';"" class=""out"">"&_
"</td></tr>"&_
"</form>"
else
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">管理员设置</td></tr>"&_
"<form name=""setgb"" method=""post"" action=""setgb.asp"">"&_
"<input type=""hidden"" name=""matter"" value=""复原回复:id="& delreply &"""><input type=""hidden"" name=""username"" value="""& replyer &""">"&_
"<tr class=""tds""><td>复原回复原因:<input name=""cause"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin"" value=""误删。""><br>补偿发帖人"& gbname &":<input name=""addsgb"" type=""text"" maxlength=""10"" size=""10"" class=""iptwin"" value=""10""> <input name=""button"" type=""submit"" value=""提交"" onmouseover=""this.className='over';"" onmouseout=""this.className='out';"" class=""out"">"&_
"</td></tr>"&_
"</form>"
end if
else
call connclose
Response.Redirect "topic/"& link
end if
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=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
end if
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=""reporting.asp"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
end if
end if
end if
contents=contents &"</table>"&_
""
%>
<!--#include file="bottom.asp"-->