<% Dim rdcount, tpage, 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 tmode, 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 NoIMGinPosts, Revision, allowShortMsg, acceptShortMsg dim smode Dim key, language, keyAndLan, parentAuthor, displayParentAuthor, spShowMessages,forummods showResult = request.queryString("showResult") m = request.queryString("m") key = request.queryString("key") language = request.queryString("language") page = request.queryString("mpage") NoAvatar = ""&request.cookies(dbName&"ASPplayground_forum_Speed")("NoAvatar") tpage = request.queryString("p") tmode = request.queryString("tmode") smode = request.queryString("smode") 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,"p=","tpage=") PGDrewriteString = replace(PGDrewriteString,"mpage=","page=") 'response.write removeUnwantedRewrite(PGDrewriteString) 'response.end execute removeUnwantedRewrite(PGDrewriteString) if not isEmpty(key) then key = URLDecode(URLDecode(key)) end if keyAndLan = "&key="& Server.URLEncode(""&key) mpg = Application(dbName&"mpg") siteWideSigUpload = Application(dbName&"allowsigupload") siteWideAvatar = Application(dbName&"allowAvatar") allforum = Application(dbName&"foruminfo") siteWideSubscription = Application(dbName&"enableSubscribe") allowmail = iff(lcase(Application(dbName&"maildll"))<>"nomail",true,false) maxShortMsg = Application(dbName&"maxShortMsg") timeoffset = Application(dbName&"TimeOffset") displayParentAuthor = Application(dbName&"tmShowParentAuthor") if displayParentAuthor = 1 then spShowMessages = "spDisMsgM4_22" else spShowMessages = "spDisMsgM4_21" %> <% messageNotAvailable = false if not (isNumeric(m) and isNumeric(appid)) or len(m)=0 then messageNotAvailable = true end if if not isNumeric(page) then page = 1 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("@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 not messageNotAvailable then dim rights, allforum, mode, pgdCode, enableRating,allowpoll,allowvote, showratelink 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) pgdCode = allforum(13,appid) forumSubscription = allforum(16,appid) deleteRight = allforum(21,appid) enableRating = allForum(22,appid) NoIMGinPosts = allForum(25,appid) forummods = ","&allforum(11,appid)&"," Dim allModsForReport:allModsForReport = allForum(11,appid) '##### Test Permission code begin Dim objPermission Set objPermission = new PermissionSetting With objPermission .memID = memID .appid = appid .GetPermission(true) rights = .post Mode = .isModerator allowpoll = .poll allowVote = .vote enableRating = .enableRating showRateLink = .rate End With Set objPermission = nothing '##### Test Permission code end if rights<1 then messageNotAvailable = true 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 tmode = tmodeProcess(tmode) smode = smodeProcess(smode) ' response.write rdcount&"
" 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 strConn= dbOwnerPrefix&spShowMessages&" ("& pages &", "& m &", "& currpage &", "& mpg &", "& rdcount &")" if not messageNotAvailable then 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 ub = ubound(allData,2) Dim TopicTitle TopicTitle = SQLout(allData(3,0)) lockedTopic = allData(10,0) if isThreadRecycled then lockedTopic = 1 listOfParents = ","&Join(ExtractOneDimension(allData,9),",")&"," end if end if if NoIMGinPosts&"" = "1" then NoImage = "1" NoImageRes = NoImage 'response.write timer-nstart %> <% if not (rights=0 or messageNotAvailable) then response.write (SQLOut(TopicTitle)) %> <%= 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 = Application(dbName&"timeBeforeEditDel") dim signature, withsig, mParent, listOfParents Dim flushCounter:flushCounter = 0 Dim hideprofile, profileAllowHide profileAllowHide = Application(dbName&"allowHide") Dim objPGDCode Set objPGDCode = New RegExp objPGDCode.global = true objPGDCode.ignorecase = true '####### 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 and rights >=2,true,false) Dim tmCanReplyToPost:tmCanReplyToPost = iff(rights = 2 or rights = 4,true,false) '####### for i = 0 to ub flushCounter = flushCounter + 1 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) 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) Dim isRecycled, recycleReason,deletetime isRecycled = iff(isNull(allData(30,i)),false,true) recycleReason = allData(31,i)&"" deletetime = allData(32,i) Dim bIgnore, bLink bIgnore = False : bLink = "" If len(memBlockList) <> 0 Then If Instr(","&memBlockList, "," & mem & ",") > 0 Then bIgnore = True subject = tmSubBlockedDesc avatar = "" sigpicture = "" upfile = "" dispicture = "" signature = "" location = "" withsig = 0 body = replace(tmMsgBlockedDesc,"{mem}",mem) End If End If if isRecycled then subject = ttDeletedTopic avatar = "" sigpicture = "" upfile = "" dispicture = "" signature = "" location = "" withsig = 0 Dim unTouchedBody:unTouchedBody = body body = replace(ttTmMsgRecycledDesc,"{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 if len(edit)<>0 then edit="


"&edit if len (upfile&"") then upfile=""&tmAttachedFile&" ("&(ubound(split(upfile,"|"))+1)&")" else upfile="" end if if NoAvatar <> "1" then disPicture = displayAvatarAndSelfPicture(avatar,sigpicture,memberchoice,Mem,siteWideSigUpload,siteWideAvatar, totalposts) else disPicture = " " end if if len(location&"") then location= memberFromDesc &" "& location else location=" " end if If bIgnore Then bLink = " " Else if ((allowShortMsg = 1 and acceptShortMsg = 1) or isAdmin) and maxShortMsg<>0 then bLink = "  " end if bLink = bLink & " " bLink = bLink & " " End If Dim editDeleteAllowed editDeleteAllowed = false if not (isadmin or mode) then if (memID = cStr(mem)) and (Datediff("d", SQLMediumDate(datecreated), SQLNowdate()) < timeBeforeEditDel or timeBeforeEditDel = 0) then editDeleteAllowed = true end if end if Dim parentLink:parentLink = "" if displayParentAuthor = 1 and not isRecycled then parentAuthor = allData(33,i) parentLink = " ("&postMsgReplyTo&"#parentID#)" else parentAuthor = mParent end if if profileAllowHide = 1 and allData(33+displayParentAuthor,i) = 1 and not isAdmin and ""&mem<>memID then ' hideprofile = allData(33,i) or allData(34,i) location = "" dateSignUp = "" end if Dim moderationRequired:moderationRequired = false Dim showModerateIcon:showModerateIcon = false if moderated=1 and not (isAdmin or mode or (CSTR(Mem)=memID and not isGuest)) then _ moderationRequired = true if moderated=1 and (isAdmin or mode) then _ showModerateIcon = true subject = SQLout(subject) body = SQLout(body) signature = SQLout(signature) 'response.write ("before:"&(timer-nstart)) %>
<% if memViewPref<>"2" then %> <% End If %>
> <%if Mem <> -1 then%> .asp?memid=<%= Mem %>" title="<%= tmViewProfileDesc %>" target=_blank>" border="0" height=16 width=20 align="absmiddle" > <%= email %><%= bLink %>
<% End If %> <%= author %> <%if Mem <> -1 then%>

<%= dispicture %>

<%= tmPostCountOfAuthor &" "& totalposts%>
<% if enableRating>0 then %> <%= tmScoreDesc&" "&score %>
<% end if %> <%= memberSinceDesc &" "& SQLDate(dateSignUp, timeoffset, false) %>
<%= location %> <%end if%> " align="left" border=0 width="<%=authorFieldWidth%>" height="1">

>
<% if memViewPref="2" then %> <%= author %> <% If mem<>-1 then %> ?memid=<%= Mem %>" title="<%= tmViewProfileDesc %>" target=_blank>" border="0" height=16 width=20 align="absmiddle"> <%= email %><%= bLink %> <% End If %> | <% end if %> <% if not moderationRequired then %> >" border=0 align="absmiddle"> <%= shrink(subject,40) %> <% If mparent<>0 and len(parentAuthor) <> 0 then %> <% if instr (listOfParents,","&mparent&",")<>0 then %> <%= Replace(Replace(parentLink,"<%#Link>","#"&mparent),"#parentID#",parentAuthor) %> <% else %> <%= Replace(Replace(parentLink,"<%#Link>",linkModifier("fb.asp")&"?m="&mparent&"&p="&topicPage&"&tmode="&tmode&"&smode="&smode),"#parentID#",parentAuthor) %> <% end if %> <% End If %> <%= PostRating(rating, ratetimes) %> <% if moderated=1 then %> <%= ttAwaitMode %> <% end if %> <% else %> <%= ttAwaitMode %> <% end if %> <% if showModerateIcon then %> <% end if %> <% if not (moderationRequired or bIgnore or isRecycled) then %> <% if (tmisAdminMod or (editDeleteAllowed and tmCanDeletePost and mParent<>0) _ or (editDeleteAllowed and tmCanDeleteThread )) and not isGuest then %> <% end if %> <% if not messageNotAvailable and tmCanReplyToPost and (lockedTopic <> 1 or tmisAdminMod) then %> <% end if %> <% if (tmisAdminMod or editDeleteAllowed) and not isGuest and (lockedTopic <> 1 or tmisAdminMod) then %> <% end if %> <% if allowmail and not isGuest then %> <% end if %> <% end if %>
?from=approve&m=<%= messageID %>&appid=<%= appid %>" onclick="return confirmDeletion('<%= JSEncode(adminApproveDesc) %>')" title="<%= adminApproveDesc %>"> " border="0" align="absmiddle"> ?from=dm&m=<%= messageID %>&appid=<%= appid %>" onclick="return logwin(this.href)" title="<%= adminDeleteDesc %>"> " border="0" align="absmiddle"> " onClick="return powin(this.href+'?do=reply&messageID=<%=messageID%>'+rpEdLnkAdd)" title="<%= tmReply %>"> " border="0" align="absmiddle">" onClick="return powin(this.href+'?messageID=<%= messageID %>'+rpEdLnkAdd)" title="<%= tmEdit %>"> " border="0" align="absmiddle"> " onClick="return fwdwin(this.href+'?messageID=<%=messageID&"&appid="&appid%>')" title="<%= tmForward %>"> " align="absmiddle" border="0">

<% if not moderationRequired then %> <%= (PGDCodeResolution(objPGDCode,body,pgdCode))%> <%= iff(len(upfile),"

"&upfile,"") %> <%= edit %> <% NoImage = NoSigImage %> <%= iff(withsig = 1,PGDCodeResolution(objPGDCode,sigDivider&signature,1),"") %> <% NoImage = NoImageRes %> <% else %> <%= ttAwaitMode %> <% end if %> <% 'response.write ("after:"&(timer-nstart)) %>
nowrap>  > <% if not isGuest and maxShortMsg <> 0 then %>" onClick="return powin(this.href+'?messageID=<%=messageID%>&appid=<%= appid %>&do=report')"><%= tmReportDesc %> | <% Elseif allowmail then %> " onClick="return powin(this.href+'?memID=<%= allModsForReport&","&alladmin&","&allfmanager %>&subject=<%= JSEncode(""&tmReportDesc&": ("&messageID&")") %>&body=<%= JSEncode(""&forumdir&"fb.asp?m="&messageID) %>&do=report')"><%= tmReportDesc %> | <% Else %> <% end if %> <% if not (moderated=1) and (showRateLink) then %>?action=rate&m=<%= messageID %>&appid=<%= appid %>" onclick="return logwin(this.href)"><%= tmRateThisDesc %> | <% else %> <% end if %> <%= tmdate & SQLdate(datecreated, timeoffset, true) %> <% if Revision > 0 then response.write(" | "&tmRevision&Revision&" ") %> <% if isAdmin then response.write (" | ID: "&messageID&" | IP: "&ip)%> " align="absmiddle" border="0">
<% next %> <% Set objPGDCode = nothing %> <% 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,tmode,smode,topicPage,titlefontcolor,0) %>
<% end if %> <% if not messageNotAvailable then lockedTopic = iff(isThreadRecycled or allData(10,0)=1,1,0) %> <% call mTopNav(0) %> <% call jumpmenu() %>
<% call iconLegend() %> <% call footerHTML() %>