% 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)%>