% Dim Action,AllSmsSize If Not BBS.FoundUser Then BBS.GoToErr(20) BBS.Position=BBS.Position&" -> 用户控制面版" Action=Lcase(Request("Action")) BBS.Head "sms.asp","","处理信件" ShowMySmsInfo() If Len(Action)>10 Then BBS.GoToErr(1) Select Case Action Case"save" SaveSms Case"del" Del Case"delall" DelAll Case"write" WriteSms Case Else ReadSms End Select BBS.Footer() Set BBS =Nothing Sub Del Dim ID,I,Rs ID=BBS.CheckNum(request("ID")) Set Rs=BBS.Execute("Select MyName,Name From[sms] where ID="&ID&" And (Name='"&BBS.MyName&"' or MyName='"&BBS.MyName&"')") If not Rs.eof then If Lcase(BBS.MyName)=Lcase(Rs(0)) Then BBS.execute("Update [sms] set MyFlag=2 where ID="&ID) Else BBS.execute("Update [sms] set Flag=2 where ID="&ID) End If BBS.Execute("Delete from [sms] where MyFlag=2 And Flag=2") BBS.Execute("Update [User] set SmsSize=SmsSize-1 where ID="&BBS.MyID) End If Rs.close Set Rs=Nothing Response.Redirect "sms.asp" End Sub Sub DelAll Dim ID,I ID=BBS.CheckNum(request("ID")) I=0 If ID=1 Then'删收箱 I=BBS.Execute("select count(*) From[Sms] where Name='"&MyName&"' And Flag=0" )(0) BBS.Execute("Update [sms] Set MyFlag=2 where MyName='"&BBS.MyName&"'") ElseIf ID=2 Then'删发箱 I=BBS.Execute("select count(*) From[Sms] where MyName='"&MyName&"' And Flag<>2" )(0) BBS.Execute("Update [sms] Set Flag=2 where Name='"&BBS.MyName&"'") Else BBS.Execute("Update [sms] Set Flag=2 where Name='"&BBS.MyName&"'") BBS.Execute("Update [sms] Set MyFlag=2 where MyName='"&BBS.MyName&"'") End If If isnull(I) Then I=0 BBS.Execute("Update [User] set SmsSize="&i&" where ID="&BBS.MyID) BBS.Execute("Delete from [sms] where MyFlag=2 And Flag=2") Session(CacheName & "MyInfo") = Empty BBS.Alert"清空所有信件成功!","sms.asp" End Sub Sub ShowMySmsInfo() Dim SmsSize,content SmsSize=int(SESSION(CacheName & "MyInfo")(20)) AllSmsSize=SmsSize/Int(SESSION(CACHENAME & "MYGRADEINFO")(18))*100 If AllSmsSize>100 Then AllSmsSize=100 IF AllSmsSize<0 Then AllSmsSize=0 IF AllSmsSize>0 And AllSmsSize<1 Then AllSmsSize=1 Content=SmsSize/SESSION(CacheName & "MyGradeInfo")(18)*250 If Content>250 Then Content=250 Content="
" Response.Write BBS.ReadSkins("用户控制面版") BBS.ShowTable"论坛留言信箱",Content End Sub Sub ReadSms() Dim S,div,Content,Temp,UserPic,Rs,P,strPageInfo,Arr_Rs,I,Caption,bgColor,IUBB,Sqlwhere,title,UserName If Action="elapse" Then Title="发送的信件记录" Sqlwhere="Name='"&BBS.MyName&"' and Flag=0" ElseIf Action="colloquy" Then UserName=Request.querystring("Name") If Not BBS.Fun.CheckName(UserName) Then BBS.GoToErr(1) Title="和"&UserName&"的交谈记录" Sqlwhere="(MyName='"&BBS.MyName&"' and Name='"&UserName&"' and MyFlag<2) or (Name='"&BBS.MyName&"' And MyName='"&UserName&"' and Flag=0)" Else Title="收取信件" Sqlwhere="MyName='"&BBS.MyName&"' and MyFlag<2" End If Set P = New Cls_PageView P.strTableName = "[Sms]" P.strPageUrl="?Action="&Action P.strFieldsList = "ID,Name,Content,AddTime,MyFlag,UbbString,Flag,MyName" P.strCondiction = Sqlwhere P.strOrderList = "ID desc" P.strPrimaryKey = "ID" P.intPageSize = 10 P.intPageNow = Request.querystring("page") P.strCookiesName = "Sms"&Action P.InitClass Arr_Rs = P.arrRecordInfo strPageInfo = P.strPageInfo Set P = nothing If IsArray(Arr_Rs) Then Set IUBB=New Cls_IUBB Div="亲爱的用户,您的论坛留言信箱容量已满,请尽快删除一些信件!