<% Dim arraylimit, objRS, pgcount, currpage, forumtitle, forumid, pages, foruminfo, rdcount, arrayname, strText Dim length, dot, mpg, emnotify, arrAllMeg, allowpoll, pollCreatePermission, m Dim enableRating, ratingColumn,showRateLink, siteWideSubscription, forumSubscription,allowmail Dim tmode,smode 'Dim procSelector page = request.queryString("p") appid = request.queryString("appid") tmode = request.queryString("tmode") smode = request.queryString("smode") allForum = Application(dbName&"foruminfo") isSearchEngine = isSearchEngineCompatible Dim PGDrewriteString if instr(querystring,"404;") then PGDrewriteString = replace(queryString,"404;","") PGDrewriteString = replace(PGDrewriteString,forumdir,"") PGDrewriteString = replace(PGDrewriteString,"/tt.htm","") PGDrewriteString = replace(PGDrewriteString,searchDelimiter,"=") PGDrewriteString = replace(PGDrewriteString,"p=","page=") 'response.write removeUnwantedRewrite(PGDrewriteString) 'response.end execute removeUnwantedRewrite(PGDrewriteString) if not isEmpty(forumid) then appid=ForumIdToAppid(forumid) end if if appid = "" or not isNumeric(appid) then response.redirect("default.asp") response.end end if if not isNumeric(page) then page = 1 appid = cint(appid) mpg = Application (dbName&"tpg") siteWideSubscription = Application(dbName&"enableSubscribe") allowmail = iff(lcase(Application(dbName&"maildll"))<>"nomail",true,false) Dim allForum, rights, Mode, allowVote forumtitle = allForum(1,appid) forumid = allForum(0,appid) rdcount = allForum(4,appid) forumSubscription = allforum(16,appid) 'pollCreatePermission = allForum(18,appid) enableRating = allForum(22,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 enableRating>0 then ratingColumn = 1 Dim timefilter timefilter = timefilterSetup(request.cookies(dbName&"timefilter")&"",allforum(20,appid)) tmode = tmodeProcess(tmode) smode = smodeProcess(smode) Dim allCat, 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) Dim errorResponse if page <> "" then currpage = cdbl(abs(page)) else currpage = 1 if currpage = 0 then currpage = 1 if (currpage-1) * mpg >= rdcount then rdcount = 0 if rights = 0 then rdcount = 0 If rdcount = 0 then currpage = 0 else Dim objCom Dim finalCommandText Dim App_recompile Dim App_threshold Dim needForRecompile App_recompile = Application(dbName&"recompile")&"" App_threshold = Application(dbName&"threshold")&"" needForRecompile = iff(Instr(1, "," & App_recompile & ",", "," & forumId &"" & ",", 0)=0 or App_threshold="0",false,true) 'response.write(App_recompile)'&"|"&needForRecompile) finalCommandText = commandText(smode,tmode) 'response.write finalCommandText &" "&forumId&","&currpage&","&mpg&","&tmode&","&timefilter&","&"''" set objCom = server.createobject("adodb.command") set objRS = server.createobject("adodb.recordset") objRS.cachesize = mpg With objCom .activeConnection = datastore if needForRecompile then .commandText = "sp_recompile ('"&finalCommandText&"')" .commandType = adCmdStoredProc .execute, , adExecuteNoRecords end if .commandText = dbOwnerPrefix&finalCommandText .commandType = adCmdStoredProc .Parameters.Append .Createparameter("@int_ForumID", adInteger, adParamInput, 0, forumId) .Parameters.Append .Createparameter("@int_currpage", adInteger, adParamInput, 0, currpage) .Parameters.Append .Createparameter("@int_mpg", adInteger, adParamInput, 0, mpg) .Parameters.Append .Createparameter("@int_tmode", adInteger, adParamInput, 0, tmode) .Parameters.Append .Createparameter("@int_timefilter", adInteger, adParamInput, 0, timefilter) .Parameters.Append .Createparameter("@rdcount", adInteger, adParamOutput, 0) set objRS = .execute if objRS.state <> adStateclosed then if not (objRS.EOF or objRS.BOF) then arrAllMeg = objRS.getrows objRS.close end if end if set objRS=nothing rdcount = .Parameters("@rdcount").value End With set objCom = nothing if timer()-nstart > iff(isNumeric(App_threshold),Csng(App_threshold),0.25) and App_threshold<>"0" then If not needForRecompile then Application.lock Application(dbName&"recompile") = App_recompile&","&forumid&"," Application.unlock elseif needForRecompile then Application.lock Application(dbName&"recompile") = replace(App_recompile,","&forumid&",","") Application.unlock End If else if needForRecompile then Application.lock Application(dbName&"recompile") = replace(App_recompile,","&forumid&",","") Application.unlock end if end if if (rdcount mod mpg) <> 0 then pages = (rdcount\mpg)+1 else pages = (rdcount\mpg) if currpage>pages then currpage = pages end if %> <%= forumtitle %> <%= OutputCSS() %> > <% call headerHTML() %> <% DIM ViewLink if memViewPref = "1" and memBrowser = "moz6" then ViewLink="m.asp" else ViewLink="tm.asp" %>
<% if enableRating >= 1 then %> <% end if %> <% if rdcount = 0 then if rights <> 0 then errorResponse = currentNoMessageDesc else errorResponse = PrivateRightViolationMessage end if response.write ("
  <% call Sorter(tmode,currpage,appid,ttTopic,10,smode) %> <% call Sorter(tmode,currpage,appid,ttReplies,4,smode) %> <% call Sorter(tmode,currpage,appid,ttAuthor,12,smode) %> <% call Sorter(tmode,currpage,appid,ttViews,6,smode) %><% call Sorter(tmode,currpage,appid,ttRating,8,smode) %><% call Sorter(tmode,currpage,appid,ttLastPost,2,smode) %>

"&_ errorResponse&"

") else if isArray(arrAllMeg) then Dim i, k, cpages Dim totalMessage, messageLimit, timeoffset messageLimit = Application(dbName&"mpg") timeoffset = Application(dbName&"TimeOffset") Dim rowColor, rowColor1, rowColor2 rowColor1 = tableinside rowColor2 = tablealt if Application(dbName&"alterBy") = 0 then rowColor = "" else rowColor = rowColor2 tableinside = "" tablealt = "" end if Dim flushCounter:flushCounter = 0 Dim arrLastMemLogin Dim ttToolTip:ttToolTip = Application(dbName&"ttTooltip") ' response.write ttTooltip for i = ubound(arrAllMeg,2) to 0 step -1 flushCounter = flushCounter + 1 Dim moderationRequired:moderationRequired = false if arrAllMeg(14,i)=1 and not (isAdmin or mode or (CSTR(arrAllMeg(8,i))=memID and not isGuest)) then _ moderationRequired = true if rowColor = rowColor2 then rowColor = rowColor1 else rowColor = rowColor2 arrLastMemLogin = Split(""&arrAllMeg(9,i),"$'") Dim bLink:bLink = "" If Instr(1, ","&memBlockList, "," & arrAllMeg(8,i) & ",", 0) > 0 Then bLink = ""&tmSubBlockedDesc&"
" Dim canViewRecycledPost:canViewRecycledPost = true if not (isNull(arrAllMeg(16,i)) or (isadmin or mode)) then canViewRecycledPost = false %> > width="25"> width="25"> " border=0> class="c2"> <% if Mode or isAdmin then %> " onclick="return logwin(this.href+'?threadID=<%= arrAllMeg(5,i) %>')" title="<%= ttManageDesc %>"> <% if arrAllMeg(14,i)=1 then %> ?from=approve&m=<%= arrAllMeg(5,i) %>&appid=<%= appid %>" onclick="return confirmDeletion('<%= JSEncode(adminApproveDesc) %>')" title="<%= adminApproveDesc %>"> <% end if %> <% end if %> <% if not canViewRecycledPost then %> <%= ttDeletedTopic %> <% elseif moderationRequired then %> <%= ttAwaitMode %> <% else %> <% if arrAllMeg(2,i) > 0 and memBrowser = "moz6" then response.write ("")%> <% if not isNull(arrAllMeg(16,i)) then response.write (ttDeletedTopic) %> <% if arrAllMeg(14,i)=1 then response.write (ttAwaitMode) %> <% if arrAllMeg(7,i) = 1 then response.write (ttToptopic)%> <% if arrAllMeg(10,i) = 1 then response.write (ttPollTopic)%> <% if arrAllMeg(15,i) = 1 then response.write (ttFAQTopic)%> <% if datediff("s",memlastvisit, arrAllMeg(0,i))>0 then response.write (" ")%> ><%= left(SQLout(arrAllMeg(1,i)),70) %>  <% response.write(is_new(arrAllMeg(0,i))) %> <% totalMessage = arrAllMeg(2,i)+1 if (totalMessage mod messageLimit) <> 0 then cpages = (totalMessage\messageLimit)+1 else cpages = (totalMessage\messageLimit) If cpages>1 then response.write ("
["&pageDesc&" ") if cpages <=9 then for k = 1 to cpages response.write (""&k&" ") next else for k = 1 to 3 response.write (""&k&" ") next response.write ("... ") for k = (cpages-2) to cpages response.write (""&k&" ") next end if response.write ("]") end if %> <% end if %> ><%= arrAllMeg(2,i) %> class="c2"> <% if arrAllMeg(8,i)=-1 then response.write (arrAllMeg(3,i)) else _ response.write (""&bLink&arrAllMeg(3,i)&"") %> ><%= arrAllMeg(4,i) %> <% if enableRating >= 1 then %> ><%= PostRating(arrAllMeg(12,i),arrAllMeg(13,i)) %> <% end if %> = 1 then response.write (tablealt) else response.write(tableinside) %> class=info> <% response.write (""&SQLdate(arrAllMeg(0,i), timeoffset, true)&"
") if UBound(arrLastMemLogin) >= 0 then If arrLastMemLogin(0) <> "-1" then response.write (""&arrLastMemLogin(1)&"") else response.write (""&arrLastMemLogin(1)&"") end if end if %> <% if not (moderationRequired or not canViewRecycledPost) then _ response.write (" ") %> <% if memBrowser = "moz6" then %> id="treeRow<%= arrAllMeg(5,i) %>" style="display:none;"> <% end if %> <% if flushCounter >= 10 then flushCounter = 0 'response.flush() end if next else response.write ("
"&_ currentNoMessageDesc&"

") currpage = 0 end if %> <%= pageDesc %>  <% call pagelistNew(appid,pages,currpage,tmode,smode,titlefontcolor,1) %>  <% end if %> <% call TopNav(0) %> <% call jumpmenu() %>

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


<% call iconLegend() %> <% call footerHTML() %> <% if membrowser="moz6" then %> <% end if %>