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

📄 savereply.asp

📁 这是ASP的OA
💻 ASP
字号:
<!-- #include file="const.asp" -->
<!-- #include file="GetMp3_function.asp" -->
<!-- #include file="matrix3_upload_inc.asp" -->
<!-- #include file="matrix3_upload_config.asp" -->
<%
call opendb()
checkuser()
dim sql,rs,ID,rootid,layer,topic,content,FID,face,CID,rootid2,purl,page,tempid,ind
dim upload,viewsign,filepath,rnum,havefile,replytopic',emailinform
dim filename,filesize,filetype,uploadtime,file1,csize
ind=0
set upload=new matrix3_upload
topic=upload.Form("topic")
replytopic=upload.Form("replytopic")
content=upload.Form("content")
face=trim1(upload.Form("faceid"))
ID=trim1(upload.Form("id"))
rootid2=trim1(upload.Form("rootid"))
purl=trim1(upload.Form("purl"))
page=trim1(upload.Form("page"))
viewsign=upload.Form("viewsign")
csize=0
if not IsNumeric(ID) then
	response.write("非法的参数!")
	response.end()
end if
if viewsign="" then
	viewsign=0
else
	viewsign=cint(viewsign)
end if
havefile=0
if topic="" then topic=replytopic
if topic="" then
	set upload=nothing
	call closedb()
	response.Write("<script>alert('请输入回复标题 !');history.back();</script>")
	response.End()
end if
if ID="" then
	set upload=nothing
	call closedb()
	response.Redirect("error.asp?id=3") 
	response.End()
else
	csize=len(content)
	if request.Cookies("matrix3")("matrix3_admin")<>"matrix3" then
		if csize>15000 then 
			response.write("<script>alert('文章内容太长,超过了15K!');history.back();")
			response.End()
		end if
		topic=server.HTMLEncode(topic)
	end if
	face=left(face,2)
	set file1=upload.file("file1")
	if file1.FileSize>1 and file1.FileName<>"" then
		filetype=getext(file1.FileName)
		filesize=file1.FileSize
		filename=file1.FileName
		if request.Cookies("matrix3")("matrix3_admin")<>"matrix3" then
			if filesize>uploadsize*1024 then
				set upload=nothing
				call closedb()
				response.Write("<script>alert('文件过大 (不能超过 "&uploadsize&" K)!');history.back();</script>")
				response.End()
			end if
		end if
		if checkext(filetype)=0 then
			set upload=nothing
		  	call closedb()
			response.Write("<script>alert('该文件类型不允许上传!');history.back();</script>")
			response.End()
		end if
		rnum=randnum()
		filepath = uploadfolder&rnum&"."&filetype
		file1.saveAs Server.mappath(filepath)
		set file1=nothing
		havefile=1
	end if
	set upload=nothing
	
	sql="select RootID,layer,re,CID,FID,lasttime,lastname,ind from m3_bbs where ID="&ID&""
	set rs=server.CreateObject("ADODB.RecordSet")
	rs.open sql,conn,1,3
	if rs.bof and rs.eof then
		rs.close
		set rs=nothing
		set upload=nothing
		call closedb()
		response.Redirect("error.asp?id=2")
		response.End()
	else
		rootid=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
	if isadmin()=0 then
		topic=server.HTMLEncode(topic)
		face=left(face,2)
		sql="select * from m3_kill where killstr='"&request.Cookies("matrix3")("matrix3_name")&"' or killstr='"&request.ServerVariables("LOCAL_ADDR")&"'"
		rs.open sql,conn,1,1
		if not (rs.eof and rs.bof) then
			rs.close
			set rs=nothing
			set upload=nothing
			call closedb()
			response.Redirect("error.asp?id=9")
			response.End()
		end if
		rs.close
		set rs=nothing
	end if
	sql="update m3_bbs set ind=ind+1 where rootid="&rootid&" and fid="&FID&" and ind>"&ind&""
	conn.execute(sql)
	set rs=server.CreateObject("adodb.recordset")
	rs.open "m3_bbs",conn,1,3
	rs.addnew
	rs("topic")=topic
	rs("content")=content
	rs("name")=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")=ID
	rs("layer")=cint(layer)+1
	rs("valid")=1
	rs("html")=0
	rs("ind")=cint(ind)+1
	rs("viewsign")=viewsign
	rs("csize")=csize
	if filetype="jpg" or filetype="gif" or filetype="jpeg" or filetype="bmp" then
		rs("filepath")=filepath
	else
		rs("filepath")=rnum
	end if
	rs("uploadfile")=server.HTMLEncode(filename)
	rs.update
	tempid=rs.Fields("ID")
	rs.close
	set rs=nothing
	if cint(ID)<>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&""
	set rs=server.CreateObject("ADODB.RecordSet")
	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
	if havefile=1 then
		rs.open "m3_uploadfiles",conn,1,3
		rs.addnew
		rs("FileID")=rnum
		rs("filename")=server.HTMLEncode(filename)
		rs("filepath")=filepath
		rs("filesize")=filesize
		rs("filetype")=filetype
		rs("username")=request.Cookies("matrix3")("matrix3_name")
		rs("uploadtime")=now
		rs("downloadtimes")=0
		rs("bbsid")=tempid
		rs.update
		rs.close
	end if
	set rs=nothing
end if
call closedb()
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
call batchmp3(content,topic,date(),request.Cookies("matrix3")("matrix3_name"),tempid)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
response.Write("<script>alert('回复成功 !');location.href='bbs.asp?id="&rootid&"&page="&page&"';</script>")
function randnum()
	dim randyear,randmonth,randday
	randyear=year(date)
	if len(randyear)=1 then randyear="0"&randyear
	randmonth=month(date)
	if len(randmonth)=1 then randmonth="0"&randmonth
	randday=day(date)
	if len(randday)=1 then randday="0"&randday
	randomize
	randnum=int(900000*rnd)+100000
	randnum=randyear&randmonth&randday&cstr(randnum)
end function
%>

⌨️ 快捷键说明

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