<% '################################################################################# '## Copyright (C) 2000 Michael Anderson '## '## This program is free software; you can redistribute it and/or '## modify it under the terms of the GNU General Public License '## as published by the Free Software Foundation; either version 2 '## of the License, or any later version. '## '## All copyright notices regarding Snitz Forums 2000 '## must remain intact in the scripts and in the outputted HTML '## The "powered by" text/logo with a link back to '## http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful, '## but WITHOUT ANY WARRANTY; without even the implied warranty of '## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '## GNU General Public License for more details. '## '## You should have received a copy of the GNU General Public License '## along with this program; if not, write to the Free Software '## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '## '## Support can be obtained from support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## reinhold@bigfoot.com '## '## or '## '## Snitz Communications '## C/O: Michael Anderson '## PO Box 200 '## Harpswell, ME 04079 '################################################################################# %> <% strDBNTUserName = Request.Cookies(strCookieURL & "User")("Name") if strAuthType = "nt" then strDBNTUserName = Session(strCookieURL & "userID") end if if IsEmpty(Session(strCookieURL & "last_here_date")) then Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName) end if if strShowStatistics <> "1" then set rs1 = Server.CreateObject("ADODB.Recordset") '## Forum_SQL strSql = "SELECT " & strTablePrefix & "TOTALS.P_COUNT, " & strTablePrefix & "TOTALS.T_COUNT, " & strTablePrefix & "TOTALS.U_COUNT " strSql = strSql & " FROM " & strTablePrefix & "TOTALS" rs1.open strSql, my_Conn Users = rs1("U_COUNT") Topics = rs1("T_COUNT") Posts = rs1("P_COUNT") rs1.Close set rs1 = nothing end if '## Forum_SQL - Get all Forums From DB strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_ID, " & strTablePrefix & "CATEGORY.CAT_STATUS, " strSql = strSql & strTablePrefix & "CATEGORY.CAT_NAME " strSql = strSql & " FROM " & strTablePrefix & "CATEGORY " strSql = strSql & " ORDER BY " & strTablePrefix & "CATEGORY.CAT_NAME ASC;" set rs = my_Conn.Execute (strSql) %>
<% ShowLastHere = (cint(ChkUser2(strDBNTUserName, Request.Cookies(strCookieURL & "User")("Pword"))) > 0) if strShowStatistics <> "1" then %>
<% if ShowLasthere then %> You Last Visited - <% =ChkDate(Session(strCookieURL & "last_here_date")) %> <% =ChkTime(Session(strCookieURL & "last_here_date")) %> <%else%>   <%end if%> There are <% =Posts %> Posts in <% =Topics %> Topics and <% =Users %> Users  
<% else Response.Write("  ") end if %>
<% if (strShowModerators = "1") or (mlev = 4 or mlev = 3) then %> <% end if if (mlev = 4 or mlev = 3) or (lcase(strNoCookies) = "1") then %> <% end if %> <% if rs.EOF or rs.BOF then %> <% if (mlev = 4 or mlev = 3) then %> <% end if %> <% else intPostCount = 0 intTopicCount = 0 intForumCount = 0 strLastPostDate = "" do until rs.EOF '## Forum_SQL - Build SQL to get forums via category strSql = "SELECT " & strTablePrefix & "FORUM.FORUM_ID, " strSql = strSql & strTablePrefix & "FORUM.F_STATUS, " strSql = strSql & strTablePrefix & "FORUM.CAT_ID, " strSql = strSql & strTablePrefix & "FORUM.F_SUBJECT, " strSql = strSql & strTablePrefix & "FORUM.F_URL, " strSql = strSql & strTablePrefix & "FORUM.F_DESCRIPTION, " strSql = strSql & strTablePrefix & "FORUM.CAT_ID, " strSql = strSql & strTablePrefix & "FORUM.F_TOPICS, " strSql = strSql & strTablePrefix & "FORUM.F_COUNT, " strSql = strSql & strTablePrefix & "FORUM.F_LAST_POST, " strSql = strSql & strTablePrefix & "FORUM.F_STATUS, " strSql = strSql & strTablePrefix & "FORUM.F_TYPE, " strSql = strSql & strTablePrefix & "FORUM.F_PRIVATEFORUMS, " strSql = strSql & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " strSql = strSql & strMemberTablePrefix & "MEMBERS.M_NAME " strSql = strSql & "FROM " & strTablePrefix & "FORUM " strSql = strSql & "LEFT JOIN " & strMemberTablePrefix & "MEMBERS ON " strSql = strSql & strTablePrefix & "FORUM.F_LAST_POST_AUTHOR = " strSql = strSql & strMemberTablePrefix & "MEMBERS.MEMBER_ID " strSql = strSql & " WHERE " & strTablePrefix & "FORUM.CAT_ID = " & rs("CAT_ID") & " " strSql = strSql & " ORDER BY " & strTablePrefix & "FORUM.F_SUBJECT ASC;" set rsForum = my_Conn.Execute (strSql) chkDisplayHeader = true if rsForum.eof or rsForum.bof then %> <% if (mlev = 4 or mlev = 3) or (lcase(strNoCookies) = "1") then %> <% end if %> <% Response.Write " " & vbCrLf Response.Write " " & vbCrLf if (mlev = 4 or mlev = 3) then Response.Write " " & vbCrLf end if Response.Write " " & vbCrLf else blnHiddenForums = false do until rsForum.Eof if ChkDisplayForum(rsForum("FORUM_ID")) then if rsForum("F_TYPE") <> "1" then intPostCount = intPostCount + rsForum("F_COUNT") intTopicCount = intTopicCount + rsForum("F_TOPICS") intForumCount = intForumCount + 1 if rsForum("F_LAST_POST") > strLastPostDate then strLastPostDate = rsForum("F_LAST_POST") intLastPostForum_ID = rsForum("FORUM_ID") end if end if if chkDisplayHeader then %> <% if (mlev = 4 or mlev = 3) or (lcase(strNoCookies) = "1") then %> <% end if %> <% chkDisplayHeader = false end if %> bgcolor="<% =strForumCellColor %>" valign="top"> "><% =ChkString(rsForum("F_SUBJECT"),"display") %>
<% = rsForum("F_DESCRIPTION") %> <% if rsForum("F_TYPE") = 0 then if IsNull(rsForum("F_TOPICS")) then %>
<% else %> <% end if if IsNull(rsForum("F_COUNT")) then %> <% else %> <% end if if IsNull(rsForum("MEMBER_ID")) then strLastUser = "" else strLastUser = "
by: " if strUseExtendedProfile then strLastUser = strLastUser & "" else strLastUser = strLastUser & "" end if strLastUser = strLastUser & rsForum("M_NAME") & "" end if %>
<% else if rsForum("F_TYPE") = 1 then '## Do Nothing end if end if if (strShowModerators = "1") or (mlev = 4 or mlev = 3) then %> <% end if if (mlev = 4 or mlev = 3) or (lcase(strNoCookies) = "1") then %> <% end if %> <% else blnHiddenForums = true end if ' ChkDisplayForum() rsForum.MoveNext loop end if rs.MoveNext loop end if if strShowStatistics = "1" then WriteStatistics end if %>
  Forum Topics Posts Last PostModerator(s) <% PostingOptions() %>
