⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 del.asp

📁 这是ASP的OA
💻 ASP
字号:
<!-- #include file="const.asp" -->
<!-- #include file="GetMp3_function.asp" -->
<!-- #include file="power_func.asp" -->
<%
dim id,sql,rs,FID,rootid,purl,page,rootid2,name2,topic,content,author,addtime
dim rs2,npost,ntopic,ntoday,todaydate,i,name
id=nrequest("id")
rootid=nrequest("rootid")
purl=trim(request.QueryString("purl"))
page=trim(request.QueryString("page"))
if id="" then
	response.Redirect("error.asp?id=3")
	response.End()
else
	call opendb()
		checkuser()
		sql="select FID,RootID,name,topic,content,addtime from m3_bbs where id="&id&""
		set rs=server.CreateObject("adodb.recordset")
		rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			rs.close
			set rs=nothing
			call closedb()
			response.Redirect("error.asp?id=2")
			response.End()
		else
			FID=rs("FID")
			rootid2=rs("RootID")
			name2=trim(rs("name"))
			author=rs("name")
			topic=rs("topic")
			content=rs("content")
			addtime=rs("addtime")
		end if
		rs.close
		set rs=nothing
		if isadmin()=1 or havepower(FID)=1 then
				if rootid2=id then
					sql="update m3_bbs set valid=0 where rootid="&rootid2&""
					conn.execute(sql)
					if datevalue(addtime)=date() then
						sql="update m3_forum set topic=topic-1,post=post-1,today=today-1 where fid="&FID&""
					else
						sql="update m3_forum set topic=topic-1,post=post-1 where fid="&FID&""
					end if
					conn.execute(sql)
					set rs=server.CreateObject("adodb.recordset")
					sql="select post,credit,weiwang,meili,jingyan,money from m3_users where name='"&request.Cookies("matrix3")("matrix3_name")&"'"
					rs.open sql,conn,1,3
					if not (rs.bof and rs.eof) then
						rs("meili")=cint(rs("meili"))-5
						rs("jingyan")=cint(rs("jingyan"))-5
						rs("money")=cint(rs("money"))-70
						rs("credit")=cint(rs("credit"))-2
						rs("weiwang")=cint(rs("weiwang"))-5
						rs.update
					end if
					rs.close
					set rs=nothing
				else
					sql="update m3_bbs set valid=0 where id="&id&""
					conn.execute(sql)
					sql="update m3_bbs set re=re-1 where id="&id&""
					conn.execute(sql)
					if datevalue(addtime)=date() then
						sql="update m3_forum set post=post-1,today=today-1 where fid="&FID&""
					else
						sql="update m3_forum set post=post-1 where fid="&FID&""
					end if
					conn.execute(sql)
					set rs=server.CreateObject("adodb.recordset")
					sql="select post,credit,weiwang,meili,jingyan,money from m3_users where name='"&request.Cookies("matrix3")("matrix3_name")&"'"
					rs.open sql,conn,1,3
					if not (rs.bof and rs.eof) then
						rs("meili")=cint(rs("meili"))-3
						rs("jingyan")=cint(rs("jingyan"))-3
						rs("money")=cint(rs("money"))-50
						rs("credit")=cint(rs("credit"))-1
						rs("weiwang")=cint(rs("weiwang"))-2
						rs.update
					end if
					rs.close
					set rs=nothing
				end if
				'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
				call batchdelmp3(content,topic,datevalue(addtime),author,id)
				'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
		else
				call closedb()
				response.Redirect("error.asp?id=1")
				response.End()
		end if
	topic=""
	name=""
	set rs2=server.CreateObject("adodb.recordset")
	sql="select top 1 topic,name,addtime,rootid from m3_bbs where fid="&FID&" and valid=1 order by addtime desc"
	rs2.open sql,conn,1,1
	if not (rs2.eof and rs2.bof) then
		topic=rs2("topic")
		name=rs2("name")
		addtime=rs2("addtime")
		rootid=rs2("rootid")
	end if
	rs2.close
	set rs2=nothing
	if topic<>"" then topic=replace(topic,"'","’")
	sql="update m3_forum set lasttopic='"&topic&"',lastname='"&name&"',lasttime='"&addtime&"',topicid="&rootid&" where fid="&FID&""
	conn.execute(sql)
	call closedb()
	'if rootid<>"" then
		'response.write("<script>alert('删除成功 !');location.href='bbs.asp?id="&rootid&"&page="&page&"';</script >")
	'else
		response.write("<script>alert('删除成功 !');location.href='list.asp?forumid="&FID&"';</script>")
	'end if
	response.End()
end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -