📄 enotify.asp
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<%
Response.Buffer = True
Dim lngTopicID
Dim intForumID
Dim strReturnValue
Dim strMode
Dim strReturnPage
intForumID = CInt(Request.QueryString("fid"))
lngTopicID = CLng(Request.QueryString("tid"))
strMode = Request.QueryString("M")
If intForumID = "" AND lngTopicID = "" Then
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("index.asp")
End If
If lngTopicID AND blnEmail = True AND intGroupID <> 2 AND strMode = "" Then Call WatchUnWatchTopic(lngTopicID)
If intForumID AND blnEmail = True AND intGroupID <> 2 AND strMode = "" Then Call WatchUnWatchForum(intForumID)
If strMode = "Unsubscribe" AND intForumID <> "" AND lngTopicID <> "" Then Call UnsubscribeEmailNotify(intForumID, lngTopicID)
Private Function WatchUnWatchTopic(lngTopicID)
strSQL = "SELECT timesnotify.* "
strSQL = strSQL & "FROM timesnotify "
strSQL = strSQL & "WHERE timesnotify.userid=" & lngLoggedInUserID & " AND timesnotify.topicid=" & lngTopicID & ";"
With rsConn
.CursorType = 2
.LockType = 3
.Open strSQL, adoCon
If NOT .EOF Then
.Delete
strReturnValue = "&EN=TU"
Else
.AddNew
.Fields("userid") = lngLoggedInUserID
.Fields("topicid") = lngTopicID
.Update
strReturnValue = "&EN=TS"
End If
.Close
End With
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("post.asp?tid=" & lngTopicID & "&pn=" & Request.QueryString("pn") & "&tpn=" & Request.QueryString("tpn") & strReturnValue)
End Function
Private Function WatchUnWatchForum(intForumID)
strSQL = "SELECT timesnotify.* "
strSQL = strSQL & "FROM timesnotify "
strSQL = strSQL & "WHERE timesnotify.userid=" & lngLoggedInUserID & " AND timesnotify.bbsid=" & intForumID & ";"
With rsConn
.CursorType = 2
.LockType = 3
.Open strSQL, adoCon
If NOT .EOF Then
.Delete
strReturnValue = "&EN=FU"
Else
.AddNew
.Fields("userid") = lngLoggedInUserID
.Fields("bbsid") = intForumID
.Update
strReturnValue = "&EN=FS"
End If
.Close
End With
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("topic.asp?fid=" & intForumID & "&pn=" & Request.QueryString("pn") & strReturnValue)
End Function
Private Function UnsubscribeEmailNotify(intForumID, lngTopicID)
Response.Write("run")
If intGroupID = 2 Then Response.Redirect("login.asp?fid=" & intForumID & "&tid=" & lngTopicID & "&M=Unsubscribe")
strSQL = "SELECT timesnotify.* "
strSQL = strSQL & "FROM timesnotify "
strSQL = strSQL & "WHERE timesnotify.userid=" & lngLoggedInUserID & " AND timesnotify.topicid=" & lngTopicID & ";"
With rsConn
.CursorType = 2
.LockType = 3
.Open strSQL, adoCon
If NOT .EOF Then
.Delete
strReturnValue = "&EN=TU"
strReturnPage = "post.asp?tid=" & lngTopicID & strReturnValue
Else
.Close
strSQL = "SELECT timesnotify.* "
strSQL = strSQL & "FROM timesnotify "
strSQL = strSQL & "WHERE timesnotify.userid=" & lngLoggedInUserID & " AND timesnotify.bbsid=" & intForumID & ";"
.CursorType = 2
.LockType = 3
.Open strSQL, adoCon
If NOT .EOF Then
.Delete
strReturnValue = "&EN=FU"
strReturnPage = "topic.asp?fid=" & intForumID & strReturnValue
End If
End If
.Close
End With
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
If strReturnPage = "" Then
Response.Redirect("topic.asp?fid=" & intForumID)
Else
Response.Redirect(strReturnPage)
End If
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -