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

📄 matrix3_savepost.asp

📁 这是ASP的OA
💻 ASP
字号:
<!-- #include file="const.asp" -->
<%
call opendb()
checkadmin()
dim sql,rs,pid,id,savestr,ind
dim topic,content,face,fid,cid,layer,rootid,tempid
ind=0
topic=trim(request.Form("topic"))
content=trim(request.Form("content"))
face=trim(request.Form("faceid"))
fid=trim1(request("forumid"))
id=trim1(request("id"))
pid=trim1(request("pid"))
if id<>"" then
	if not IsNumeric(id) then
		response.write("非法参数")
		response.End()
	end if
end if
if not IsNumeric(fid) then
	response.write("非法参数")
	response.End()
end if
if topic="" then
	response.Write("<script>alert('请输入主题!');history.back();</script>")
	response.End()
end if
if id<>"" then
	sql="select * from m3_bbs where id="&id&""
	set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,3
	if rs.eof and rs.bof then
		response.Redirect("error.asp?id=2")
		response.End()
	else
		rs("topic")=topic
		rs("content")=content
		rs("FID")=fid
		rs("face")=face
		rs("lasttime")=now
		rs("html")=1
		rs("viewsign")=1
		rs("filepath")=""
		rs.update
		savestr="<script>alert('修改帖子成功!');window.close();self.opener.location.reload();</script>"
	end if
	rs.close
	set rs=nothing
else
	if pid<>"" then
		sql="select RootID,layer,re,CID,FID,lasttime,lastname,ind from m3_bbs where ID="&pid&""
		set rs=server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if rs.bof and rs.eof then
			rs.close
			set rs=nothing
			call closedb()
			response.Redirect("error.asp?id=2")
			response.End()
		else
			rootid=cint(rs("RootID"))
			layer=rs("layer")
			fid=rs("FID")
			cid=rs("CID")
			ind=rs("ind")
			rs("re")=cint(rs("re"))+1
			rs("lasttime")=now
			rs("lastname")=request.Cookies("matrix3")("matrix3_name")
			rs.update
		end if
		rs.close
		sql="update m3_bbs set ind=ind+1 where rootid="&rootid&" and fid="&FID&" and ind>"&ind&""
		conn.execute(sql)
		rs.open "m3_bbs",conn,1,3
		rs.addnew
		rs("topic")=topic
		rs("content")=content
		rs("name")=request.Cookies("matrix3")("matrix3_name")
		rs("lastname")=request.Cookies("matrix3")("matrix3_name")
		rs("ip")=request.ServerVariables("REMOTE_ADDR")
		rs("addtime")=now
		rs("lasttime")=now
		rs("lastname")=request.Cookies("matrix3")("matrix3_name")
		rs("re")=0
		rs("click")=0
		rs("face")=face
		rs("FID")=fid
		rs("CID")=cid
		rs("RootID")=rootid
		rs("PID")=pid
		rs("layer")=cint(layer)+1
		rs("valid")=1
		rs("html")=1
		rs("ind")=cint(ind)+1
		rs("viewsign")=1
		rs("filepath")=""
		rs.update
		rs.close
		if cint(pid)<>cint(rootid) then
			sql="update m3_bbs set re=re+1,lasttime='"&now&"',lastname='"&request.Cookies("matrix3")("matrix3_name")&"' where ID="&rootid&""
			conn.execute(sql)
		end if
		sql="select * from m3_forum where FID="&FID&""
		rs.open sql,conn,1,3
		if not (rs.bof and rs.eof) then
			if rs("todaydate")=date() then
				rs("today")=cint(rs("today"))+1
			else
				rs("today")=1
				rs("todaydate")=date()
			end if
			rs("lasttime")=now
			rs("lasttopic")=topic
			rs("lastname")=request.Cookies("matrix3")("matrix3_name")
			rs("topicid")=rootid
			rs("post")=cint(rs("post"))+1
			rs.update
		end if
		rs.close
		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("post")=cint(rs("post"))+1
			rs("meili")=cint(rs("meili"))+1
			rs("jingyan")=cint(rs("jingyan"))+1
			rs("money")=cint(rs("money"))+20
			rs("credit")=cint(rs("credit"))+1
			rs("weiwang")=cint(rs("weiwang"))+1
			rs.update
		end if
		rs.close
		set rs=nothing
		savestr="<script>alert('回复帖子成功!');window.close();self.opener.location.reload();</script>"
	else
		set rs=server.CreateObject("adodb.recordset")
		sql="select CID from m3_forum where FID="&fid&""
		set rs=server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,3
		if rs.bof and rs.eof then
			rs.close
			set rs=nothing
			call closedb()
			response.Redirect("error.asp?id=2")
			response.End()
		else
			cid=rs("CID")
		end if
		rs.close
		rs.open "m3_bbs",conn,1,3
		rs.addnew
		rs("topic")=topic
		rs("content")=content
		rs("name")=request.Cookies("matrix3")("matrix3_name")
		rs("lastname")=request.Cookies("matrix3")("matrix3_name")
		rs("ip")=request.ServerVariables("REMOTE_ADDR")
		rs("addtime")=now
		rs("lasttime")=now
		rs("re")=0
		rs("click")=0
		rs("face")=face
		rs("FID")=fid
		rs("CID")=cid
		rs("viewsign")=1
		rs("filepath")=""
		rs.update
		tempid=rs.Fields("ID")
		rs("RootID")=tempid
		rs("PID")=0
		rs("layer")=0
		rs("valid")=1
		rs("html")=1
		rs("ind")=0
		rs.update
		rs.close
		sql="select * from m3_forum where FID="&FID&""
		rs.open sql,conn,1,3
		if not (rs.bof and rs.eof) then
			if rs("todaydate")=date() then
				rs("today")=cint(rs("today"))+1
			else
				rs("today")=1
				rs("todaydate")=date()
			end if
			rs("post")=cint(rs("post"))+1
			rs("topic")=cint(rs("topic"))+1
			rs("topicid")=tempid
			rs("lasttopic")=topic
			rs("lasttime")=now
			rs("lastname")=request.Cookies("matrix3")("matrix3_name")
			rs.update
		end if
		rs.close
		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("post")=cint(rs("post"))+1
			rs("meili")=cint(rs("meili"))+3
			rs("jingyan")=cint(rs("jingyan"))+3
			rs("money")=cint(rs("money"))+50
			rs("credit")=cint(rs("credit"))+2
			rs("weiwang")=cint(rs("weiwang"))+5
			rs.update
		end if
		rs.close
		set rs=nothing
		savestr="<script>alert('发表成功!');location.href='list.asp?forumid="&fid&"';</script>"
	end if
end if
call closedb()
response.Write(savestr)
%>

⌨️ 快捷键说明

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