<% 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, ispoll, deleteRight, maxShortMsg, NoAvatar, siteWideSubscription, forumSubscription dim Revision, allowShortMsg, acceptShortMsg Dim keyAndLan, parentAuthor, displayParentAuthor, spShowMessages,forummods,hidescore,customPic, tmode, smode showResult = request.queryString("showResult") m = request.queryString("m")&"" key = request.queryString("key") language = request.queryString("language") page = request.queryString("mpage") NoAvatar = ""&memNoAvatar isSearchEngine = isSearchEngineCompatible Dim PGDrewriteString if instr(querystring,"404;") then PGDrewriteString = replace(queryString,"404;","") PGDrewriteString = replace(PGDrewriteString,forumdir,"") PGDrewriteString = replace(PGDrewriteString,"/tm.htm","") PGDrewriteString = replace(PGDrewriteString,searchDelimiter,"=") PGDrewriteString = replace(PGDrewriteString,"mpage=","page=") call removeUnwantedRewrite(PGDrewriteString, showresult, forumid, m, page, key, tmode, smode) if not isEmpty(key) then key = URLDecode(URLDecode(key)) end if keyAndLan = "&key="& Server.URLEncode(""&key) mpg = Applications("mpg") siteWideSigUpload = Applications("allowsigupload") siteWideAvatar = Applications("allowAvatar") siteWideSubscription = Applications("enableSubscribe") allowmail = iff(lcase(Applications("maildll"))<>"nomail",true,false) maxShortMsg = myPMLimit(memID) timeoffset = Applications("TimeOffset") displayParentAuthor = Applications("tmShowParentAuthor") hidescore = Applications("hidescore") Dim hideRecycledPostFromMember : hideRecycledPostFromMember = Applications("hideRecycledPostFromMember") spShowMessages = "spDisMsgM4_22" %> <% 'pgdcode.asp is not included at the top to catch the "key" if isNumeric(m) and len(m)>0 then m = clng(m) else m = 0 if len(page) = 0 or not isNumeric(page) then page = 1 messageNotAvailable = false if m = 0 then messageNotAvailable = true Dim objPGDCode Set objPGDCode = New RegExp objPGDCode.global = true objPGDCode.ignorecase = true if not messageNotAvailable then 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("@recountThread", adUnsignedTinyInt, adParamInput, 0, iff(hideRecycledPostFromMember = 1 and not isAdmin,1,0)) .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") forumID = .parameters("@forumID") isPoll = .parameters("@isPoll") Dim isThreadRecycled isThreadRecycled = iff(isNull(.parameters("@isRecycled")),false,true) end if end with set objCom = nothing Dim allMenuForums, allParentForums, multipleArrays, objCon if not messageNotAvailable then multipleArrays = getNumArrayViaRS(dbOwnerPrefix&"spTmAndM ("&forumid&","&memID&")", adCmdStoredProc,2) allForum = multipleArrays(0) allMenuForums = multipleArrays(1) memblocklist = join(ExtractOneDimension(multipleArrays(2),0),",")&"," allParentForums = GetArrayViaRS(dbOwnerPrefix&"spGetForumParents('"&GetParentOrders(allForum(35,0))&"')", adCmdStoredProc) end if end if if not messageNotAvailable then dim rights, allforum, mode, pgdCode, enableRating,allowpoll,allowvote, showratelink forumtitle = allforum(1,0) pgdCode = allforum(13,0) forumSubscription = allforum(16,0) deleteRight = allforum(21,0) enableRating = allForum(22,0) NoIMGinPosts = allForum(25,0) forummods = ","&allforum(11,0)&"," 'Dim allModsForReport:allModsForReport = allForum(11,0) '##### Test Permission code begin Dim objPermission Set objPermission = new PermissionSetting With objPermission .memID = memID .allforum = allforum .GetPermission(true) rights = .post Mode = .isModerator allowpoll = .poll allowVote = .vote enableRating = .enableRating showRateLink = .rate End With Set objPermission = nothing '##### Test Permission code end if (mode and hideRecycledPostFromMember=1) then rdcount = GetSingleValueViaRS(dbOwnerPrefix&"spDisMsgM4_1mod("&Clng(m)&")",adcmdStoredProc,null) if not allowVote then showresult=1 if rights<1 then messageNotAvailable = true if (rdcount mod mpg) <> 0 then pages = (rdcount\mpg)+1 else pages = (rdcount\mpg) if page <> "" then currpage = cdbl(abs(page)) else currpage = 1 if currpage = 0 then currpage = 1 if (currpage-1) * mpg >= rdcount then messageNotAvailable = true if rdcount = 0 then currpage = 1 pages = 1 end if ' response.write " ("& pages &", "& m &", "& currpage &", "& mpg &", "& rdcount &")" ' response.end spShowMessages = iff(hideRecycledPostFromMember=1 and not (isAdmin or mode),spShowMessages&"1",spShowMessages) ' response.write spShowMessages&" "& pages &", "& m &", "& currpage &", "& mpg &", "& rdcount ' response.end strConn= dbOwnerPrefix&spShowMessages&" ("& pages &", "& m &", "& currpage &", "& mpg &", "& rdcount &")" ' response.write strConn if not messageNotAvailable then allData = GetArrayViaRS(strConn, adCmdStoredProc) if not isArray(allData) then messageNotAvailable = true call ExecuteSQL("Update pgd_messages set totalreply = (SELECT count(*)-1 from pgd_messages where threadId="&m&") WHERE messageID="&m, adCmdText) else ub = ubound(allData,2) Dim TopicTitle lockedTopic = allData(10,0) if isThreadRecycled or not isNull(allData(30,0)) or allData(23,0)=1 then lockedTopic = 1 TopicTitle = iff(allData(23,0)<>1,ttDeletedTopic,ttAwaitMode) else TopicTitle = allData(3,0) TopicTitle = PGDCodeResolution(objPGDCode,SQLout(TopicTitle),0,-1) end if listOfParents = ","&Join(ExtractOneDimension(allData,9),",")&"," end if end if end if 'if NoIMGinPosts&"" = "1" then NoImage = "1" NoImageRes = NoImage %> <% if not (rights=0 or messageNotAvailable) then response.write (replace(replace(TopicTitle,"<span class=""high"">",""),"</span>","")) %> <%= Applications("metatags") %> <%= OutputCSS() %> > <% call headerHTML() DIM pgView,pgTitle,pgParent,threadid,p pgView = "flat" if rights<>0 and not messageNotAvailable then pgTitle = TopicTitle pgParent = "tt" threadID = m %>
<% showpollid = m : printable = false %> <% call mTableHeader() %>
<% if rights = 0 then messageNotAvailable = true %> <% if not messageNotAvailable then %> <% Dim rating, rateTimes, moderated, customTitle, score cellcolor = tablealt Dim timeBeforeEditDel:timeBeforeEditDel = Applications("timeBeforeEditDel") Dim timelimiteditdeleteunit:timelimiteditdeleteunit = Applications("timelimiteditdeleteunit") dim signature, withsig, mParent, listOfParents Dim flushCounter:flushCounter = 0 Dim hideprofile, profileAllowHide profileAllowHide = Applications("allowHideProfile") '####### new variables to speed up processing Dim tmisAdminMod:tmisAdminMod = iff(Mode or isAdmin,true,false) Dim tmCanDeleteThread:tmCanDeleteThread = iff(deleteRight = 3 and rights >=3,true,false) Dim tmCanDeletePost:tmCanDeletePost = iff((deleteRight = 2 or deleteRight = 3) and rights >=2,true,false) Dim tmCanReplyToPost:tmCanReplyToPost = iff(rights = 2 or rights = 4,true,false) '####### Dim moderatorCanDeletePermanent:moderatorCanDeletePermanent = Applications("moderatorCanDeletePermanent") Dim canModeratorDelete:canModeratorDelete = true Dim isPostByAdmin, isPostByMod Dim isRecycled, recycleReason,deletetime, deletememlogin Dim hideonline,insession,displayonline bigReplyPic = 0 for i = 0 to ub isPostByAdmin = false isPostByMod = false canModeratorDelete = true 'if not (not isNull(allData(30,i)) and hideRecycledPostFromMember=1) or (isadmin or mode) then flushCounter = flushCounter + 1 email=allData(0,i) datecreated=allData(1,i) author=allData(2,i) subject=PGDCodeResolution(objPGDCode,SQLout(allData(3,i)),0,-1) body=allData(4,i) ip=HTMLEncode(""&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 = HTMLEncode(""&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) rating = allData(21,i) rateTimes = allData(22,i) moderated = allData(23,i) customTitle = JSEncode(""&allData(24,i)) score = allData(25,i) Revision = allData(26,i) allowShortMsg = allData(27,i) acceptShortMsg = allData(28,i) mParent = allData(29,i) isRecycled = iff(isNull(allData(30,i)),false,true) recycleReason = allData(31,i)&"" deletetime = allData(32,i) hideonline = allData(33,i) insession = iff(isNull(allData(34,i)),false,true) parentAuthor = allData(35,i) hideprofile = allData(36,i) deletememlogin = allData(37,i) customPic = allData(38,i) isPostByAdmin = Administrator(mem) isPostByMod = instr(forummods,","&mem&",") if not isRecycled and moderated<>1 then bigReplyPic = messageID pgTitle = subject Dim readTrackTime:readTrackTime = datecreated end if if isRecycled and moderatorCanDeletePermanent = 0 and not isAdmin then canModeratorDelete = false end if Dim isMyOwnPost:isMyOwnPost = iff(mem&""=memID,true,false) displayonline = tmOnlineStatus & _ iff(not insession or (insession and hideonline=1 and not isAdmin),""&memberOfflineDesc,""&memberOnlineDesc)&"" Dim bIgnore, bLink bIgnore = False : bLink = "" If Instr(","&memBlockList, "," & mem & ",") > 0 Then bIgnore = True subject = tmSubBlockedDesc avatar = "" sigpicture = "" upfile = "" dispicture = "" signature = "" location = "" withsig = 0 body = replace(replace(tmMsgBlockedDesc,"{mem}",mem),"&mode=unblock","&mode=unblock&pg=tm&m="&messageID) bLink = " " Else if ((allowShortMsg = 1 and acceptShortMsg = 1) or isAdmin) and maxShortMsg<>0 then bLink = iff(ispop," "," ") blink = blink & "" end if bLink = bLink & " " bLink = bLink & " " End If if isRecycled then subject = ttDeletedTopic avatar = "" sigpicture = "" upfile = "" dispicture = "" signature = "" location = "" withsig = 0 Dim unTouchedBody:unTouchedBody = body body = replace(replace(NewMsgRecycledDesc,"{memlogin}",iff(len(deletememlogin&"")<>0,deletememlogin,"---")),"{deletetime}",SQLDate(deletetime, timeoffset, true)) & iff(len(recycleReason),tmRecycledReason&recycleReason,"")'deleted tag if mode or isadmin then body = body & "

