%
Dim rdcount, i, edit, Mem, forumID, arr
Dim forumtitle, strThreadsR,strThreadsL, show, keyorshow
Dim strConn, objRS, allData, email, datecreated, author, m, mpg
Dim messageID, subject, body, ip,upfile, pagedThread, pages, currpage, objCom
Dim allCat, messageNotAvailable, showResult
Dim siteWideSigUpload, siteWideAvatar
dim cellcolor, motherthread, lockedTopic, ub, timeoffset, allowmail, dateSignUp, location, sigpicture,emailview, msgIcons
dim disPicture, avatar, memberchoice,moderated
dim signature, withsig,NoIMGinPosts
siteWideSigUpload = Application(dbName&"allowsigupload")
siteWideAvatar = Application(dbName&"allowAvatar")
showResult = request.queryString("showResult")
m = request.queryString("m")
page = request.queryString("mpage")
allforum = Application(dbName&"foruminfo")
Dim keyandlan
isSearchEngine = isSearchEngineCompatible
Dim PGDrewriteString
if instr(querystring,"404") and m="" then
'test PGDrewrite
PGDrewriteString = replace(queryString,"404;","")
PGDrewriteString = replace(PGDrewriteString,forumdir,"")
PGDrewriteString = replace(PGDrewriteString,"/printable.htm","")
PGDrewriteString = replace(PGDrewriteString,searchDelimiter,"=")
PGDrewriteString = replace(PGDrewriteString,"mpage=","page=")
'response.write removeUnwantedRewrite(PGDrewriteString)
'response.end
execute removeUnwantedRewrite(PGDrewriteString)
end if
'response.end
'test PGDrewrite
messageNotAvailable = false
if not (isNumeric(m) and isNumeric(appid)) then
messageNotAvailable = true
end if
Dim key, language
mpg = Application(dbName&"mpg")
if not messageNotAvailable then
Dim isPoll
set objCom = server.createobject("adodb.command")
With objCom
.activeconnection = datastore
.commandtype = adCmdStoredProc
.commandText = dbOwnerPrefix&"spDisMsgM4_1"
.Parameters.Append .Createparameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0)
.Parameters.Append .Createparameter("@int_ThreadId", adInteger, adParamInput, 0, m)
.Parameters.Append .Createparameter("@rdcount", adInteger, adParamOutput, 0)
.Parameters.Append .Createparameter("@forumId", adInteger, adParamOutput, 0)
.Parameters.Append .Createparameter("@isPoll", adInteger, adParamOutput, 0)
.Parameters.Append .Createparameter("@isRecycled", adInteger, adParamOutput, 0)
.execute , , adExecuteNoRecords
If .parameters("@RETURN_VALUE") = 0 then
messageNotAvailable = true
else
rdcount = .parameters("@rdcount") + 1
forumID = .parameters("@forumID")
isPoll = .parameters("@isPoll")
Dim isThreadRecycled
isThreadRecycled = iff(isNull(.parameters("@isRecycled")),false,true)
end if
end with
set objCom = nothing
end if
if isThreadRecycled then messageNotAvailable = true
if not messageNotAvailable then
dim rights, allforum, mode, pgdCode
appid = ForumIdToAppid(forumID)
'this is to mediate problem of bug #1
if request.queryString("appid")<>"" and cStr(appid) <> request.queryString("appid") then
messageNotAvailable = true
if isNumeric(appid) then
appid = clng(request.queryString("appid"))
end if
end if
'end of bug #1
forumtitle = allforum(1,appid)
Dim objPermission
Set objPermission = new PermissionSetting
With objPermission
.memID = memID
.appid = appid
.GetPermission(false)
rights = .post
Mode = .isModerator
End With
Set objPermission = nothing
pgdCode = allforum(13,appid)
Dim catID, catName, sCat, catApp
allCat = Application(dbName&"Category")
catID = allForum(5,appid)
for sCat = 0 to ubound(allCat,2)
if allCat(0,sCat) = catID then
catApp = sCat
exit for
end if
next
catName = allCat(1,catApp)
erase allCat
if (rdcount mod mpg) <> 0 then pages = (rdcount\mpg)+1 else pages = (rdcount\mpg)
if page <> "" then currpage = page else currpage = 1
if rdcount = 0 then
currpage = 1
pages = 1
end if
strConn= dbOwnerPrefix&"spDisMsgM4_21 ("& pages &", "& m &", "& currpage &", "& mpg &", "& rdcount &")"
set objRS = server.createobject("adodb.recordset")
with objRS
.CacheSize = mpg
.open strConn, datastore, , , adcmdStoredProc
if .EOF then
messageNotAvailable = true
else
allData=.getrows
end if
.close
end with
set objRS=nothing
Dim TopicTitle, totalposts
TopicTitle = SQLout(allData(3,0))
lockedTopic = allData(10,0)
end if
strTableWidth = "98%"
showresult=1
NoImage = "1"
NoSmile = "1"
%>
<%= TopicTitle %>
<% if rights = 0 then messageNotAvailable = true %>
<% if not messageNotAvailable then %>
<% showpollid = m
printable = true
%>
|
<%
allowmail = Application(dbName&"maildll")
timeoffset = Application(dbName&"TimeOffset")
'forumtitle = Application(dbName&"forumtitle")
'cellcolor = tablealt
ub = ubound(allData,2)
Dim objPGDCode
Set objPGDCode = New RegExp
objPGDCode.global = true
objPGDCode.ignorecase = true
for i = 0 to ub
'if cellcolor = tablealt then cellcolor = tableinside else cellcolor=tablealt
email=allData(0,i)
datecreated=allData(1,i)
author=allData(2,i)
subject=allData(3,i)
body=allData(4,i)
ip=allData(5,i)
Mem=allData(6,i)
edit=allData(7,i)
upfile=allData(8,i)
messageID=allData(9,i)
lockedTopic = allData(10,i)
totalposts = allData(11,i)
dateSignUp = allData(12,i)
location = allData(13,i)
sigpicture = allData(14,i)
emailview = allData(15,i)
msgIcons = allData(16,i)
avatar = allData(17,i)
memberchoice = allData(18,i)
signature = allData(19,i)
withsig = allData(20,i)
moderated = allData(23,i)
if edit<>"" then edit="
"&edit
if isnull(upfile) or len(upfile)=0 then
upfile=" "
else
upfile=""&upfile&""
end if
if isnull(location) or len(location) = 0 then
location=" "
else
location= memberFromDesc &" "& HTMLEncode(""&location)
end if
subject = SQLout(subject)
body = SQLout(body)
signature = SQLout(signature)
%>
|
<% If moderated = 0 then %>
<%= author %> -> <%= subject %> (<%= SQLdate(datecreated, timeoffset, true) %>)
<% else %>
<%= ttAwaitMode %>
<% end if %>
|
<% If moderated = 0 then %>
<%= (PGDCodeResolution(objPGDCode,body,pgdCode))%>
<% else %>
<%= ttAwaitMode %>
<% end if %>
|
|
|
|
<% next %>
<%
Set objPermission = nothing
Set objPGDCode = nothing
%>
|
<%= (pageDesc) %>
<% call pagelistNewM(m,currpage,pages,"","","","",1) %>
|
|
<% else
Dim errorResponse
if rights <> 0 or isEmpty(rights) then
errorResponse = MessageUnavailableMessage
else
errorResponse = PrivateRightViolationMessage
end if
%>
<% end if %>