% LanguageParser.IncludeSection "pm" '///Check if user has logged in if inside <> 1 then objDAL.Disconnect Response.Redirect "default.asp" end if '/// Delete Function Private Function Delete(byval id) 'First look if the sender has deleted this in his outbox incase not just mark this as deleted by reciver Dim strSQL, arrDelete strSQL = "SELECT pmDelete, pmFromId FROM aspbb_PM WHERE pmId={0}" objDAL.open arrDelete, strSQL, array(id) If not eof(arrDelete) then If arrDelete(0,0) = 0 then If arrDelete(1,0) = userid then 'pmDelete 2 means sender deleted message strSQL = "UPDATE aspbb_PM SET pmDelete=2 WHERE pmId={0}" ELse 'pmDelete 1 means reciver deleted message strSQL = "UPDATE aspbb_PM SET pmDelete=1, pmStatus=1 WHERE pmId={0}" End if Else 'if pmDelete isnt 0 and we are reading that can only mean that the other part deleted it from his 'inbox/outbox so we just wipe it out of the database. strSQL = "DELETE FROM aspbb_PM WHERE pmID ={0}" End if objDAL.Execute strSQL, array(id) Else End if End Function '/// Delete message 'Delete requested if it matches userid If len(Request.QueryString("delete")) <> 0 then Delete(Request.QueryString("delete")) objDAL.Disconnect Response.Redirect("inbox.asp") End if '/// Delete multiple messages With Request i = 0 Dim Item For each Item in .Form If .Form(Item) <> "0" Then Delete(.form(Item)) End if i=i+1 next If i > 0 then objDAL.Disconnect Response.Redirect("inbox.asp") End if End With '/// Read message If len(Request.QueryString("read")) <> 0 then %> <% =langMSG %> <% dim arrRead, intRead intRead = Request.QueryString("read") strSQL = "SELECT pmSubject, pmText, pmFromId, pmId FROM aspbb_PM WHERE pmToId={0} AND pmId={1} OR pmFromID={0} AND pmId={1}" objDAL.open arrRead, strSQL, array(userid,intRead) If not EOF(arrRead) then %>
<% =Server.HTMLEncode(arrRead(0,0)) %> |
<% =ASPBBCode(arrRead(1,0),0) %>
<% If arrRead(2,0) <> userid Then 'Only show reply if the user didnt create this message %>
<% =langReply %>
<% End if %>
<% =langDelete %>
|
<% =LanguageParser.GetKey("errors", "ErrorGeneral") %> |
<% =LanguageParser.GetKey("errors", "ErrorPM") %> |
<% =langInformation %> |
<% =langNewPM %>
<% =langReadPM %>
<% =langReplyPM %>
|