" & unTouchedBody & "


" & replace(tmPostRestoreDesc,"{msgid}",messageID)'original body else moderationRequired = true end if lockedTopic = 1 end if if len(score&"") = 0 then score = 0 if emailview = 0 and not isAdmin then email = "" else if allowmail then email= "" else email= "" end if email = email & "" end if upfile = iff(len(upfile&"")>0,""&tmAttachedFile&" ("&(ubound(split(upfile&"","|"))+1)&")","") disPicture = iff(NoAvatar <> "1",displayAvatarAndSelfPicture(avatar,sigpicture,memberchoice,Mem,siteWideSigUpload,siteWideAvatar, totalposts)," ") Dim editDeleteAllowed editDeleteAllowed = false if not (isadmin or mode) then if isMyOwnPost and (Datediff(timelimiteditdeleteunit, SQLMediumDate(datecreated), SQLNowdate()) < timeBeforeEditDel or timeBeforeEditDel = 0) then editDeleteAllowed = true end if end if Dim parentLink:parentLink = "" if displayParentAuthor = 1 and not isRecycled then parentLink = "
("&postMsgReplyTo&"#parentID#)" else parentAuthor = mParent end if if ((profileAllowHide = 1 or isPostByAdmin) and hideprofile = 1) and not isAdmin then location = "" dateSignUp = "" end if location = iff(len(location&""),memberFromDesc &" "& location&"
","") dateSignUp = iff(len(dateSignUp&""),memberSinceDesc &" "& SQLDate(dateSignUp, timeoffset, false)&"
","") Dim moderationRequired:moderationRequired = false Dim showModerateIcon:showModerateIcon = false if moderated=1 and not (isAdmin or mode or (isMyOwnPost and not isGuest)) then moderationRequired = true if moderated=1 and (isAdmin or mode) then showModerateIcon = true body = SQLout(body) signature = SQLout(signature) %>
<% if memViewPref<>2 then %> <% End If %>
class="cat" colspan="2">
> <% if not moderationRequired then %> " border="0" align="absmiddle"> <%= Shrink(subject,60) %> - <%= SQLdate(datecreated, timeoffset, true) %>  <%= PostRating(rating, ratetimes) %> <% if moderated=1 then %> <%= ttAwaitMode %> <% end if %> <% else %> <%= ttAwaitMode %> <% end if %> <% if showModerateIcon then %> <% end if %> <% if (tmisAdminMod or (editDeleteAllowed and tmCanDeletePost and mParent<>0) _ or (editDeleteAllowed and tmCanDeleteThread )) and not isGuest and canModeratorDelete then %> <% end if %> <% if not (moderationRequired or bIgnore or isRecycled) then %> <% if not messageNotAvailable and tmCanReplyToPost and (lockedTopic <> 1 or tmisAdminMod) and moderated<>1 then %> <% end if %> <% if (editDeleteAllowed and not isGuest and lockedTopic <> 1) or tmisAdminMod then %> <% end if %> <% if (allowmail and not isGuest and moderated<>1 and memTotalPosts>=fwdPostRestrict) or tmisAdminMod then %> <% end if %> <% end if %>
?from=approve&m=<%= messageID %>" onclick="return confirmDeletion('<%= JSEncode(adminApproveDesc) %>')" title="<%= adminApproveDesc %>"> " border="0" align="absmiddle"> ?from=dm&m=<%= messageID %>'))" title="<%= adminDeleteDesc %>"> " border="0" align="absmiddle"> ?do=reply&messageID=<%=messageID%>&toStyle=<%= toStyle & popBracket(ispop,1) %>" title="<%= tmReply %>"> " border="0" align="absmiddle"> ?do=reply&q=1&messageID=<%=messageID%>&toStyle=<%= toStyle & popBracket(ispop,1) %>" title="<%= tmReply %>"> " border="0" align="absmiddle">?messageID=<%= messageID %>&toStyle=<%= toStyle & popBracket(ispop,1) %>" title="<%= tmEdit %>"> " border="0" align="absmiddle"> ?messageID=<%=messageID%>'))" title="<%= tmForward %>"> " align="absmiddle" border="0">
width="<%=authorFieldWidth%>" valign="top" class="ultrasmall" nowrap> <%= iff(mem>-1,"","") & author & iff(mem>-1,"","") %>
<% if (Mem > -1) and not (bIgnore or isRecycled) then %>
<%= dispicture %>

