%
'#################################################################################
'## 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
'#################################################################################
if Request.QueryString("TOPIC_ID") = "" and Request.QueryString("mode") <> "getIP" and Request.Form("Method_Type") <> "login" and Request.Form("Method_Type") <> "logout" then
Response.Redirect "default.asp"
Response.End
end if
%>
<%
select case Request.QueryString("mode")
case "getIP"
%>
<%
DisplayIP
IP = ""
Title = ""
%>
<%
Response.End
case else
'## Do Nothing - Continue
end select
Member_ID = getNewMemberNumber()
if (strAuthType = "nt") then
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
call NTauthenticate()
if (ChkAccountReg() = "1") then
call NTUser()
end if
end if
%>
<%
if strPrivateForums = "1" then
if Request("Method_Type") = "" then
chkUser4()
end if
end if
if (mLev = 4) or (chkForumModerator(Request.QueryString("FORUM_ID"), ChkString(STRdbntUserName, "decode"))= "1") or (lcase(strNoCookies) = "1") then
AdminAllowed = 1
else
AdminAllowed = 0
end if
'## 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 = " & Request.QueryString("CAT_ID")
set rsCStatus = my_Conn.Execute (StrSql)
'## Forum_SQL - Find out if the Forum 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 = " & Request.QueryString("FORUM_ID")
set rsFStatus = my_Conn.Execute (StrSql)
'## Forum_SQL - Find out if the Topic is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "TOPICS.T_STATUS "
strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.TOPIC_ID = " & Request.QueryString("TOPIC_ID")
set rsTStatus = my_Conn.Execute (StrSql)
if rsCStatus.EOF or rsCStatus.BOF or rsFStatus.EOF or rsFStatus.BOF or rsTStatus.EOF or rsTStatus.BOF then
Response.Redirect(strForumURL)
else
mypage = request("whichpage")
if mypage = "" then
mypage = 1
end if
mySQL = request("strSql")
if mySQL = "" then
mySQL = SQLtemp
end if
'## Forum_SQL - Get all Forum Categories From DB
strSql = "SELECT CAT_ID "
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY"
set rsCat = my_Conn.Execute (StrSql)
%>
<%
'## Forum_SQL
strSql ="SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_ICQ, " & strMemberTablePrefix & "MEMBERS.M_YAHOO, " & strMemberTablePrefix & "MEMBERS.M_AIM, " & strMemberTablePrefix & "MEMBERS.M_TITLE, " & strMemberTablePrefix & "MEMBERS.M_Homepage, " & strMemberTablePrefix & "MEMBERS.M_LEVEL, " & strMemberTablePrefix & "MEMBERS.M_POSTS, " & strMemberTablePrefix & "MEMBERS.M_COUNTRY, " & strTablePrefix & "REPLY.REPLY_ID, " & strTablePrefix & "REPLY.R_AUTHOR, " & strTablePrefix & "REPLY.TOPIC_ID, " & strTablePrefix & "REPLY.R_MESSAGE, " & strTablePrefix & "REPLY.R_DATE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "REPLY.R_AUTHOR "
strSql = strSql & " AND TOPIC_ID = " & Request.QueryString("TOPIC_ID") & " "
strSql = strSql & " ORDER BY " & strTablePrefix & "REPLY.R_DATE"
if strDBType = "mysql" then 'MySql specific code
'## Forum_SQL - Get the total pagecount
strSql2 = "SELECT COUNT(" & strTablePrefix & "REPLY.TOPIC_ID) AS REPLYCOUNT "
strSql2 = strSql2 & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "REPLY "
strSql2 = strSql2 & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "REPLY.R_AUTHOR "
strSql2 = strSql2 & " AND TOPIC_ID = " & Request.QueryString("TOPIC_ID") & " "
set rsCount = my_Conn.Execute(strSql2)
if not rsCount.eof then
maxpages = (rsCount("REPLYCOUNT") \ strPageSize )
if rsCount("REPLYCOUNT") mod strPageSize <> 0 then
maxpages = maxpages + 1
end if
else
maxpages = 1
end if
set rs = Server.CreateObject("ADODB.Recordset")
' rs.cachesize= strPageSize
rs.open strSql, my_Conn, 3
if not(rs.EOF) then
rs.movefirst
end if
else 'end MySql specific code
set rs = Server.CreateObject("ADODB.Recordset")
rs.cachesize = strPageSize
rs.open strSql, my_Conn, 3
If not (rs.EOF or rs.BOF) then '## No replies found in DB
rs.movefirst
rs.pagesize = strPageSize
rs.absolutepage = mypage '**
maxpages = cint(rs.pagecount)
end if
end if
i = 0
%>
| >Author |
><% if strShowTopicNav = "1" then Call Topic_nav() else Response.Write("Topic") end if%> |
<% if (AdminAllowed = 1) then %>
<% call AdminOptions() %> |
<% else %>
|
<% end if %>
<%
if mypage = 1 then
Call GetFirst()
end if
%>
<%
'## Forum_SQL - Get all topicsFrom DB
strSql ="SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_ICQ, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_YAHOO, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_AIM, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_TITLE, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.MEMBER_ID, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_Homepage, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_LEVEL, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_POSTS, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_COUNTRY, "
strSql = strSql & strTablePrefix & "REPLY.REPLY_ID, "
strSql = strSql & strTablePrefix & "REPLY.R_AUTHOR, "
strSql = strSql & strTablePrefix & "REPLY.TOPIC_ID, "
strSql = strSql & strTablePrefix & "REPLY.R_MESSAGE, "
strSql = strSql & strTablePrefix & "REPLY.R_DATE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "REPLY.R_AUTHOR "
strSql = strSql & " AND TOPIC_ID = " & Request.QueryString("TOPIC_ID") & " "
strSql = strSql & " ORDER BY " & strTablePrefix & "REPLY.R_DATE"
if strDBType = "mysql" then 'MySql specific code
if mypage > 1 then
intOffSet = CInt((mypage - 1) * strPageSize) - 1
strSql = strSql & " LIMIT " & intOffSet & ", " & CInt(strPageSize) & " "
end if
'## Forum_SQL - Get the total pagecount
strSql2 = "SELECT COUNT(" & strTablePrefix & "REPLY.TOPIC_ID) AS REPLYCOUNT "
strSql2 = strSql2 & " FROM " & strTablePrefix & "REPLY "
strSql2 = strSql2 & " WHERE TOPIC_ID = " & Request.QueryString("TOPIC_ID") & " "
set rsCount = my_Conn.Execute(strSql2)
if not rsCount.eof then
maxpages = (rsCount("REPLYCOUNT") \ strPageSize )
if rsCount("REPLYCOUNT") mod strPageSize <> 0 then
maxpages = maxpages + 1
end if
else
maxpages = 1
end if
set rs = Server.CreateObject("ADODB.Recordset")
' rs.cachesize = strPageSize
rs.open strSql, my_Conn, 3
else 'end MySql specific code
set rs = Server.CreateObject("ADODB.Recordset")
rs.cachesize = 20
rs.open strSql, my_Conn, 3
if not(rs.EOF or rs.BOF) then '## Replies found in DB
rs.movefirst
rs.pagesize = strPageSize
maxpages = cint(rs.pagecount)
rs.absolutepage = mypage
end if
end if
if rs.EOF or rs.BOF then '## No replies found in DB
Response.Write ""
else
'rs.movefirst
intI = 0
howmanyrecs = 0
rec = 1
do until rs.EOF or (mypage = 1 and rec > strPageSize) or (mypage > 1 and rec > strPageSize) '**
if intI = 0 then
CColor = strAltForumCellColor
else
CColor = strForumCellColor
end if
%>
<% if strUseExtendedProfile then %>
">
<% else %>
')">
<% end if %>
<% =ChkString(rs("M_NAME"),"display") %>
<% if strShowRank = 1 or strShowRank = 3 then %>
<% = ChkString(getMember_Level(rs("M_TITLE"), rs("M_LEVEL"), rs("M_POSTS")),"display") %>
<% end if %>
<% if strShowRank = 2 or strShowRank = 3 then %>
<% = getStar_Level(rs("M_LEVEL"), rs("M_POSTS")) %>
<% end if %>
<% =rs("M_COUNTRY") %>
<% =rs("M_POSTS") %> Posts |
colspan="3"<% else %>colspan="2"<% end if %> valign="top"> Posted - <% =ChkDate(rs("R_DATE")) %> : <% =ChkTime(rs("R_DATE")) %>
<% if strUseExtendedProfile then %>
">
<% else %>
')">
<% end if %>
<% if (lcase(strEmail) = "1") then
if (mlev <> 0) or (mlev = 0 and strLogonForMail <> "1") then
%>
')">
<% end if
else
%>
')">
<% end if %>
<% if strHomepage = "1" then %>
<% if rs("M_Homepage") <> " " then %>
"> 's Homepage" border="0" align="absmiddle" hspace="6">
<% end if %>
<% end if %>
<% if (AdminAllowed = 1 or rs("MEMBER_ID") = Member_ID) or (strNoCookies = "1") then %>
<% if (rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0 and rsTStatus("T_STATUS") <> 0) or (AdminAllowed = 1) then %>
&TOPIC_ID=<% =Request.QueryString("TOPIC_ID") %>&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&auth=<% =ChkString(rs("R_AUTHOR"),"urlpath") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">
<% end if %>
<% end if %>
<% if strICQ = "1" then %>
<% if Trim(rs("M_ICQ")) <> "" then %>
&M_NAME=<% =ChkString(rs("M_NAME"),"JSurlpath") %>')"> &img=5" height=15 width=15 alt="Send <% = ChkString(rs("M_NAME"),"display") %> an ICQ Message" border="0" align="absmiddle" hspace="6">
<% end if %>
<% end if %>
<% if strYAHOO = "1" then %>
<% if Trim(rs("M_YAHOO")) <> "" then %>
&.src=pg')"> a Yahoo! Message" border="0" align="absmiddle" hspace="6">
<% end if %>
<% end if %>
<% if (strAIM = "1") then %>
<% if Trim(rs("M_AIM")) <> "" then %>
&M_NAME=<% =ChkString(rs("M_NAME"),"urlpath") %>')"> an instant message" border="0" align="absmiddle" hspace="6">
<% end if %>
<% end if %>
<% if (rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0 and rsTStatus("T_STATUS") <> 0) or (AdminAllowed = 1) then %>
&TOPIC_ID=<% =Request.QueryString("TOPIC_ID") %>&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>&M=<% =Request.QueryString("M") %>">
<% end if %>
<% if (strIPLogging = "1") then %>
<% if (AdminAllowed = 1) or (strNoCookies = "1") then %>
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>')">
<% end if %>
<% end if %>
<% if (AdminAllowed = 1 or rs("MEMBER_ID") = Member_ID) or (strNoCookies = "1") then %>
<% if (rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0 and rsTStatus("T_STATUS") <> 0) or (AdminAllowed = 1) then %>
&TOPIC_ID=<% =Request.QueryString("TOPIC_ID") %>&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>')">
<% end if %>
<% end if %>
<% =formatStr(rs("R_MESSAGE")) %> |
<%
rs.MoveNext
intI = intI + 1
if intI = 2 then
intI = 0
end if
rec = rec + 1
loop
end if
%>
|
<% if maxpages > 1 then %>
| Topic is <% =maxpages %> Pages Long: |
<% Call Paging() %> |
<% else %>
| |
<% end if %>
<% if (AdminAllowed = 1) then %>
<% call AdminOptions() %>
<% else %>
<% end if %>
|
|
| <% Call PostingOptions() %> |
|
<%
end if
sub GetFirst()
'## Forum_SQL - Get Origional Posting
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_ICQ, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_YAHOO, " & strMemberTablePrefix & "MEMBERS.M_AIM, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_TITLE, " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_LEVEL, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_POSTS, " & strMemberTablePrefix & "MEMBERS.M_COUNTRY, "
strSql = strSql & strTablePrefix & "TOPICS.T_DATE, " & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "TOPICS.T_AUTHOR, "
strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.T_MESSAGE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.TOPIC_ID = " & Request.QueryString("TOPIC_ID")
set rs = my_Conn.Execute (strSql)
if rs.EOF or rs.BOF then '## No categories found in DB
Response.Write " " & vbCrLf
Response.Write " | No Topics Found | " & vbCrLf
Response.Write "
" & vbCrLf
else
%>
<% if strUseExtendedProfile then %>
">
<% else %>
')">
<% end if %>
<% =ChkString(rs("M_NAME"),"display") %>
<% if strShowRank = 1 or strShowRank = 3 then %>
<% = ChkString(getMember_Level(rs("M_TITLE"), rs("M_LEVEL"), rs("M_POSTS")),"display") %>
<% end if %>
<% if strShowRank = 2 or strShowRank = 3 then %>
<% = getStar_Level(rs("M_LEVEL"), rs("M_POSTS")) %>
<% end if %>
<% =rs("M_COUNTRY") %>
<% =rs("M_POSTS") %> Posts |
colspan="3"<% else %>colspan="2"<% end if %> valign="top"> Posted - <% =ChkDate(rs("T_DATE")) %> : <% =ChkTime(rs("T_DATE")) %>
<% if strUseExtendedProfile then %>
">
<% else %>
')">
<% end if %>
<% if (lcase(strEmail) = "1") then
if (mlev <> 0) or (mlev = 0 and strLogonForMail <> "1") then
%>
')">
<% end if
else
%>
')">
<% end if %>
<% if (strHomepage = "1") then %>
<% if rs("M_Homepage") <> " " then %>
"> 's Homepage" border="0" align="absmiddle" hspace="6">
<% end if %>
<% end if %>
<% if (AdminAllowed = 1 or rs("MEMBER_ID") = Member_ID) or (strNoCookies = "1") then %>
<% if ((rsCStatus("CAT_STATUS") <> 0) and (rsFStatus("F_STATUS") <> 0) and (rsTStatus("T_STATUS") <> 0)) or (AdminAllowed = 1) then %>
&TOPIC_ID=<% =Request.QueryString("TOPIC_ID") %>&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&auth=<% =rs("T_AUTHOR") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">
<% end if %>
<% end if %>
<% if (strICQ = "1") then %>
<% if Trim(rs("M_ICQ")) <> "" then %>
&M_NAME=<% =ChkString(rs("M_NAME"), "JSurlpath") %>')"> &img=5" height=15 width=15 alt="Send <% =ChkString(rs("M_NAME"),"display") %> an ICQ Message" border="0" align="absmiddle" hspace="6">
<% end if %>
<% end if %>
<% if (strYAHOO = "1") then %>
<% if Trim(rs("M_YAHOO")) <> "" then %>
&.src=pg')"> a Yahoo! Message" border="0" align="absmiddle" hspace="6">
<% end if %>
<% end if %>
<% if (strAIM = "1") then %>
<% if Trim(rs("M_AIM")) <> "" then %>
&M_NAME=<% =ChkString(rs("M_NAME"), "JSurlpath") %>')"> an instant message" border="0" align="absmiddle" hspace="6">
<% end if %>
<% end if %>
<% if (rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0 and rsTStatus("T_STATUS") <> 0) or (AdminAllowed = 1) then %>
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">
<% end if %>
<% if (strIPLogging = "1") then %>
<% if (AdminAllowed = 1) or (strNoCookies = "1") then %>
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>')">
<% end if %>
<% end if %>
<% =formatStr(rs("T_MESSAGE")) %> |
<%
end if
'## Forum_SQL
strSql = "UPDATE " & strTablePrefix & "TOPICS "
strSql = strSql & " SET " & strTablePrefix & "TOPICS.T_VIEW_COUNT = (" & strTablePrefix & "TOPICS.T_VIEW_COUNT + 1) "
strSql = strSql & " WHERE (" & strTablePrefix & "TOPICS.TOPIC_ID = " & Request.QueryString("TOPIC_ID") & ");"
my_conn.Execute (strSql)
set rs = nothing
End Sub
sub DisplayIP()
usr = (chkForumModerator(Request.QueryString("FORUM_ID"), STRdbntUserName))
if (chkUser((STRdbntUserName), (Request.Cookies(strUniqueID & "User")("Pword"))) = 4) then
usr = 1
end if
if usr then
if Request.QueryString("TOPIC_ID") <> "" then
'## Forum_SQL
strSql = "SELECT " & strTablePrefix & "TOPICS.T_IP, " & strTablePrefix & "TOPICS.T_SUBJECT "
strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE TOPIC_ID = " & Request.QueryString("TOPIC_ID")
rsIP = my_Conn.Execute(strSql)
IP = rsIP("T_IP")
Title = rsIP("T_Subject")
else
if Request.QueryString("REPLY_ID") <> "" then
'## Forum_SQL
strSql = "SELECT " & strTablePrefix & "REPLY.R_IP "
strSql = strSql & " FROM " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE REPLY_ID = " & Request.QueryString("REPLY_ID")
rsIP = my_Conn.Execute(strSql)
IP = rsIP("R_IP")
end if
end if
set rsIP = nothing
%>
User's IP address:
<% =ip %>
<% else %>
Only moderators and administrators can perform this action.
<%
end If
end sub
sub PostingOptions()
%>
<%
if (mlev = 4 or mlev = 3 or mlev = 2 or mlev = 1) or (lcase(strNoCookies) = "1") or (STRdbntUserName = "") then
if ((rsCStatus("CAT_STATUS") = 1) and (rsFStatus("F_STATUS") = 1)) then %>
&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>">
&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>">New Topic
<% else
if (AdminAllowed = 1) then %>
&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>">
&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>">New Topic
<% else %>
Forum Locked
<% end if
end if
if (rsCStatus("CAT_STATUS") = 1) and (rsFStatus("F_STATUS") = 1) and (rsTStatus("T_STATUS") = 1) then %>
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">Reply to Topic
<% Else
if (AdminAllowed = 1) then %>
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">Reply to Topic
<% Else %>
Topic Locked
<% end if
end if
if (lcase(strEmail) = "1") then
if (mlev <> 0) or (mlev = 0 and strLogonForMail <> "1") then %>
')">
')">Send Topic to a Friend
<% end if
end if %>
<% end if %>
<%
end sub
sub AdminOptions()
%>
<% 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=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"JSurlpath") %>')">
<% else
if (rsTStatus("T_STATUS") <> 0) then %>
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"JSurlpath") %>')">
<% else %>
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"JSurlpath") %>')">
<% end if
end if
end if %>
<% if ((rsCStatus("CAT_STATUS") <> 0) and (rsFStatus("F_STATUS") <> 0) and (rsTStatus("T_STATUS") <> 0)) or (AdminAllowed = 1) then %>
&TOPIC_ID=<% =Request.QueryString("TOPIC_ID") %>&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">
<% end if %>
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"JSurlpath") %>')">
&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>">
&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>&Topic_Title=<% =ChkString(Request.QueryString("Topic_Title"),"urlpath") %>">
<% end if %>
<%
end sub
sub Paging()
if maxpages > 1 then
if Request.QueryString("whichpage") = "" then
pge = 1
else
pge = Request.QueryString("whichpage")
end if
scriptname = request.servervariables("script_name")
Response.Write("")
for counter = 1 to maxpages
if counter <> cint(pge) then
ref = "| " & " " & widenum(counter) & ""
ref = ref & "" & counter & " | "
Response.Write ref
else
ref = ref & "'>" & counter & ""
Response.Write ref
end if
else
Response.Write("" & " " & widenum(counter) & "" & counter & " | ")
end if
if counter mod strPageNumberSize = 0 then
Response.Write("
")
end if
next
Response.Write("
")
end if
top = "0"
end sub
Sub Topic_nav()
set rsLastPost = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT T_LAST_POST FROM " & strTablePrefix & "TOPICS "
strSql = strSql & "WHERE TOPIC_ID = " & Request.QueryString("TOPIC_ID")
set rsLastPost = my_Conn.Execute (StrSql)
T_LAST_POST = rsLastPost("T_LAST_POST")
strSQL = "SELECT T_SUBJECT, TOPIC_ID "
strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
strSql = strSql & "WHERE T_LAST_POST > '" & T_LAST_POST
strSql = strSql & "' AND FORUM_ID=" & Request.QueryString("Forum_ID")
strSql = strSql & " ORDER BY T_LAST_POST;"
set rsPrevTopic = my_conn.Execute (strSQL)
strSQL = "SELECT T_SUBJECT, TOPIC_ID "
strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
strSql = strSql & "WHERE T_LAST_POST < '" & T_LAST_POST
strSql = strSql & "' AND FORUM_ID=" & Request.QueryString("Forum_ID")
strSql = strSql & " ORDER BY T_LAST_POST DESC;"
set rsNextTopic = my_conn.Execute (strSQL)
if rsPrevTopic.EOF then
prevTopic = "
"
else
prevTopic = "
"
end if
if rsNextTopic.EOF then
NextTopic = "
"
else
NextTopic = "
"
end if
Response.Write (prevTopic & " Topic " & nextTopic)
rsLastPost.close
rsPrevTopic.close
rsNextTopic.close
set rsLastPost = nothing
set rsPrevTopic = nothing
set rsNextTopic = nothing
end sub
%>