📄 getopic.asp
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<%
Response.Buffer = True
Dim intForumID
Dim lngTopicID
Dim strDirection
Dim lngNewTopicID
intForumID = CInt(Request.QueryString("fid"))
lngTopicID = CLng(Request.QueryString("tid"))
strDirection = Request.QueryString("dir")
If strDirection = "N" Then
strSQL = "SELECT TOP 1 timestopic.topicid "
strSQL = strSQL & "FROM timestopic "
strSQL = strSQL & "WHERE timestopic.bbsid = " & intForumID & " AND timestopic.topicid > " & lngTopicID & " "
strSQL = strSQL & "ORDER BY timestopic.topicid ASC;"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then
lngNewTopicID = CLng(rsConn("topicid"))
rsConn.Close
Else
rsConn.Close
strSQL = "SELECT TOP 1 timestopic.topicid "
strSQL = strSQL & "FROM timestopic "
strSQL = strSQL & "WHERE timestopic.bbsid = " & intForumID & " "
strSQL = strSQL & "ORDER BY timestopic.topicid ASC;"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then lngNewTopicID = CLng(rsConn("topicid"))
rsConn.Close
End If
End If
If strDirection = "P" Then
strSQL = "SELECT TOP 1 timestopic.topicid "
strSQL = strSQL & "FROM timestopic "
strSQL = strSQL & "WHERE timestopic.bbsid = " & intForumID & " AND timestopic.topicid < " & lngTopicID & " "
strSQL = strSQL & "ORDER BY timestopic.topicid DESC;"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then
lngNewTopicID = CLng(rsConn("topicid"))
rsConn.Close
Else
rsConn.Close
strSQL = "SELECT TOP 1 timestopic.topicid "
strSQL = strSQL & "FROM timestopic "
strSQL = strSQL & "WHERE timestopic.bbsid = " & intForumID & " "
strSQL = strSQL & "ORDER BY timestopic.topicid DESC;"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then lngNewTopicID = CLng(rsConn("topicid"))
rsConn.Close
End If
End If
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("post.asp?tid=" & lngNewTopicID)
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -