www.gusucode.com > 仿MOP对开式论坛程序 1.0源码程序 > topicedit.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
dim id,link,title,edittitle,content,help,remark,aboutlink,imglink,unreply,topicid,deltopic,delreply,forumid,typeid,topicer,forumadmin,erryes,i
id=Request.QueryString("id")
if IsNumeric(id) then
id=Clng(id)
else
id="0"
end if
title=Trim(titlecode(Request.Form("title")))
edittitle=Request.Form("edittitle")
if gb<99 then
content=Trim(contentcode(Request.Form("content"),0))
else
content=Trim(contentcode(Request.Form("content"),1))
end if
help=Request.Form("help")
aboutlink=Trim(Request.Form("aboutlink"))
imglink=Trim(Request.Form("imglink"))
unreply=Request.Form("unreply")
topicid=Request.Form("topicid")
if IsNumeric(topicid) then
topicid=Clng(topicid)
else
topicid="0"
end if
deltopic=Request.QueryString("deltopic")
if IsNumeric(deltopic) then
deltopic=Clng(deltopic)
else
deltopic="0"
end if
delreply=Request.QueryString("delreply")
if IsNumeric(delreply) then
delreply=Clng(delreply)
else
delreply="0"
end if
if topicid>0 and title<>"" 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 "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><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
topicer=rs("gbmaduser")
forumid=rs("forumid")
end if
rs.Close
end if
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 erryes<>"yes" then
if LCase(topicer)=LCase(gbmaduser) or forumadmin="yes" or bbsadmin>2 then
rs.Open "Select title,content,aboutlink,imglink,unreply,topictype,reply,link From topic Where id="& topicid,conn,1,3
if edittitle<>"no" then rs("title")=title
if LCase(topicer)=LCase(gbmaduser) then
if rs("reply")>0 then content=content &"<br>"& vbcrlf &"<div class=""editer"">该帖子最后被 "& gbmaduser &" 编辑于"& Now() &"。</div>"
rs("content")=content
else
rs("content")=content &"<br>"& vbcrlf &"<div class=""editer"">该帖子最后被 "& gbmaduser &" 编辑于"& Now() &"。</div>"
end if
rs("aboutlink")=aboutlink
rs("imglink")=imglink
if unreply="yes" then
rs("unreply")=1
else
rs("unreply")=Null
end if
if help="yes" then
rs("topictype")=0
else
if rs("topictype")=0 then rs("topictype")=Null
end if
link=rs("link")
rs.Update
rs.Close
call creattopic(topicid)
call connclose
Response.Redirect "topic/"& link
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
elseif id>0 then
rs.Open "topic 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=""sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
topicer=rs("gbmaduser")
forumid=rs("forumid")
title=rs("title")
content=Replace(Replace(Replace(rs("content"),"<br>"& vbcrlf,vbcrlf),"&lt;","<"),"&gt;",">")
aboutlink=rs("aboutlink")
imglink=rs("imglink")
unreply=rs("unreply")
help=rs("topictype")
remark=rs("remark")
end if
rs.Close
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(topicer)=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.topic.title.value.length==0){"&_
"alert(""请填写好帖子标题。"");"&_
"document.topic.title.focus();"&_
"return false;"&_
"}"&_
"if (document.topic.content.value.length==0){"&_
"alert(""请填写好帖子内容。"");"&_
"document.topic.content.focus();"&_
"return false;"&_
"}"&_
"document.topic.button.disabled=""true"";"&_
"return true;"&_
"}"&_
"</script>"&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">"&_
"<form name=""topic"" onsubmit=""return validinput();"" method=""post"" action=""topicedit.asp"">"&_
"<tr><td width=""64"">帖子标题:</td><td><input name=""title"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin"" value='"& title &"'></td></tr>"
if Left(title,12)="<font color=" then
contents=contents &"<tr><td>标题颜色:</td><td><input name=""edittitle"" type=""checkbox"" value=""no"" checked>不修改标题 修改标题则暗夜极光效果消失。</td></tr>"
end if
contents=contents &"<tr><td valign=""top"">帖子内容:</td><td><textarea name=""content"" rows=""15"" cols=""50"">"& content &"</textarea></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><font title=""选择上之后该帖子将不能被回复""><input name=""unreply"" type=""checkbox"" value=""yes"""
if unreply=1 then contents=contents &" checked"
contents=contents &">不接受回复</font> <font title=""选上这个按钮之后帖子就会出现在求助区""><input name=""help"" type=""checkbox"" value=""yes"""
if help=0 then contents=contents &" checked"
contents=contents &">求助帖</font> <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>"&_
"<tr><td>其他操作:</td><td><a href=""JavaScript:history.back();"">返回</a> <a href=""javascript:if(confirm('删除帖子会把帖子以及本帖子所有回复删除,不能恢复,确认继续?'))location='topicedit.asp?deltopic="& id &"'"">删除帖子</a></td></tr>"
if forumadmin="yes" then
contents=contents &"<tr><td>管理工具:</td><td><a href=""elite.asp?id="& id &""">把帖子加入/移出精华区</a> <a href=""move.asp?id="& id &""">移动贴子</a></tr>"
end if
contents=contents &"</form>"&_
"</table>"&_
"</td></tr>"&_
"</table>"&_
"<br>"&_
""&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">回复管理  点回帖人删除/复原回复</td></tr>"
if LCase(topicer)<>LCase(gbmaduser) then
contents=contents &"<tr><td><br>管理员请通过回复编辑管理回复。<br><br></td></tr>"
else
rs.Open "reply Where topicid="& id &" Order by id",conn,1,1
if rs.Eof then
contents=contents &"<tr><td><br>还没有任何的回复。<br><br></td></tr>"
else
m=1
For i=1 to rs.RecordCount
if i mod 10=0 then m=m+1
if IsNull(rs("deler")) then
if rs("anonymity")<>"" then
tl(m)=tl(m) &("<tr><td class=""ftd"">删除 <a href=""topicedit.asp?delreply="& rs("id") &""" class=""anonymity"">神秘人物"& rs("anonymity") &"</a> 的回复("& i &")。 <a href=""topictool.asp?reply="& rs("id") &""" onClick=""return shows(this.href+'&title="& rs("anonymity") &"');"" title=""使用 显影水晶 查看 神秘人物"& rs("anonymity") &""">使用道具</a> <font class=""del"">回复时间:"& rs("posttime") &"</font></td></tr>")
else
tl(m)=tl(m) &("<tr><td class=""ftd"">删除 <a href=""topicedit.asp?delreply="& rs("id") &""">"& rs("gbmaduser") &"</a> 的回复("& i &")。 <font class=""del"">回复时间:"& rs("posttime") &"</font></td></tr>")
end if
else
if rs("anonymity")<>"" then
tl(m)=tl(m) &("<tr><td class=""ftd""><font class=""del"">复原 <a href=""topicedit.asp?delreply="& rs("id") &""" class=""anonymity"">神秘人物"& rs("anonymity") &"</a> 的回复("& i &")。 <a href=""topictool.asp?reply="& rs("id") &""" onClick=""return shows(this.href+'&title="& rs("anonymity") &"');"" title=""使用 显影水晶 查看 神秘人物"& rs("anonymity") &""">使用道具</a> 回复时间:"& rs("posttime") &"</font></td></tr>")
else
tl(m)=tl(m) &("<tr><td class=""ftd""><font class=""del"">复原 <a href=""topicedit.asp?delreply="& rs("id") &""">"& rs("gbmaduser") &"</a> 的回复("& i &")。 回复时间:"& rs("posttime") &"</font></td></tr>")
end if
end if
'if IsNull(rs("deler")) then
'contents=contents &"<tr class=""tds""><td>回复("& i &"):"& unhtmlcode(rs("content"))
'if rs("aboutlink")<>"" then contents=contents &"<br>相关链接:<a href="""& rs("aboutlink") &""" target=""_blank"">"& rs("aboutlink") &"</a>"
'if rs("imglink")<>"" then contents=contents &"<br><img src="""& rs("imglink") &""" border=""0"">"
'contents=contents & unhtmlcode(rs("remark")) &"</td></tr>"
'else
'contents=contents &"<tr class=""tds""><td>回复("& i &"):<font class=""del"">该回复已经被<a href=""sendmessage.asp?username="& rs("deler") &""" onClick=""return shows(this.href);"" title=""发送密信给 "& rs("deler") &""">"& rs("deler") &"</a>删除</font>。 <a href=""topictool.asp?explore="& rs("id") &""" onClick=""return showb(this.href+'&title="& rs("deler") &"');"" title=""使用 探察视镜 查看该被删除的回复""><img src="""& theme &"explore.gif"" border=""0""></a></td></tr>"
'end if
'if rs("anonymity")<>"" then
'contents=contents &"<tr class=""tds""><td>---<a href=""topicedit.asp?delreply="& rs("id") &""" class=""anonymity"" title=""删除/复原回复"">神秘人物"& rs("anonymity") &"</a> <a href=""topictool.asp?reply="& rs("id") &""" onClick=""return shows(this.href+'&title="& rs("anonymity") &"');"" title=""使用 显影水晶 查看 神秘人物"& rs("anonymity") &""">使用道具</a> <font class=""del"">回复时间:"& rs("posttime") &"</font></td></tr>"
'else
'contents=contents &"<tr class=""tds""><td>---<a href=""topicedit.asp?delreply="& rs("id") &""" title=""删除/复原回复"">"& rs("gbmaduser") &"</a> <a href=""sendmessage.asp?username="& rs("gbmaduser") &""" onClick=""return shows(this.href);"" title=""发送密信给 "& rs("gbmaduser") &"""><img src="""& theme &"message.gif"" border=""0""></a> <a href=""userinfo.asp?username="& rs("gbmaduser") &""" onClick=""return showb(this.href);"" title=""查看用户 "& rs("gbmaduser") &" 的详细信息""><img src="""& theme &"info.gif"" border=""0""></a> <font class=""del"">回复时间:"& rs("posttime") &"</font></td></tr>"
'end if
'contents=contents &"</table><table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"
rs.MoveNext
Next
contents=contents & unitetopic()
end if
rs.Close
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
elseif deltopic>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,forumid From topic Where id="& deltopic,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><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
topicer=rs("gbmaduser")
forumid=rs("forumid")
end if
rs.Close
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
end if
if erryes<>"yes" then
if LCase(topicer)=LCase(gbmaduser) or forumadmin="yes" or bbsadmin>2 then
rs.Open "Select link,deler From topic Where id="& deltopic,conn,1,3
link=rs("link")
rs("deler")=gbmaduser
rs.Update
rs.Close
call topicdel(link)
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">删除帖子</td></tr><tr><td><br>删除帖子成功,该帖子已经被物理删除。<br><br></td></tr>"
if forumadmin="yes" or bbsadmin>2 then
Session("tempadmin")="yes"
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="& deltopic &"""><input type=""hidden"" name=""username"" value="""& topicer &""">"&_
"<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>"
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
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 "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=""sendmessage.asp?username=admin"">联系管理员报告错误</a>。<br><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
topicid=rs("topicid")
end if
rs.Close
end if
if erryes<>"yes" then
rs.Open "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><a href=""JavaScript:history.back();"">返回刚才的页面</a>。<br><br></td></tr>"
erryes="yes"
else
link=rs("link")
topicer=rs("gbmaduser")
end if
rs.Close
end if
if erryes<>"yes" then
if LCase(topicer)=LCase(gbmaduser) then
rs.Open "reply Where id="& delreply,conn,1,3
if IsNull(rs("deler")) then
rs("deler")=gbmaduser
else
if LCase(rs("deler"))=LCase(gbmaduser) 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)
call connclose
Response.Redirect "topic/"& link
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
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
contents=contents &"</table>"&_
""
%>
<!--#include file="bottom.asp"-->