<%@ CodePage=65001 Language="VBScript"%> <% option explicit %> <% GetConfigVariables SetupDatabase dim rsForums, sResult, iCatLock, bFirstRecord, iCategoryID, vCalendarEvents, rsLastThread, SQL, bIsAdmin, iArraysize dim bIsModerator, bInRestrictedList, sUserColorCoding, i, vCategoryInfo, bStarterRow, sModerators bStarterRow = true set rsForums = server.createObject("ADODB.Recordset") set rsLastThread = server.createObject("ADODB.Recordset") if (bBBSRegistrationRequired = 1 or bBBSAuthorizationRequired = 1) and (sLogonType <> "ok") then response.redirect sValidatedBaseURL & "/logon.asp?error=needregistration" end if if request("showall") = "true" then response.cookies("catlock") = "" response.cookies("catlock").path = "/" end if bFirstRecord = True if len(Trim(request.querystring("catlock"))) > 0 then iCatLock = validateNumeric(request.querystring("catlock")) else iCatLock = validateNumeric(request.cookies("catlock")) end if if iCatLock <> 0 then iCategoryID = iCatLock vCategoryInfo = GetCategoryInfo (iCategoryID) if (vCategoryInfo(CA_SchemeDefault) <> 0 and sStyleID = 0) or (vCategoryInfo(CA_ForceScheme) = 1) then sStyleID = vCategoryInfo(CA_SchemeDefault) UpdateImageVariables end if end if %> <%=validateField(sBBSName)%> : Category / Forum listings <% if bDisplayBBSQuotes = 1 then%>
<%=sBBSRandomQuoteText%> <%=GetRandomQuote%>

<% else %>
<% end if %> <% if sBBSStatisticsLocation = "TOP" then WriteInfoCenter() %> <% ' If the category is locked, then only return records from that category if iCatLock > 0 then SQL = "select [CategoryID], [name], [url], [locked] from [Categories] where [CategoryID]=" & iCatLock & ";" else SQL = "select [CategoryID], [name], [url], [locked] from [Categories] order by [sortorder] ASC;" end if rsMaster.open SQL, dbConnection, adOpenStatic, adLockReadOnly bIsAdmin = isAdmin(sUsername, sPassword) do until rsMaster.EOF bFirstRecord = True SQL = "select [forumid], [threadcount], [postcount], [lastposter], [lastactivity], [forumname], [forumdescription], [restricted], " ' 0-7 ' 0 - 7 SQL = SQL & " [url], [registration], [invisible], [lastposterstatus], [lastposteranonymous] " ' 8-12 SQL = SQL & " from [forums] where [categoryid]=" & rsMaster("CategoryID") & " order by [SortOrder] ASC;" ' 8 - 10 rsForums.open SQL, dbConnection, adOpenForwardOnly, adLockReadOnly do until rsForums.EOF bIsModerator = isModerator(sUsername, sPassword, rsForums("forumid").value) bInRestrictedList = InRestrictedList(sUsername, sPassword, rsForums("forumid").value) if rsForums("invisible") = 0 or (bIsAdmin or bIsModerator) or bInRestrictedList then ' If this is the first forum in a category, write the category header if bFirstRecord = True then %> <% bFirstRecord = False end if %> " %> <% end if rsForums.MoveNext loop rsForums.Close rsMaster.MoveNext Loop rsMaster.Close %>
<%=validateField(rsMaster(1).value)%> <% if len(trim(request("catlock"))) > 0 then %> (show all categories) <% end if %>
Forum Name Threads Messages Last Post
">"> <% if rsMaster("locked") = 1 then response.write "&catlock=" & validateNumeric(rsMaster("CategoryID"))%>"><%=validateField(rsForums("ForumName"))%> <% if rsForums(7).value = 1 then %> <% else %>   <% end if %> <% if rsForums(10).value = 1 then %> <% end if %>
<% if len(rsForums(6).value) > 0 then %><%=(rsForums(6).value)%>
<% end if %> <% sModerators = ListModerators(rsForums(0).value) if len(sModerators) > 0 then %> Moderators: <%=sModerators%> <% end if %>
<% if ((rsForums(7).value = 0) OR (rsForums(7).value = 1 and (bIsAdmin or bIsModerator or bInRestrictedList))) then response.write (rsForums("threadcount"))%> <% if ((rsForums(7).value = 0) OR (rsForums(7).value = 1 and (bIsAdmin or bIsModerator or bInRestrictedList))) then response.write (rsForums("postcount"))%> <% if bBBSLinkLastThread = 1 and ((rsForums(7).value = 0) OR (rsForums(7).value = 1 and (bIsAdmin or bIsModerator or bInRestrictedList))) then SQL = "select top 1 [threadid], [totalposts], [threadsubject] from [threads] where [forumid]=" & rsForums("forumid") & " order by [lastactivity] DESC;" rsLastThread.open SQL, dbConnection, adOpenForwardOnly, adLockReadOnly if not(rsLastThread.EOF) then response.write "" if bBBSBadWordFilterOnDisplay = 1 then response.write ValidateField(FilterWords(rsLastThread(2).value)) else response.write ValidateField(rsLastThread(2).value) end if response.write "
" response.write GetShortDateTime(rsForums(4).value)& " by " if rsForums.fields(12).value = 0 then if rsForums.fields(11).value = ST_Administrator then sUserColorCoding = ""& validateField(rsForums.fields(3).value) & "" elseif rsForums.fields(11).value = ST_Moderator then sUserColorCoding = ""& validateField(rsForums.fields(3).value) & "" elseif rsForums.fields(11).value = ST_Registered then sUserColorCoding = ""& validateField(rsForums.fields(3).value) & "" else sUserColorCoding = ""& validateField(rsForums.fields(3).value) & "" end if else sUserColorCoding = "(Anonymous)" end if response.write sUserColorCoding end if rsLastThread.Close end if response.write "

