%
Dim objRS, sig, bodyquote, messageID, threadID
dim rights,allforum, emnotify, PGDCode, forumID
Dim r_do, appid, subject, arrReply, emailview, allowupload, isPostAllowed
Dim oriMsgIcon, alwaysSig, upRestriction,isUploadAllowed, temparr,NoIMGinPosts
Dim parentAuthor, upSetting, mode, returnedValue,objCom, uploadErrMsgDisp, memberModerated
Dim needRevision, isTop, isFAQ, locked, allowpoll
r_do = request.queryString("do")
isPostAllowed = true
allforum = Application(dbName&"foruminfo")
messageID = request.queryString("messageID")
if messageID = "" then messageID = 0' fill in messageID for r_do<>"reply" for spPostOrReply
if len(r_do) = 0 then response.redirect ("redirect.asp")
if r_do="reply" then
set objRS = server.createobject("adodb.recordset")
objRS.open dbOwnerPrefix&"spPostOrReply("& MemID &", "& messageID &")", datastore, , ,adCmdStoredProc
if not (objRS.state = adStateClosed) then
sig = objRS(0).value
alwaysSig = objRS(1).value
memberModerated = objRS(2).value
set objRS = objRS.nextrecordset
arrReply = objRS.getRows
objRS.close
else
isPostAllowed = false
end if
set objRS = nothing
if isPostAllowed then
parentAuthor = arrReply(1,0)
threadID = arrReply(2,0)
forumID = arrReply(3,0)
subject = SQLout(arrReply(4,0))
isTop = arrReply(5,0)
isFAQ = arrReply(6,0)
locked = arrReply(7,0)
Dim quoteContent:quoteContent = arrReply(0,0)
bodyquote = vbcrlf & "[quote]" & quotePrefix & " " & parentAuthor & vbcrlf & vbcrlf & SQLout(quoteContent) & vbcrlf &"[/quote]"& vbcrlf
appid = ForumIdToAppid(forumID)
PGDCode = allforum(13,appid)
end if
else
set objRS = server.createobject("adodb.recordset")
objRS.open dbOwnerPrefix&"spPostOrReply("& MemID &", "& messageID &")", datastore, , ,adCmdStoredProc
sig = objRS(0).value
alwaysSig = objRS(1).value
memberModerated = objRS(2).value
objRS.close
set objRS = nothing
' appid = request.queryString("appid")
' forumID = allforum(0,appid)
forumid = request.querystring("forumid")
appid = ForumIdToAppid(forumID)
PGDCode = allforum(13,appid)
end if
Dim objPermission
Set objPermission = new PermissionSetting
With objPermission
.memID = memID
.appid = appid
if r_do="poll" then
.GetPermission(true)
allowpoll = .poll
else
.GetPermission(false)
end if
rights = .post
Mode = .isModerator
If r_do="reply" then
if not ( rights = 2 or rights = 4 ) then isPostAllowed = false
else
if r_do="poll" and not allowpoll then isPostAllowed = false
if rights < 3 then isPostAllowed = false
end if
if isPostAllowed and not isAdmin then 'Get upload permission
upsetting = .Upload
upRestriction = .UploadRestriction
returnedValue = .UploadReturnedValue
end if
End With
Set objPermission = nothing
if not (isadmin or mode) and locked = 1 then
isPostAllowed = false
end if
if isPostAllowed then 'Checking Upload Permission
sig = SQLout(sig)
isUploadAllowed = true
if not isAdmin then
if upSetting<>"" and returnedValue <> -1 then 'see if the user is allowed to upload; returnedValue = -1 means not meet upload requirement
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 len(UpLoadSizeLimit)=0) or (len(uploadformat)=0) then 'user not allowed to upload
isUploadAllowed = false
uploadErrMsgDisp = replace(RightViolationMessage,"
","")
end if
else
isUploadAllowed = false 'temparr is empty
end if
else
isUploadAllowed = false
if isGuest then
uploadErrMsgDisp = replace(RightViolationMessage,"
","")
else
uploadErrMsgDisp = replace(uploadErrorMsg,"{0}",upRestriction)
end if
end if
end if
end if
NoIMGinPosts = allforum(25,appid)
'response.write(upSetting&"
")
'response.write(mode&"
")
'response.write(returnedValue)
Dim key, language
%>