% Dvbbs.LoadTemplates("dispbbs") Dim Rootid,PostTable,Action,RootID_a Dim AnnounceID,Rs,SQL,i Action = Request("action") PostTable=Request("PostTable") PostTable=Checktable(PostTable) Rootid=Request("ID") RootID_a=Request("rootid") AnnounceID=Request("ReplyID") Select Case Action Case "view" : Dvbbs.stats="查看购买贴子的用户" Case "buy" : Dvbbs.stats="金币购买帖子" Case "Send" : Dvbbs.stats="赠送金币" Case "Close" : Dvbbs.stats="结帖操作" Case Else Dvbbs.stats="购买帖子" End Select Dvbbs.Nav Dvbbs.Head_var 1,Dvbbs.BoardNode.attributes.getNamedItem("depth").text,"","" If Rootid="" Or Not IsNumeric(Rootid) Then Dvbbs.AddErrCode(35) If AnnounceID="" or Not IsNumeric(AnnounceID) Then Dvbbs.AddErrCode(35) If Dvbbs.UserID=0 Then Dvbbs.AddErrCode(6) Dvbbs.ShowErr() Select Case Action Case "view" : view() Case "buy" : Buy() Case "Send" : SendMoney() Case "Close" : Close() Case Else main() End Select Dvbbs.ShowErr() Dvbbs.Activeonline() Dvbbs.Footer '结帖操作 Sub Close() Dim PostBuyUser,ToUserName,PostUserID,GetMoney,Topic,TopAnnounceID,LogMsg Dim TempStr Sql = "Select Top 1 PostBuyUser,GetMoney,Topic,AnnounceID From "&PostTable&" where RootID="&Rootid&" and ParentID=0 and GetMoneyType=1 and PostUserID="&Dvbbs.UserID Set Rs=Dvbbs.Execute(Sql) If Rs.eof and Rs.bof Then Dvbbs.AddErrCode(32) Exit Sub Else PostBuyUser = Rs(0) GetMoney = Rs(1) Topic = Rs(2) TopAnnounceID = Rs(3) End If Rs.Close TempStr = Split(PostBuyUser,"|||",2) TempStr(0) = cCur(TempStr(0)) If Request.Form("ReAct")="SaveClose" Then Dim SendMoney If Not Dvbbs.ChkPost Then Dvbbs.AddErrCode(16) Exit Sub End If SendMoney = GetMoney-TempStr(0) If SendMoney<0 Then SendMoney = 0 '更新用户,返还金币 If SendMoney>0 Then Dvbbs.Execute("update [Dv_user] set UserMoney=UserMoney+"&SendMoney&" where userid="&Dvbbs.UserID) Dvbbs.MyUserInfo(37) = cCur(Dvbbs.MyUserInfo(37))+SendMoney '用户金币数量 Session(Dvbbs.CacheName & "UserID") = Dvbbs.MyUserInfo End If '更新帖子类型 Dvbbs.Execute("update Dv_Topic set GetMoneyType=5 where TopicID="&Rootid) Dvbbs.Execute("update "&PostTable&" set GetMoneyType=5 where AnnounceID="&TopAnnounceID) LogMsg = "结帖操作:赠送金币帖主题《"&Topic&"》结帖成功,还返金币数为:"&SendMoney&"" Dim Dv_LogMsg Dv_LogMsg = "结帖操作:赠送金币帖主题《"&Topic&"》结帖成功,还返金币数为:"&SendMoney Dvbbs.Execute("Insert Into Dv_Log (l_AnnounceID,l_BoardID,l_touser,l_username,l_content,l_ip,l_type) values (" & Rootid & "," & Dvbbs.BoardID & ",'" & Dvbbs.MemberName & "','" & Dvbbs.MemberName & "','" & Dvbbs.CheckStr(Dv_LogMsg) & "','" & Dvbbs.UserTrueIP & "',5)") Dvbbs.Dvbbs_Suc(LogMsg) Else %>