<% if sBBSStatisticsLocation = "BOTTOM" then WriteInfoCenter() %>
<% function WriteInfoCenter dim rsInfoCenter set rsInfoCenter = server.createobject("ADODB.Recordset") response.write "
" & sBBSName & " info center
" if bBBSSHowMostRecentUser = 1 then rsInfoCenter.Open "select TOP 1 [username] from [members] order by [dateregistered] DESC;", dbConnection, adOpenForwardOnly, adLockReadOnly if not(rsInfoCenter.EOF) then response.write sBBSName & " welcomes our newest user, " & CreateUsernameLink(rsInfoCenter(0).value) & ValidateField(rsInfoCenter(0).value) & "!
" end if rsInfoCenter.close end if if bBBSSHowCountStatistics = 1 then rsInfoCenter.open "select count(*) as totalforums, sum([postcount]) as totalposts, sum([threadcount]) as TotalThreads from [forums]", dbConnection, adOpenForwardOnly, adLockReadOnly if not(rsInfoCenter.EOF) then response.write "There are " & rsInfoCenter(1).value & " posts in " & rsInfoCenter(2).value & " threads across " & rsInfoCenter(0).value & " forums.
" end if rsInfoCenter.Close rsInfoCenter.open "select count(*) as totalusers from [members]", dbConnection, adOpenForwardOnly, adLockReadOnly if not(rsInfoCenter.EOF) then response.write "There are " & rsInfoCenter(0).value & " registered users.
" end if rsInfoCenter.Close end if if bBBSShowCalendarEvents = 1 and bDisableCalendar = 0 then response.write "
" vCalendarEvents = ListDateEvents(iArraySize, -1, 1, 1, 0, 0, date, dateadd("d",7 ,date), sUsername, sPassword, 0) if iArraySize > 0 then response.write "Upcoming Events :
" & CRLF for i = 0 to (iArraySize-1) if bStarterRow = True then response.write "" & CRLF response.write "" & crlf if bSTarterRow = False then response.write "" bStarterRow = not(bStarterRow) next if bStarterRow = False and (iArraySize) > 0 then response.write "" response.write "
" & vCalendarEvents(DE_Date, i) & " " & validateField(vCalendarEvents(DE_shortdesc, i)) & " - " & validateField(vCalendarEvents(DE_Owner, i)) & "
" else response.write "There are no upcoming calendar events.
" end if end if if bBBSShowOnlineRegistered = 1 then response.write "
Online registered users: " & ShowOnlineRegistered(0) & "
" end if response.write "
" end function %>