<% Dim Forum_Count Dim NewMember_Name, NewMember_Id, Member_Count Dim LastPostDate, LastPostLink Dim scriptName scriptname = request.servervariables("script_name") set rs = Server.CreateObject("ADODB.Recordset") Forum_Count = intForumCount '## Forum_SQL - Get newest membername and id from DB strSql = "SELECT M_NAME, MEMBER_ID FROM " & strMemberTablePrefix & "MEMBERS WHERE M_STATUS=1 AND MEMBER_ID > 1" strSql = strSQL & " ORDER BY M_DATE desc;" set rs = my_Conn.Execute(strSql) if not rs.EOF then NewMember_Name = ChkString(rs("M_NAME"), "display") NewMember_Id = rs("MEMBER_ID") else NewMember_Name = "" end if '## Forum_SQL - Get Active membercount from DB strSql = "SELECT COUNT(MEMBER_ID) AS U_COUNT FROM " & strMemberTablePrefix & "MEMBERS WHERE M_POSTS > 0 AND M_STATUS=1" set rs = my_Conn.Execute(strSql) if not rs.EOF then Member_Count = rs("U_COUNT") else Member_Count = 0 end if LastPostDate = "" LastPostLink = "" LastPostAuthorLink = "" if not (intLastPostForum_ID = "") then '## Forum_SQL - Get lastPostDate and link to that post from DB strSql = "SELECT " & strTablePrefix & "FORUM.CAT_ID, " & strTablePrefix & "FORUM.FORUM_ID, " strSql = strSql & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.T_SUBJECT, " strSql = strSql & strTablePrefix & "TOPICS.T_LAST_POST, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID " strSql = strSql & "FROM " & strTablePrefix & "FORUM, " & strTablePrefix & "TOPICS, " strSql = strSql & strMemberTablePrefix & "MEMBERS " strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & strTablePrefix & "TOPICS.FORUM_ID " strSql = strSql & " AND " & strTablePrefix & "FORUM.CAT_ID = " & strTablePrefix & "TOPICS.CAT_ID " strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR = " & strMemberTablePrefix & "MEMBERS.MEMBER_ID " strSql = strSql & " AND " & strTablePrefix & "FORUM.FORUM_ID = " & intLastPostForum_ID & " " strSql = strSql & "ORDER BY " & strTablePrefix & "TOPICS.T_LAST_POST DESC;" set rs = my_Conn.Execute(strSql) if not rs.EOF then LastPostDate = ChkDate(rs("T_LAST_POST")) & ChkTime(rs("T_LAST_POST")) LastPostLink = "topic.asp?TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & rs("CAT_ID") LastPostLink = LastPostLink & "&Topic_Title=" & ChkString(rs("T_SUBJECT"),"urlpath") LastPostLink = LastPostLink & "&Forum_Title=" & ChkString(rs("F_SUBJECT"),"urlpath") LastPostAuthorLink = " by: " strMember_ID = rs("MEMBER_ID") strM_NAME = ChkString(rs("M_NAME"),"display") if strUseExtendedProfile then LastPostAuthorLink = LastPostAuthorLink & "" else LastPostAuthorLink = LastPostAuthorLink & "" end if LastPostAuthorLink = LastPostAuthorLink & strM_NAME & "" end if end if ActiveTopicCount = -1 if not IsNull(Session(strCookieURL & "last_here_date")) then if not blnHiddenForums then '## Forum_SQL - Get ActiveTopicCount from DB strSql = "SELECT COUNT(" & strTablePrefix & "TOPICS.T_LAST_POST) AS NUM_ACTIVE " strSql = strSql & "FROM " & strTablePrefix & "TOPICS " strSql = strSql & "WHERE (((" & strTablePrefix & "TOPICS.T_LAST_POST)>'"& Session(strCookieURL & "last_here_date") & "'))" set rs = my_Conn.Execute(strSql) if not rs.EOF then ActiveTopicCount = rs("NUM_ACTIVE") else ActiveTopicCount = 0 end if end if end if rs.close set rs = nothing ShowLastHere = (cint(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"))) > 0)%> <% ' This code will specify whether or not to show the forums under a category HideForumStat = "HideCat" & 0 If Request.Cookies(strUniqueID & HideForumStat) = "Y" then %> <% if (InStr(1, ScriptName, "default.asp", 1)) then %> <% =HideForumStat & "=N" %>"> <% else %> <% =HideForumStat & "=N" %>"> <% end if %> <% Else %> <% if (InStr(1, ScriptName, "default.asp", 1)) then %> <% =HideForumStat & "=Y" %>"> <% else %> <% =HideForumStat & "=Y" %>"> <% end if %> <% end if %> Statistics <% if Request.Cookies(strUniqueID & HideForumStat) <> "Y" then %> " bgcolor="<%= strForumCellColor %>">  <% if ShowLastHere then %> "> You last visited on <% =ChkDate(Session(strCookieURL & "last_here_date")) %> <% =ChkTime(Session(strCookieURL & "last_here_date")) %> <% end if if intPostCount > 0 then %> "> <% if users = 1 then strUser = Users & " Member" else strUser = Users & " Members" end if if Member_Count = 1 then if users = 1 then Response.Write(strUser & " has made ") else Response.Write("1 of " & strUser & " has made ") end if else Response.Write(Member_Count & " of " & strUser & " have made ") end if if intPostCount = 1 then Response.Write("1 post in ") else Response.Write(intPostCount & " posts in ") end if if intForumCount = 1 then Response.Write("1 forum") else Response.Write(intForumCount & " forums") end if if (LastPostDate = "" or LastPostLink = "" or intPostCount = 0) then Response.Write("") else Response.Write(", with the last post on "& lastPostDate & "") if LastPostAuthorLink <> "" then Response.Write(LastPostAuthorLink & ".") else Response.Write(".") end if end if %> <% end if %> "> There <% if intTopicCount = 1 then Response.Write("is ") else Response.Write("are ") end if%> currently <%= intTopicCount %> <%if intTopicCount = 1 then Response.Write(" topic ") else Response.Write(" topics ") end if %><% if ActiveTopicCount > 0 then %> and <%= ActiveTopicCount %> active <% if ActiveTopicCount = 1 then Response.Write("topic") else Response.Write("topics") end if %> since you last visited.<% elseif blnHiddenForums and (strLastPostDate > Session(strCookieURL & "last_here_date")) and ShowLastHere then %> and there are active topics since you last visited.<% elseif not(ShowLastHere) then Response.Write "." else %>and no active topics since you last visited.<% end if %> <% if NewMember_Name <> "" then %> "> Please welcome our newest member: <% if strUseExtendedProfile then Response.Write " " else Response.Write " " end if Response.Write NewMember_Name & "." & vbcrlf %> <% end if End If %>