">No Categories/Forums Found 
"><% =ChkString(rs("CAT_NAME"),"display") %> <% call CategoryAdminOptions() %>
No Forums Found 
" valign="top"><% =ChkString(rs("CAT_NAME"),"display") %> <% call CategoryAdminOptions() %>
<% if rsForum("F_TYPE") = 0 then if rs("CAT_STATUS") = 0 then %>&CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"urlpath") %>"><% if rsForum("F_LAST_POST") > Session(strCookieURL & "last_here_date") then Response.Write "" else Response.Write "" end if else if rsForum("F_STATUS") <> 0 then %>&CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"urlpath") %>"><% =ChkIsNew(rsForum("F_LAST_POST")) %><% else %>&CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"urlpath") %>"><% if rsForum("F_LAST_POST") > Session(strCookieURL & "last_here_date") then Response.Write "" else Response.Write "" end if end if end if else if rsForum("F_TYPE") = 1 then %> "><% end if end if %> 0<% =rsForum("F_TOPICS") %>0<% =rsForum("F_COUNT") %><% =ChkDate(rsForum("F_LAST_POST")) %>
<% =ChkTime(rsForum("F_LAST_POST")) %><%= strLastUser%>
<% if (listForumModerators(rsForum("FORUM_ID")) <> "") then Response.Write(listForumModerators(rsForum("FORUM_ID"))) else Response.Write(" ") end if %> <% call ForumAdminOptions %>
New Posts Contains new posts since last visit.
Old Posts No new posts since the last visit.
<% set rs = nothing set rsForum = nothing %> <% sub PostingOptions() if (mlev = 4) or (lcase(strNoCookies) = "1") then %> Create New Category <% end if end sub function ChkIsNew(dt) if rsForum("F_STATUS") <> 0 then if dt > Session(strCookieURL & "last_here_date") then ChkIsNew = "New Posts" Else ChkIsNew = "Old Posts" end if else ChkIsNew = "Forum Locked" end if end function sub CategoryAdminOptions() if (mlev = 4) or (lcase(strNoCookies) = "1") then if (rs("CAT_STATUS") <> 0) then %> &Cat_Title=<% =ChkString(rs("CAT_NAME"),"JSurlpath")%>')">Lock Category <% else %> ')">Un-Lock Category <% end if if (rs("CAT_STATUS") <> 0) or (mlev = 4) then %> &Cat_Title=<% =ChkString(rs("CAT_NAME"),"urlpath") %>">Edit Category Name <% end if %> &Cat_Title=<% =ChkString(rs("CAT_NAME"),"JSurlpath") %>')">Delete Category <% if (rs("CAT_STATUS") <> 0) or (mlev = 4) then %> &type=0">Create New Forum <% end if if (rs("CAT_STATUS") <> 0) or (mlev = 4) then %> &type=1">Create New Web Link <% end if else %>   <% end if end sub sub ForumAdminOptions() if (mLev = 4) or (chkForumModerator(rsForum("FORUM_ID"), strDBNTUserName) = "1") or (lcase(strNoCookies) = "1") then if rsForum("F_TYPE") = 0 then if rs("CAT_STATUS") = 0 then if (mlev = 4) then %> ')">Un-Lock Category <% end if else if rsForum("F_STATUS") = 1 then %> &CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"JSurlpath")%>')">Lock Forum <% else %> &CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"JSurlpath")%>')">Un-Lock Forum <% end if end if end if if rsForum("F_TYPE") = 0 then if (rs("CAT_STATUS") <> 0 and rsForum("F_STATUS") <> 0) or (mlev = 4 or mlev = 3) then %> &CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"urlpath") %>&type=0">Edit Forum Properties <% end if else if rsForum("F_TYPE") = 1 then %> &CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"urlpath") %>&type=1">Edit URL Properties <% end if end if if (mlev = 4) or (lcase(strNoCookies) = "1") then %> &CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"JSurlpath") %>')">Delete Forum <% end if if rsForum("F_TYPE") = 0 then if (mlev = 4) or (lcase(strNoCookies) = "1") then %> &CAT_ID=<% =rsForum("CAT_ID") %>&Forum_Title=<% =ChkString(rsForum("F_SUBJECT"),"urlpath") %>">New Topic <% end if end if end if end sub sub WriteStatistics() Dim Forum_Count Dim NewMember_Name, NewMember_Id, Member_Count Dim LastPostDate, LastPostLink 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 = rs("M_NAME") 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 = rs("M_NAME") 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(ChkUser2(strDBNTUserName, Request.Cookies(strCookieURL & "User")("Pword"))) > 0) %> ">Statistics " 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 Member_Count = 1 then Response.Write("1 Member has ") else Response.Write(Member_Count & " Members have ") end if%> made <% if intPostCount = 1 then Response.Write("1 post ") else Response.Write(intPostCount & " posts") end if%> in <% 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 & ".") %> <% end if end sub %>