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

📄 savepost.asp

📁 一个功能强大的asp招聘求职系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
		Dvbbs.Plus_Execute(Sql)
	End Sub
	'回复获赠金币帖时更新
	Public Sub GetMoney_SaveRe()
		Dim ToUserID,ToUserName,UpPostBuyUser,UpGetMoney,Tempstr
		SQL="Select PostUserID,GetMoney,PostBuyUser,Username From "&TotalUseTable&" Where RootID="&RootID&" and ParentID=0 and GetMoneyType=2"
		Set Rs = Server.CreateObject("ADODB.Recordset")
		Rs.Open SQL,conn,1,3
			If Not Rs.Eof Then
				ToUserID = Clng(Rs(0))
				UpGetMoney = Rs(1) + ToMoney
				UpPostBuyUser = Rs(2)
				ToUserName = Rs(3)
				Tempstr = Split(UpPostBuyUser,"|||",2)
				Tempstr(0) = UpGetMoney
				Tempstr(1) = Tempstr(1) & "|||" & UserName &","& ToMoney
				UpPostBuyUser = Tempstr(0) & "|||" & Tempstr(1)
				UpPostBuyUser = Trim(UpPostBuyUser)
				Rs(1) = UpGetMoney
				Rs(2) = UpPostBuyUser
			Rs.update
			End If
		Rs.Close : Set Rs=Nothing

		'更新主题MONEY值
		Sql = "Update [Dv_Topic] Set GetMoney="&UpGetMoney&" where TopicID="&RootID
		Dvbbs.Execute(sql)
		'主题作者获取金币
		Sql = "Update [Dv_User] Set UserMoney=UserMoney + "&ToMoney&" where UserID="&ToUserID
		Dvbbs.Execute(sql)
		'插入道具日志
		'Dim LogMsg
		'LogMsg = "<a href=""dispbbs.asp?boardid="&Dvbbs.boardid&"&id="&RootID&"&star="&Star&"#"&Announceid&""" target=_blank>回复主题:《<B>"&topic&"</B>》</a> 赠道给作者:<b>"&ToUserName&"</b><font color="&Dvbbs.mainsetting(1)&">"&ToMoney&"</font>个金币成功,并插入道具日志记录。"
		'Call Dvbbs.ToolsLog(0,0,ToMoney,0,0,LogMsg,Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@usermoney").text &"|"&Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userticket").text)
	End Sub

	Rem ------------------------
	Rem 保存部分函数开始
	Rem ------------------------
	'检查数据,提取数据,获得贴子数据表名等。
	Public Sub Save_CheckData()
		Chk_Post()
		CheckfromScript()
		'把提交的数据保存到session
		Content = CheckAlipay()
		isAlipayTopic = 2
		If Content = "" Then
			Content = Dvbbs.Checkstr(Request.Form("body"))
			isAlipayTopic = 0
		End If
		If InStr(Content,"[/payto]") > 0 And InStr(Content,"[payto]") > 0 And InStr(Content,"(/seller)") > 0 And InStr(Content,"(seller)") > 0 Then isAlipayTopic = 2
		Dvbbs.UserSession.documentElement.selectSingleNode("userinfo").attributes.setNamedItem(Dvbbs.UserSession.createNode(2,"postdata","")).text= Request.Form("body")
		If Dvbbs.Board_Setting(4) = "1" Then
			If Not Dvbbs.CodeIsTrue() Then
				Set Dvbbs=Nothing
				 Response.redirect "showerr.asp?ErrCodes=<li>验证码校验失败,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
			End If
		End If
		Chk_PostType()

		'魔法表情检查部分
		tMagicFace = Request("tMagicFace")
		If tMagicFace = "" Or Not IsNumeric(tMagicFace) Then tMagicFace = 0
		tMagicFace = Cint(tMagicFace)
		iMagicFace = Request("iMagicFace")
		If iMagicFace = "" Or Not IsNumeric(iMagicFace) Then iMagicFace = 0
		iMagicFace = Clng(iMagicFace)
		Expression = Dvbbs.Checkstr(Request.Form("Expression"))
		If Expression = "" Then
			Expression = "face1.gif"
		Else
			Expression = Replace(Expression,"|","")
		End If
		If tMagicFace = 1 And iMagicFace > 0 And Dvbbs.Forum_Setting(98)="1" Then
			Set Rs = Dvbbs.Plus_Execute("Select tMoney,tTicket,MagicSetting From Dv_Plus_Tools_MagicFace Where MagicFace_s = " & iMagicFace)
			If Rs.Eof And Rs.Bof Then
				Expression = "0|" & Expression
				tMagicMoney = 0
				tMagicTicket = 0
			Else
				If cCur(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userticket").text) < Rs(1) And cCur(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@usermoney").text ) < Rs(0) Then Set Dvbbs=Nothing:Response.redirect "showerr.asp?ErrCodes=<li>您没有足够的金币或点券使用魔法表情,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
				Dim iMagicSetting
				iMagicSetting = Split(Rs(2),"|")
				If cCur(iMagicSetting(0)) > cCur(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userpost").text ) Then Set Dvbbs=Nothing:Response.redirect "showerr.asp?ErrCodes=<li>您的帖子数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
				If cCur(iMagicSetting(1)) > cCur(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userwealth").text) Then Set Dvbbs=Nothing:Response.redirect "showerr.asp?ErrCodes=<li>您的金钱数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
				If cCur(iMagicSetting(2)) > cCur(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userep").text) Then Set Dvbbs=Nothing:Response.redirect "showerr.asp?ErrCodes=<li>您的经验数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
				If cCur(iMagicSetting(3)) > cCur(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@usercp").text ) Then Set Dvbbs=Nothing:Response.redirect "showerr.asp?ErrCodes=<li>您的魅力数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
				If cCur(iMagicSetting(4)) > cCur(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userpower").text) Then Set Dvbbs=Nothing:Response.redirect "showerr.asp?ErrCodes=<li>您的威望数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
				Expression = iMagicFace & "|" & Expression
				tMagicMoney = Rs(0)
				tMagicTicket = Rs(1)
				FoundUseMagic = True
			End If
			Rs.Close
			Set Rs=Nothing
		Else
			Expression = "0|" & Expression
		End If
		Expression = Split(Expression,"|")
		Topic = Dvbbs.Checkstr(Trim(Request.Form("topic")))
		signflag = Dvbbs.Checkstr(Trim(Request.Form("signflag")))
		mailflag = Dvbbs.Checkstr(Trim(Request.Form("emailflag")))
		MyTopicMode = Dvbbs.Checkstr(Trim(Request.Form("topicximoo")))
		MyLockTopic = Dvbbs.Checkstr(Trim(Request.Form("locktopic")))
		Myistop = Dvbbs.Checkstr(Trim(Request.Form("istop")))
		Myistopall = Dvbbs.Checkstr(Trim(Request.Form("istopall")))
		TopicMode = Request.Form("topicmode")
		If Dvbbs.strLength(topic)> CLng(Dvbbs.Board_Setting(45)) Then 
			parameter="showerr.asp?ErrCodes=<li>"&Replace(template.Strings(23),"{$topiclimited}",Dvbbs.Board_Setting(45))&"<BR>2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
			Set Dvbbs=Nothing
			Response.redirect parameter
		End If
		Rem 限制提交数据不能大于64K
		If Len(Content) > 64*1024*1024 Then
			parameter="showerr.asp?ErrCodes=<li>您提交的数据过大,提交数据不能大于64K&action=OtherErr&autoreload=1"
			Set Dvbbs=Nothing
			Response.redirect parameter
		End If
		Dim TMPData
		'TMPData=inpostlist
		If TMPData<>"" Then
			If Action <> 8 Then
				parameter="showerr.asp?ErrCodes="&TMPData&"&action=OtherErr&autoreload=1"
				Set Dvbbs=Nothing
				Response.redirect parameter
			End If
		End If
		Rem 老迷增加xhtml格式限制
		Dim XMLPOST,XHTML
		XHTML=True
		If XHTML Then
			Set XMLPOST=Server.CreateObject("msxml2.DOMDocument"& MsxmlVersion)
			If XMLPOST.loadxml("<xhtml>" & xmlencode(Content) &"</xhtml>") Then
				Content=Rexmlencode(Mid(XMLPOST.documentElement.xml,8,Len(XMLPOST.documentElement.xml)-15))
			Else
				parameter="showerr.asp?ErrCodes=<li>您提交的数据不合法(必须提交XHTML格式)&action=OtherErr&autoreload=1"
				Set Dvbbs=Nothing
				Response.redirect parameter
			End If
			Set XMLPOST=Nothing
		End If
		If Dvbbs.strLength(Content) > CLng(Dvbbs.Board_Setting(16)) Then Response.redirect "showerr.asp?ErrCodes=<li>"&Replace(template.Strings(24),"{$bodylimited}",Dvbbs.Board_Setting(16))&"<BR>2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
			REM 2004-4-23添加限制帖子内容最小字节数,下次在模板中添加。Dvbbs.YangZheng
			If Dvbbs.strLength(Content) < CLng(Dvbbs.Board_Setting(52)) And Not CLng(Dvbbs.Board_Setting(52)) = 0 Then
				parameter="showerr.asp?ErrCodes=<li>"&Replace(template.Strings(24),"大于{$bodylimited}","小于"&Dvbbs.Board_Setting(52))&"<BR>2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
				Set Dvbbs=Nothing
			Response.redirect parameter
		End If
		Dim testContent
		testContent=Content
		testContent=Replace(testContent,vbNewLine,"")
		testContent=Replace(testContent," ","")
		testContent=Replace(testContent,"&nbsp;","")		
		testContent=Trim(Dvbbs.Replacehtml(testContent))
		If testContent="" and InStr(Content,"<img")=0 and InStr(Content,"<input")=0 and InStr(Content,"<object")=0  and InStr(Content,"<embed")=0 Then Set Dvbbs=Nothing:Response.redirect "showerr.asp?ErrCodes=<li>您没有填写内容.2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
		If Dvbbs.UserID=0 Then
			mailflag=0:signflag=0
		Else
			If Not IsNumeric(mailflag) Or mailflag="" Then mailflag=0
			mailflag=CInt(mailflag)
			If Not IsNumeric(signflag) Or signflag="" Then signflag=1
			signflag=CInt(signflag)
		End If
		If TopicMode<>"" and IsNumeric(TopicMode) Then TopicMode=Cint(TopicMode) Else TopicMode=0
		If Request.form("upfilerename")<>"" Then
			ihaveupfile=1
			upfileinfo=Replace(Request.form("upfilerename"),"'","")
			upfileinfo=Replace(upfileinfo,";","")
			upfileinfo=Replace(upfileinfo,"--","")
			upfileinfo=Replace(upfileinfo,")","")
			Dim fixid,upfilelen
			fixid=Replace(upfileinfo," ","")
			fixid=Replace(fixid,",","")
			If Not IsNumeric(fixid) Then ihaveupfile=0
			upfilelen=len(upfileinfo)
			upfileinfo=left(upfileinfo,upfilelen-1)
		Else
			ihaveupfile=0
		End If
		voteid=0
		isvote=0
		If Action = 7 Then
			votetype=Dvbbs.Checkstr(request.Form("votetype"))
			If IsNumeric(votetype)=0 or votetype="" Then votetype=0
			vote=Dvbbs.Checkstr(trim(Replace(request.Form("vote"),"|","")))
			Dim j,k,vote_1,votelen,votenumlen
			If vote="" Then
				Dvbbs.AddErrCode(81)
			Else
				vote=split(vote,chr(13)&chr(10))
				j=0
				For i = 0 To ubound(vote)
					If Not (vote(i)="" Or vote(i)=" ") Then
						vote_1=""&vote_1&""&vote(i)&"|"
						j=j+1
					End If
					If i>cint(Dvbbs.Board_Setting(32))-2 Then Exit For
				Next
				For k = 1 to j
					votenum=""&votenum&"0|"
				Next
				votelen=len(vote_1)
				votenumlen=len(votenum)
				votenum=left(votenum,votenumlen-1)
				vote=left(vote_1,votelen-1)
			End If
			If Not IsNumeric(request("votetimeout")) Then
				Dvbbs.AddErrCode(82)
			Else
				If request("votetimeout")="0" Then
					votetimeout=dateadd("d",9999,Now())
				Else
					votetimeout=dateadd("d",CCur(request("votetimeout")),Now())
				End If
				votetimeout=Replace(Replace(CSTR(votetimeout+Dvbbs.Forum_Setting(0)/24),"上午",""),"下午","")
			End If
		End If
		If Action = 5 Or Action = 7 Then
			CanLockTopic=False
			CanTopTopic=False
			CanTopTopic_a=False
			If Topic="" OR Replace(Topic&"","

⌨️ 快捷键说明

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