<%@ CodePage=65001 Language="VBScript"%> <% Option Explicit %> <% GetConfigVariables SetupDatabase dim rsThreadList, bAllowDisplay, sResult, sNewCategory, sOldCategory, SQL, bIsAdminOrModerator, vUserInfo, forumid, bAllowSearch dim vForumInfo, bFirstRecord, iLastDays, sUserColorCoding, sLastUserColorCoding, iIndex, sSubject set rsThreadList = server.CreateObject("ADODB.Recordset") checkUsername sUsername, sPassword, sResult if (bBBSRegistrationRequired = 1 or bBBSAuthorizationRequired = 1) and (sResult <> "ok") then response.redirect sValidatedBaseURL & "/logon.asp?error=needregistration" end if if IsEmpty(request("forumid")) and IsEmpty(request("checkall")) then response.redirect sValidatedBaseURL & "/recent-threads.asp" end if if sResult="ok" then vUserInfo = GetUserInfo(sUsername) bFirstRecord = True iIndex = 0 %> <%=validateField(sBBSName)%> : Active threads since last logon <% if bDisplayBBSQuotes = 1 then%>
<%=sBBSRandomQuoteText%> <%=GetRandomQuote%>

<% else %>
<% end if %> <% ' Construct the SQL statement SQL = "Select top 250 [categories].[name], [categories].[sortorder], [forums].[categoryid], [forums].[forumname], [forums].[sortorder], [forums].[subjectshtmlfiltered], [threads].* from [threads], [forums], [categories] where " SQL = SQL & " [categories].[categoryid] = [forums].[categoryid] and [forums].[forumid] = [threads].[forumid] " & CRLF SQL = SQL & " and [threads].[forumid] IN (" if request("checkall") = "true" then rsMaster.open "select [forumid], [restricted] from [forums];", dbConnection, adOpenForwardOnly, adLockReadOnly do until rsMaster.EOF bAllowSearch = True bIsAdminOrModerator = isAdmin(sUsername, sPassword) or isModerator(sUsername, sPassword, rsMaster("forumid")) if (rsMaster.fields(1).value = 1) and not (bIsAdminOrModerator or _ InRestrictedList(sUsername, sPassword, rsMaster.fields(0).value)) then bAllowSearch = False if bAllowSearch = True then if bFirstRecord = false then SQL = SQL & ", " & rsMaster.fields(0).value else SQL = SQL & rsMaster.fields(0).value bFirstRecord = False end if end if rsMaster.MoveNExt loop else for each forumid in request("forumid") bAllowSearch = True bIsAdminOrModerator = isAdmin(sUsername, sPassword) or isModerator(sUsername, sPassword, forumid) vForumInfo = GetForumInfo(ValidateNumeric(forumid)) if (vForumInfo (FI_Invisible) = 1) and not bIsAdminOrModerator then bAllowSearch = False if (vForumInfo (FI_Restricted) = 1) and not (bIsAdminOrModerator or _ InRestrictedList(sUsername, sPassword, forumid)) then bAllowSearch = False if bAllowSearch = True then if bFirstRecord = False then SQL = SQL & ", " & forumid else SQL = SQL & forumid bFirstRecord = False end if end if next end if if request("datelimit") = "lastlogon" and sResult="ok" then SQL = SQL & ") and [threads].[lastactivity] > " & sDateDelimiter & GetSQLDate(vUserInfo(UI_LastLogon)) & " " & GetShortTime(vUserInfo(UI_LastLogon)) & sDateDelimiter else iLastDays = ValidateNumeric(request("prevdays")) iLastDays = iLastDays * -1 SQL = SQL & ") and [threads].[lastactivity] > " & sDateDelimiter & GetSQLDate(dateadd("d", iLastDays, Date)) & " " & GetShortTime(dateadd("d", iLastDays, Date)) & sDateDelimiter end if if request("breakout") = 0 then SQL = SQL & " order by [threads].[lastactivity] DESC;" else SQL = SQL & " order by [categories].[sortorder] ASC, [forums].[sortorder] ASC, [threads].[lastactivity] DESC;" end if rsThreadList.open SQL, dbConnection, adOpenForwardOnly, adLockReadOnly %> <% if rsThreadList.RecordCount = 250 then response.write "" end if do until rsThreadList.EOF iIndex = iIndex + 1 if rsThreadList.fields("anonymous").value = 0 then if rsThreadList("ownerstatus") = ST_Administrator then sUserColorCoding = "" elseif rsThreadList("ownerstatus") = ST_Moderator then sUserColorCoding = "" elseif rsThreadList("ownerstatus") = ST_Registered then sUserColorCoding = "" else sUserColorCoding = "" end if sUserColorCoding = sUserColorCoding & validateField(rsThreadList("owner")) & "" else sUserColorCoding = "(Anonymous)" end if if rsThreadList.fields("lastposteranonymous").value = 0 then if rsThreadList("lastposterstatus") = ST_Administrator then sLastUserColorCoding = "" elseif rsThreadList("lastposterstatus") = ST_Moderator then sLastUserColorCoding= "" elseif rsThreadList("lastposterstatus") = ST_Registered then sLastUserColorCoding= "" else sLastUserColorCoding= "" end if sLastUserColorCoding = sLastUserColorCoding & validateField(rsThreadList("lastposter")) & "" else sLastUserColorCoding = "(Anonymous)" end if if request("breakout") = 1 then sNewCategory = rsThreadList("forumid") if sNewCategory <> sOldCategory then response.write "" & CRLF sOldCategory = sNewCategory end if end if response.write "" & CRLF else response.write "" & CRLF end if ' Subject and attachment line response.write "" response.write "" & CRLF response.write "" & CRLF rsThreadList.MoveNext response.write "" loop rsThreadList.Close %>
Recently active threads
Maximum number (250 threads) returned
" & rsThreadList("forumname") & "
" response.write "" if rsThreadList("closed") = 1 then response.write "" if rsThreadList("hasattachment") = 1 then response.write " " end if response.write "" sSubject = rsThreadList("threadsubject") if bBBSBadWordFilterOnDisplay = 1 then sSubject = FilterWords(rsThreadList("threadsubject")) if rsThreadList("subjectshtmlfiltered") = 1 then sSubject = ValidateField(sSubject) response.write sSubject response.write "
  " & (rsThreadList("totalposts") - 1) & " replies, " & rsThreadList("timesviewed") & " viewings
" response.write " Created " & getShortDateTime(rsThreadList("datecreated")) & " by " & sUserColorCoding & "
 Last posting " & getShortDateTime(rsThreadList("lastactivity")) & "
 by " & sLastUserColorCoding & "