⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getopic.asp

📁 电子商务网络购物系统
💻 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 + -