<%@ CodePage=65001 Language="VBScript"%> <% Option Explicit %> <% GetConfigVariables SetupDatabase dim SQL, bClassToggle, sClassText, dDateRange, iDays if (sLogonType <> "ok") then response.redirect sValidatedBaseURL & "/logon.asp?error=needregistration" end if bClassToggle = false if request.form("action") = "unsubscribe" then if request.form("unsubscribe") = "daterange" then iDays = ValidateNumeric(request.form("daterange")) * -1 dDateRange = DateAdd("d", iDays, Date) SQL = "delete from [notifications] where [username]='" & ValidateSQL(sUsername) & "' and [threadid] in (" SQL = SQL & " select [threadid] from [threads] where [lastactivity]<" & sDateDelimiter & GetSQLDate(dDateRange) & sDateDelimiter & ");" response.write SQL dbCOnnection.Execute SQL elseif request.form("unsubscribe") = "all" then SQL = "delete from [notifications] where [username]='" & ValidateSQL(sUsername) & "';" dbConnection.Execute SQL elseif request.form("unsubscribe") = "select" then SQL = "delete from [notifications] where [username]='" & ValidateSQL(sUsername) & "' and [threadid] in (" & request.form("threadid") & ");" dbConnection.Execute SQL end if end if ' Retrieve list of subscribed threads SQL = "select [notifications].[threadid], [threads].[threadsubject], [threads].[lastactivity] from [notifications], [threads] where " SQL = SQL & " [notifications].[threadid] = [threads].[threadid] and [notifications].[username]='" & ValidateSQL(sUsername) & "' and [notifications].[type]='email' order by [threads].[lastactivity] DESC;" rsMaster.open SQL, dbConnection, adOpenForwardOnly, adLockReadOnly %> <%=validateField(sBBSName)%> : Mass unsubscribe from threads <% if bDisplayBBSQuotes = 1 then%>
<%=sBBSRandomQuoteText%> <%=GetRandomQuote%>

<% else %>
<% end if %> <% if rsMaster.EOF then %>
You're not subscribed to any threads!
<% else %>
Mass unsubscribe from threads
  Unsubscribe from threads with no activity in X days
days
  Unsubscribe from all threads
  Unsubscribe from selected threads
 
<% do until rsMaster.EOF bClassToggle = not(bCLassToggle) if bClassToggle = true then sClassText = "messagecellbody" else sClassText = "messagecellbody2" end if response.write "" & CRLF response.write "" response.write "" & CRLF rsMaster.MoveNext loop if bClassToggle = true then sClassText = "messagecellbody" else sClassText = "messagecellbody2" end if %>
  Thread Last Activity
" & ValidateField(rsMaster("threadsubject")) & "" & GetShortDateTime(rsMaster("lastactivity")) & "
  
<% end if %>