%
'#################################################################################
'## Copyright (C) 2000 Michael Anderson and Pierre Gorissen
'##
'## 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
'#################################################################################
%>
<%
'## Do Cookie stuffs with reload
nRefreshTime = Request.Cookies(strCookieURL & "Reload")
if Request.form("cookie") = "1" then
if strSetCookieToForum = 1 then
Response.Cookies(strCookieURL & "Reload").Path = strCookieURL
end if
Response.Cookies(strCookieURL & "Reload") = Request.Form("RefreshTime")
Response.Cookies(strCookieURL & "Reload").expires = strForumTimeAdjust + 365
nRefreshTime = Request.Form("RefreshTime")
end if
if nRefreshTime = "" then
nRefreshTime = 0
end if
ActiveSince = Request.Cookies(strCookieURL & "ActiveSince")
'## Do Cookie stuffs with show last date
if Request.form("cookie") = "2" then
ActiveSince = Request.Form("ShowSinceDateTime")
if strSetCookieToForum = 1 then
Response.Cookies(strCookieURL & "ActiveSince").Path = strCookieURL
end if
Response.Cookies(strCookieURL & "ActiveSince") = ActiveSince
end if
Select Case ActiveSince
Case "LastVisit"
lastDate = ""
Case "LastHour"
lastDate = DateToStr(DateAdd("h",-1,strForumTimeAdjust))
Case "LastDay"
lastDate = DateToStr(DateAdd("d",-1,strForumTimeAdjust))
Case "LastWeek"
lastDate = DateToStr(DateAdd("ww",-1,strForumTimeAdjust))
Case "LastMonth"
lastDate = DateToStr(DateAdd("m",-1,strForumTimeAdjust))
Case Else
lastDate = ""
End Select
%>
<%
if IsEmpty(Session(strCookieURL & "last_here_date")) then
Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
end if
if lastDate = "" then
lastDate = Session(strCookieURL & "last_here_date")
end if
if Request.Form("AllRead") = "Y" then
Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
lastDate = Session(strCookieURL & "last_here_date")
ActiveSince = ""
end if
'## Forum_SQL - Get all active topics from last visit
strSql = "SELECT " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "TOPICS.T_STATUS, "
strSql = strSql & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.FORUM_ID, "
strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.CAT_ID, "
strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "TOPICS.T_MAIL, "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, " & strTablePrefix & "TOPICS.T_REPLIES, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR, "
strSql = strSql & strTablePrefix & "TOPICS.T_LAST_POST, " & strMemberTablePrefix & "MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME "
strSql = strSql & "FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "FORUM, "
strSql = strSql & strTablePrefix & "TOPICS, " & strMemberTablePrefix & "MEMBERS AS " & strMemberTablePrefix & "MEMBERS_1 "
strSql = strSql & "WHERE " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR = " & strMemberTablePrefix & "MEMBERS_1.MEMBER_ID "
strSql = strSql & "AND " & strTablePrefix & "FORUM.FORUM_ID = " & strTablePrefix & "TOPICS.FORUM_ID "
strSql = strSql & "AND " & strTablePrefix & "FORUM.CAT_ID = " & strTablePrefix & "TOPICS.CAT_ID "
strSql = strSql & "AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & "AND " & strTablePrefix & "TOPICS.T_LAST_POST > '" & lastDate & "'"
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.FORUM_ID, " & strTablePrefix & "TOPICS.T_LAST_POST DESC;"
set rs = my_Conn.Execute (strSql)
%>
|
<%If not(rs.EOF or rs.BOF) and (mLev > 0) then %>
|
Topic |
Author |
Replies |
Read |
Last Post |
<% if (mlev = 4 or mlev = 3) or (lcase(strNoCookies) = "1") then %>
|
<% end if %>
<%If rs.EOF or rs.BOF then %>
| No Active Topics Found |
<% if (mlev = 4 or mlev = 3) or (lcase(strNoCookies) = "1") then %>
|
<% end if %>
<%else
currForum = 0
fDisplayCount = 0
do until rs.EOF
'## Forum_SQL - Find out if the Category is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_STATUS "
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY "
strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & rs("CAT_ID")
set rsCStatus = my_Conn.Execute (StrSql)
'## Forum_SQL - Find out if the Topic is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "FORUM.F_STATUS "
strSql = strSql & " FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & rs("FORUM_ID")
set rsFStatus = my_Conn.Execute (StrSql)
if ChkForumAccess(rs("FORUM_ID")) then
if (mLev = 4) or ((chkForumModerator(rs("FORUM_ID"), Session(strCookieURL & "username"))= "1") and mLev = 3) or ((chkForumModerator(rs("FORUM_ID"), Request.Cookies(strCookieURL & "User")("Name")) = "1") and mlev = 3) or (lcase(strNoCookies) = "1") then
AdminAllowed = 1
else
AdminAllowed = 0
end if
fDisplayCount = fDisplayCount + 1
if currForum <> rs("FORUM_ID") then %>
| "><% =ChkString(rs("F_SUBJECT"),"display") %> |
<% if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then %>
<% ForumAdminOptions() %> |
<%elseif (mLev = 3) then%>
|
<% end if %>
<% end if %>
<% if rsCStatus("CAT_STATUS") <> 0 and rsFstatus("F_STATUS") <> 0 and rs("T_STATUS") <> 0 then
if lcase(strHotTopic) = "1" then
if rs("T_REPLIES") >= intHotTopicNum Then %>
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(left(rs("T_SUBJECT"), 50),"urlpath") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>">
<% else%>
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(left(rs("T_SUBJECT"), 50),"urlpath") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>">
<% end if
end if
else %>
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<%=rs("CAT_ID") %>&Topic_Title=<% =ChkString(left(rs("T_SUBJECT"), 50),"urlpath") %>&Forum_Title=<%=ChkString(rs("F_SUBJECT"),"urlpath") %>">
border="0">
<% end if %>
|
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(left(rs("T_SUBJECT"), 50),"urlpath") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>"><% =ChkString(left(rs("T_SUBJECT"), 50),"display") %> <% if strShowPaging = "1" then TopicPaging() end if%> |
<% =ChkString(rs("M_NAME"),"display") %> |
<% =rs("T_REPLIES") %> |
<% =rs("T_VIEW_COUNT") %> |
<%
if IsNull(rs("T_LAST_POST_AUTHOR")) then
strLastAuthor = ""
else
strLastAuthor = " by: "
if strUseExtendedProfile then
strLastAuthor = strLastAuthor & ""
else
strLastAuthor = strLastAuthor & ""
end if
strLastAuthor = strLastAuthor & rs("LAST_POST_AUTHOR_NAME") & ""
end if
%>
<% =ChkDate(rs("T_LAST_POST")) %> <% =ChkTime(rs("T_LAST_POST")) %><%=strLastAuthor%> |
<% if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then %>
<% if rsCStatus("CAT_STATUS") = 0 then %>
')">
<% else
if rsFStatus("F_STATUS") = 0 then %>
&CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"JSurlpath")%>')">
<% else
if rs("T_STATUS") <> 0 then %>
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"JSurlpath")%>')">
<% else %>
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"JSurlpath")%>')">
<% end if
end if
end if
if (AdminAllowed = 1) or (rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0 and rs("T_STATUS") <> 0) then %>
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&auth=<% =rs("T_AUTHOR") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"urlpath") %>">
<% end if %>
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"JSurlpath") %>')">
&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>&Topic_Title=<% =ChkString(left(rs("T_SUBJECT"), 50),"urlpath") %>">
|
<% elseif (mLev = 3) then%>
|
<% end if %>
<% end if
currForum = rs("FORUM_ID") %>
<% rs.MoveNext
loop
if fDisplayCount = 0 then %>
| No Active Topics Found |
<% if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then %>
|
<% end if
end if
end if %>
|
<%
sub ForumAdminOptions()
if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then
if rsCStatus("CAT_STATUS") = 0 then
if mlev = 4 then %>
')">
<% else %>
<% end if
else
if rsFStatus("F_STATUS") <> 0 then %>
&CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"JSurlpath")%>')">
<% else %>
&CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"JSurlpath")%>')">
<% end if
end if
if (rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0) or (AdminAllowed = 1) then %>
&CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>&type=0">
<% end if %>
&CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"JSurlpath") %>')">
&CAT_ID=<% =rs("CAT_ID")%>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>">
<% end if
end sub
sub TopicPaging()
mxpages = (rs("T_REPLIES") / strPageSize)
if mxPages <> cint(mxPages) then
mxpages = int(mxpages) + 1
end if
if mxpages > 1 then
Response.Write("![]() | ")
for counter = 1 to mxpages
ref = ""
if ((mxpages > 9) and (mxpages > strPageNumberSize)) or ((counter > 9) and (mxpages < strPageNumberSize)) then
ref = ref & " "
end if
ref = ref & widenum(counter) & "" & counter & " | "
Response.Write ref
if counter mod strPageNumberSize = 0 then
Response.Write("
| | ")
end if
next
Response.Write("
")
end if
end sub
%>