% '############################################################################### '## 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. '## '## 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. '## '## Correspondence and Questions can be sent to: '## reinhold@bigfoot.com '## '## or '## '## Snitz Communications '## C/O: Michael Anderson '## PO Box 200 '## Harpswell, ME 04079 '############################################################################### %> <% dim Subscribe, sublevel, CatID, ForumID, TopicID, MemberID, RecordCount, ThisMemberID ' DEM --> Added code for moderation and subscription mLev = cint(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"))) MemberID = getMemberNumber(strDBNTUserName) ThisMemberID = cInt(Request("MEMBER_ID")) if (ThisMemberID <> MemberID and mlev = 4) or (MemberID = ThisMemberID) then Subscribe = Request.QueryString("SUBSCRIBE") SubLevel = Request.QueryString("LEVEL") CatID = Request.QueryString("CAT_ID") if CatID = "" then CatId = 0 ForumID = Request.QueryString("FORUM_ID") if ForumID = "" then ForumId = 0 TopicID = Request.QueryString("TOPIC_ID") if TopicID = "" then TopicId = 0 MemberID = Request.QueryString("MEMBER_ID") Response.Write "
" & vbNewline Response.Write "" & vbNewline ' --- Is the member trying to subscribe or unsubscribe?? Select case Subscribe ' --- Unsubscribe case "U" DeleteSubscription sublevel, MemberID, CatID, ForumID, TopicID ' --- Return the appropriate message to the user.... if CheckSubscriptionCount(SubLevel, MemberID, CatID, ForumID, TopicID) > 0 then Response.Write "Subscriptions" else Response.Write "Subscription" end if Response.Write " Cancelled!
" & vbNewline Response.Write "" & vbNewline Response.Write " (Remember to reload the page)" & vbNewline ' --- Subscribe case "S" ' --- Check for overriding subscriptions to prevent duplicate emails if (sublevel = "TOPIC" or sublevel = "FORUM" or sublevel = "CAT") and (CheckSubscriptionCount("BOARD", MemberID, 0, 0, 0) > 0) then SendHigherLevelMsg "BOARD", 0 elseif (sublevel = "TOPIC" or sublevel = "FORUM") and (CheckSubscriptionCount("CAT", MemberID, CatId, 0, 0) > 0) then SendHigherLevelMsg "CAT", CatId elseif sublevel = "TOPIC" and (CheckSubscriptionCount("FORUM", MemberID, CatID, ForumID, 0) > 0) then SendHigherLevelMsg "FORUM", ForumId else ' Delete any lower subscriptions to prevent duplicates emails..... if SubLevel = "FORUM" or SubLevel = "CAT" or SubLevel = "BOARD" then DeleteSubscription sublevel, MemberID, CatID, ForumID, TopicID end if AddSubscription SubLevel, MemberID, CatID, ForumID, TopicID end if End Select else Response.Write "You do not have permission to change another users subscription. Only Administrators may change another users subscriptions." & _ "
" & vbNewline ' ## This is just the form which is used to login if the person is ' ## not logged in or does not have access to do the moderation. Response.Write "" & vbNewline end if %> <% sub DeleteSubscription(Level, MemberID, CatID, ForumID, TopicID) ' --- Delete the appropriate sublevel of subscriptions StrSql = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS" StrSql = StrSql & " WHERE " & strTablePrefix & "SUBSCRIPTIONS.MEMBER_ID = " & MemberID if sublevel = "CAT" then StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.CAT_ID = " & CatID elseif sublevel = "FORUM" then StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.FORUM_ID = " & ForumID elseif sublevel = "TOPIC" then StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.TOPIC_ID = " & TopicID end if my_Conn.Execute (strSql) end sub sub AddSubscription(SubLevel, MemberID, CatID, ForumID, TopicID) ' --- Insert the appropriate sublevel subscription StrSql = "INSERT INTO " & strTablePrefix & "SUBSCRIPTIONS" StrSql = StrSql & "(MEMBER_ID, CAT_ID, FORUM_ID, TOPIC_ID) VALUES (" & MemberID & ", " IF sublevel = "BOARD" then StrSql = StrSql & "0, 0, 0)" ElseIf sublevel = "CAT" then StrSql = StrSql & CatID & ", 0, 0)" ElseIf sublevel = "FORUM" then StrSql = StrSql & CatID & ", " & ForumID & ", 0)" Else StrSql = StrSql & CatID & ", " & ForumID & ", " & TopicID & ")" End if my_Conn.Execute (strSql) Response.Write "You are subscribed to " if sublevel = "BOARD" then Response.Write "