%
dim messageID,page,objRS,Subject,Body,Name,Email,access,arrEdit,mem,forumID,appid,PGDCode, allforum, allowupload, oriMsgIcon, withsig
dim sig, locked, upRestriction,isUploadAllowed,strSQL, temparr, onload,datecreated,timeBeforeEditDel
Dim upfile,NoIMGinPosts, mode,returnedValue, upSetting, objCom, needRevision, isFAQ, isTOP, allowpoll, addpoll
Dim isPoll, parent
messageID = request("messageID")
PGDCode = application(dbName&"foruminfo")(13,appid)
timeBeforeEditDel = Application(dbName&"timeBeforeEditDel")
addpoll = ""&request.querystring("addpoll")
if len(messageID) = 0 then response.redirect("redirect.asp")
set objRS = Server.CreateObject("ADODB.RECORDSET")
objRS.open dbOwnerPrefix&"spGetEdit("&messageID&")", datastore, , , adCmdStoredProc
if not (objRS.EOF and objRS.BOF) then arrEdit=objRS.getrows
objRS.close
set objRS=nothing
mem=arrEdit(0,0)
Name=HTMLEncode(""&arrEdit(1,0))
Body=arrEdit(2,0)
Subject=arrEdit(3,0)
Email=HTMLEncode(""&arrEdit(4,0))
forumID=arrEdit(5,0)
upfile=arrEdit(6,0)
oriMsgIcon = arrEdit(7,0)
withsig = arrEdit(8,0)
sig = arrEdit(9,0)
locked = arrEdit(10,0)
datecreated = arrEdit(11,0)
isTop = arrEdit(12,0)
isFAQ = arrEdit(13,0)
isPoll = arrEdit(14,0)
parent = arrEdit(15,0)
if Email = "none" then Email=""
access = false
allforum = Application(dbName&"foruminfo")
appid = ForumIdToAppid(forumID)
PGDCode = allforum(13,appid)
needRevision = allforum(27,appid)
Dim objPermission
Set objPermission = new PermissionSetting
With objPermission
.memID = memID
.appid = appid
.GetPermission(true)
Mode = .isModerator
allowpoll = .poll
if not isGuest and memID = ""&mem then
if timeBeforeEditDel = 0 then
access = true
else
if Datediff("d", SQLMediumDate(datecreated), SQLNowdate()) < timeBeforeEditDel then _
access = true
end if
end if
if locked = 1 then access = false
if mode then access = true
if isAdmin then access = true
if not (isnull(sig) or sig="") then sig = SQLout(sig)
if access then
subject = SQLout(subject)
body = SQLout(body)
onload = "onload=""document.forms[0].body.focus();"""
end if
if access and not isAdmin then
upsetting = .Upload
upRestriction = .UploadRestriction
returnedValue = .UploadReturnedValue
end if
End With
Set objPermission = nothing
Dim displayPollInput:displayPollInput = false
Dim displayPollButton:displayPollButton = false
if addpoll="true" and allowpoll and isPoll<>1 and parent = 0 then displayPollInput = true
if addpoll="" and allowpoll and isPoll<>1 and parent = 0 then displayPollButton = true
if access and memID = ""&mem then
isUploadAllowed = true
if not isAdmin then
if upSetting<>"" and returnedValue <> -1 then 'see if the user is allowed to upload
temparr = split(upSetting,"|")
if isArray(temparr) then 'see if the user is allowed to upload again
UpLoadSizeLimit = temparr(0)
if ubound(temparr)=1 then 'these two lines are requirements for user to upload
uploadformat = temparr(1) 'both uploadformat and UpLoadSizeLimit have to have some values
else
uploadformat = ""
end if
if (UpLoadSizeLimit = "0" or UpLoadSizeLimit="") or (uploadformat="") then 'user not allowed to upload
isUploadAllowed = false
end if
else
isUploadAllowed = false 'temparr is empty
end if
else
isUploadAllowed = false
end if
end if
else
isUploadAllowed = false
end if
NoIMGinPosts = allforum(25,appid)
'response.write(upSetting&"
")
'response.write(mode&"
")
'response.write(returnedValue)
%>