<%= tmPostCountOfAuthor &" "& totalposts%>
<%= iff(enableRating>0 and hidescore=0,tmScoreDesc&" "&score&"
","") %> <%= dateSignUp %> <%= location %> <%= displayonline %> <% end if %> " align="right" border="0" width="<%=authorFieldWidth%>" height="1">
valign="top" class="msg" width="100%" <%= iff(memViewPref<2,"","colspan=""2""") %>> <%= iff(memViewPref=2,iff(mem>-1,"","") & author & iff(mem>-1,"","")&"
","") %> <% if not moderationRequired then %> <% if isPostByAdmin or isPostByMod then NoIMGinPosts="0" %> <%= (PGDCodeResolution(objPGDCode,body,pgdCode,mem))%> <%= iff(len(upfile),"

"&upfile,"") %> <%= iff(isRecycled,"",newEditFormat(edit,1)) %> <% NoIMGinPosts = "0" %> <% NoImage = iff(isPostByAdmin,"0",NoSigImage) %> <%= iff(withsig = 1 and len(signature)>0,PGDCodeResolution(objPGDCode,sigDivider&signature,pgdCode,-1),"") %> <% NoImage = NoImageRes %> <% NoIMGinPosts = allForum(25,0)&"" %>
<% If mparent<>0 and len(parentAuthor) <> 0 and not bIgnore then %> <% if instr (listOfParents,","&mparent&",")<>0 then %> <%= Replace(Replace(parentLink,"<%#Link>","#"&mparent),"#parentID#",parentAuthor) %> <% else %> <%= Replace(Replace(parentLink,"<%#Link>",linkModifier("fb.asp")&"?m="&mparent),"#parentID#",parentAuthor) %> <% end if %> <% End If %>
<% else %> <%= ttAwaitMode %> <% end if %>
width="100%" colspan="2">
<%= iff(mem<0 or isMyOwnPost," ",email & blink) %> <% if not (isRecycled or moderated=1) then %> <% If not (isMyOwnPost or isGuest) then %> <% if not (isAdmin or mode) then %>?messageID=<%=messageID%>')"><%= tmReportDesc %> | <% end if %> <% if (showRateLink) then %>?action=rate&m=<%= messageID %>'))"><%= tmRateThisDesc %> | <% end if %> <% End If %> <% if Revision > 0 then %> <%= tmRevision %> <%= Revision %> | <% end if %> <% End If %> <%= tmPostNumDesc&((currpage-1)*mpg+i+1) %> <% if isAdmin then response.write (" | IP: "&ip)%> " align="absmiddle" border="0">
<% 'End If %> <% next %> <% 'response.write ("after:"&(timer-nstart)) %> <% Set objPGDCode = nothing %> <% if appReadTracking=1 and bigReplyPic <>0 then call readTrackThread(threadid,readTrackTime,"t") %> <% else Dim errorResponse if rights <> 0 or isEmpty(rights) then errorResponse = MessageUnavailableMessage else errorResponse = PrivateRightViolationMessage end if %>
align="center" nowrap class="subhead" colspan=2>
<%= errorResponse %>

<% end if %> <% if not messageNotAvailable then %>
<%= pageDesc %>  <% call pagelistNewM(m,currpage,pages,titlefontcolor,0) %>
<% end if %> <% if not messageNotAvailable then lockedTopic = iff(isThreadRecycled or allData(10,0)=1 or bigReplyPic=0,1,0) %> <% call mTopNav(bigReplyPic,pgTitle) %> <% call qReply() %> <% call jumpmenu(forumid) %>

" target="_self" name="searchPage">


<% call iconLegend(rights, allowPoll, allowVote, allforum, showRateLink) %> <% call footerHTML() %>