pmchk.asp

来自「电子商务网络购物系统」· ASP 代码 · 共 38 行

ASP
38
字号
<%
Dim intNumOfNewPM
Dim lngLastPMID
Dim lngLastNotifiedPMID

If intGroupID <> 2 AND blnActiveMember AND blnPrivateMessages Then
	strSQL = "SELECT Count(timesmess.messid) AS CountOfPM FROM timesmess "
	strSQL = strSQL & "WHERE timesmess.readed = 0 AND timesmess.userid = " & lngLoggedInUserID & ";"
	rsConn.Open strSQL, adoCon
	If CLng(rsConn("CountOfPM")) = 0 Then

	 	Response.Write("<a href=""welcome.asp"" target=""_self"" class=""nav"">短信服务</a>")

	Else
		intNumOfNewPM = CInt(rsConn("CountOfPM"))
		Response.Write("<a href=""welcome.asp"" target=""_self"" class=""nav"">短信服务</a><span class=""smText""> (" & intNumOfNewPM & " 新短信)</span>")
		rsConn.Close
			strSQL = "SELECT TOP 1 timesmess.messid FROM timesmess "
			strSQL = strSQL & "WHERE timesmess.readed = 0 AND timesmess.userid = " & lngLoggedInUserID & " "
			strSQL = strSQL & "ORDER BY messid DESC;"
		rsConn.Open strSQL, adoCon
		lngLastPMID = CLng(rsConn("messid"))
		If isNumeric(Request.Cookies("LPM")) Then lngLastNotifiedPMID = CLng(Request.Cookies("LPM"))
		If lngLastNotifiedPMID = Null OR lngLastPMID > lngLastNotifiedPMID Then
			Response.Write("<script language=""JavaScript""><!-- ")
			Response.Write(vbCrLf & vbCrLf & "//Save cookie with last PM date")
			Response.Write(vbCrLf & "document.cookie = 'LPM=" & lngLastPMID & "'")
			Response.Write(vbCrLf & vbCrLf & "//Display pop for new private message")
			Response.Write(vbCrLf & "checkPrivateMsg = confirm('你有 " & intNumOfNewPM & " 新消息.\n\n点击OK查看消息.')")
			Response.Write(vbCrLf & "if (checkPrivateMsg == true) {")
			Response.Write(vbCrLf & "	window.location='welcome.asp'")
			Response.Write(vbCrLf & "}")
			Response.Write(vbCrLf & "// --></script>")
		End If
	End If
	rsConn.Close
End If
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?