searchchk.asp

来自「电子商务网络购物系统」· ASP 代码 · 共 335 行 · 第 1/2 页

ASP
335
字号
<% Else %>
    <tr bgcolor="<% = strTablebgColour %>" class="tHeading" height="25" align="center">
     <td nowrap width="3%" background="<% = strTableTitleBgImage %>">状态</td>
     <td align="left" background="<% = strTableTitleBgImage %>">主题</td>
     <td width="12%" background="<% = strTableTitleBgImage %>">作者</td>
     <td width="9%" background="<% = strTableTitleBgImage %>">回复</td>
     <td width="9%" background="<% = strTableTitleBgImage %>">浏览</td>
     <td width="15%" background="<% = strTableTitleBgImage %>" colspan="2">最后发表</td>
    </tr><%
	rsConn.AbsolutePage = intRecordPositionPageNum
	intTotalNumOfPages = rsConn.PageCount
	Set rsST = Server.CreateObject("ADODB.Recordset")
	For intRecordLoopCounter = 1 to intTopicPerPage
		If rsConn.EOF Then Exit For
		intSearchForumID = CInt(rsConn("bbsid"))
		lngTopicID = CLng(rsConn("topicid"))
		lngPollID = CLng(rsConn("pollid"))
		lngNumberOfViews = CLng(rsConn("viewnum"))
		dtmstartdate=rsConn("startdtm")
		strSubject = rsConn("Subject")
		
		For intHighlightLoopCounter = 0 To UBound(sarySearchWord)
			strSubject = Replace(strSubject, sarySearchWord(intHighlightLoopCounter), "<span class=""highlight"">" & sarySearchWord(intHighlightLoopCounter) & "</span>", 1, -1, 1)
		Next
		strSQL = "SELECT TOP 1 timestopic.Locked, timestopic.Priority FROM timestopic WHERE timestopic.topicid = " & lngTopicID & ";"
		rsST.Open strSQL, adoCon
		blnTopicLocked = CBool(rsST("Locked"))
		intPriority = CInt(rsST("Priority"))
		rsST.Close
			strSQL = "SELECT timespost.postid, timespost.userid, timespost.msgdtm, timesuser.Username "
			strSQL = strSQL & "FROM timesuser INNER JOIN timespost ON timesuser.userid = timespost.userid "
			strSQL = strSQL & "WHERE timespost.topicid = " & lngTopicID & " "
			strSQL = strSQL & "ORDER BY timespost.msgdtm ASC;"
		rsST.CursorType = 1
		rsST.Open strSQL, adoCon
		If NOT rsST.EOF Then
			strTopicStartUsername = rsST("Username")
			lngTopicStartUserID = CLng(rsST("userid"))
			lngNumberOfReplies = CLng((rsST.RecordCount) - 1)
			rsST.MoveLast
			lngLastEntryMessageID = CLng(rsST("postid"))
			strLastEntryUsername = rsST("Username")
			lngLastEntryUserID = CLng(rsST("userid"))
			dtmLastEntryDate = CDate(rsST("msgdtm"))
		End If
		If (CDate(Session("dtmLastVisit")) < dtmLastEntryDate) AND (Request.Cookies("RT")("tid" & lngTopicID) = "") Then
			blnNewPost = True
		Else
			blnNewPost = False
		End If
		%>
    <tr bgcolor="#FFFFFF"  class="text" align="center" height="25">
     <td width="40" nowrap><%
     	 	If intPriority = 1 Then %>
			<img src="images/pin.gif" border="0" alt="置顶主题">
			<% 	ElseIf blnTopicLocked = True AND intPriority > 0 Then %>
			<img src="images/lockedtop.gif" border="0" alt="被锁总置顶主题">
			<% 	ElseIf intPriority > 0 Then %>
			<img src="images/firsttop.gif" border="0" alt="总置顶主题">
			<% 	ElseIf blnTopicLocked = True Then %>
			<img src="images/closedtopic.gif" border="0" alt="已锁主题">
			<% 	ElseIf (lngNumberOfReplies >= intNumHotReplies OR lngNumberOfViews >= intNumHotViews) AND (blnNewPost = True) Then %>
			<img src="images/hotnew.gif" border="0" alt="热门主题(有新回复)">
			<% 	ElseIf lngNumberOfReplies >= intNumHotReplies OR lngNumberOfViews >= intNumHotViews Then %>
			<img src="images/hotnonew.gif" border="0" alt="热门主题(无新回复)">
			<% 	ElseIf blnNewPost = True Then %>
			<img src="images/newpost.gif" border="0" alt="开放主题(有新回复)">
			<%	Else %>
			<img src="images/nonew.gif" border="0" alt="开放主题(无新回复)">
			<%	End If   %></td>
     <td width="50%" align="left"><%
		 If blnAdmin = True OR blnModerator = True Then
		  		%>
      <a href="javascript:openWin('putopicadmin.asp?tid=<% = lngTopicID %>','admin','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=590,height=425')"><img src="images/smadmin.gif" border="0" alt="管理主题"></a><%
		End If
		If lngPollID <> 0 Then Response.Write("投票")
		  %><a href="post.asp?tid=<% = lngTopicID %>&kw=<% = Server.URLEncode(Request.QueryString("kw")) %>" target="_self"><% = strSubject %></a><%
		 intNumberOfTopicPages = ((lngNumberOfReplies + 1)\intThreadsPerPage)
		 If ((lngNumberOfReplies + 1) Mod intThreadsPerPage) > 0 Then intNumberOfTopicPages = intNumberOfTopicPages + 1
		 If intNumberOfTopicPages > 1 Then
		 	Response.Write("<br /><img src=""images/page.gif"" align=""middle"" alt=""主题页数"">")
		 	For intTopicPagesLoopCounter = 1 To intNumberOfTopicPages
		 		If intTopicPagesLoopCounter > 7 Then
		 			If intNumberOfTopicPages = 8 Then
		 				Response.Write(" <a href=""post.asp?tid=" & lngTopicID & "&kw=" & Server.URLEncode(Request.QueryString("kw")) & "&tpn=8")
			 			If intPriority = 3 Then Response.Write("&fid=" & intForumID & "&pr=3")
			 			Response.Write(""" target=""_self"" class=""smLink"">8</a>")
					Else
						Response.Write(" ...")
						Response.Write(" <a href=""post.asp?tid=" & lngTopicID & "&kw=" & Server.URLEncode(Request.QueryString("kw")) & "&tpn=" & intNumberOfTopicPages - 1)
			 			If intPriority = 3 Then Response.Write("&fid=" & intForumID & "&pr=3")
			 			Response.Write(""" target=""_self"" class=""smLink"">" & intNumberOfTopicPages - 1 & "</a>")		
			 			Response.Write(" <a href=""post.asp?tid=" & lngTopicID & "&kw=" & Server.URLEncode(Request.QueryString("kw")) & "&tpn=" & intNumberOfTopicPages)
			 			If intPriority = 3 Then Response.Write("&fid=" & intForumID & "&pr=3")
			 			Response.Write(""" target=""_self"" class=""smLink"">" & intNumberOfTopicPages & "</a>")		
					End If
		 			Exit For
		 		End If
		 		Response.Write(" <a href=""post.asp?tid=" & lngTopicID & "&kw=" & Server.URLEncode(Request.QueryString("kw")) & "&tpn=" & intTopicPagesLoopCounter)
		 		If intPriority = 3 Then Response.Write("&fid=" & intForumID & "&pr=3")
		 		Response.Write(""" target=""_self"" class=""smLink"">" & intTopicPagesLoopCounter & "</a>")
		 	Next
		 End If
		  %></td>
     <td nowrap><a href="JavaScript:openWin('puprofile.asp?pf=<% = lngTopicStartUserID %>&fid=<% = intSearchForumID %>','profile','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=590,height=425')"><% = strTopicStartUsername %></a></br>&nbsp;<% = dtmstartdate %>&nbsp;</td>
     <td><% = lngNumberOfReplies %></td>
     <td><% = lngNumberOfViews %></td>
     <td align="right" class="smText" nowrap="nowrap">
      &nbsp;By:<a href="JavaScript:openWin('puprofile.asp?pf=<% = lngLastEntryUserID %>','profile','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=590,height=425')" class="smLink"><% = strLastEntryUsername %></a>&nbsp;</br>&nbsp;<% = dtmLastEntryDate %>&nbsp;</td>
	  <td>&nbsp;<a href="post.asp?tid=<% = lngTopicID %>&get=last#<% = lngLastEntryMessageID %>" target="_self"><img src="images/rightarrow.gif" align="absmiddle" border="0" alt="查看最后发表的帖子"></a>&nbsp;</td>
    </tr>
    <%
                rsST.Close
		rsConn.MoveNext
	Next
End If

rsConn.Close
        %>
		
   </table>

<form>
 <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
   <%
If intTotalNumOfPages > 1 Then
	Response.Write vbCrLf & "		<td align=""left""><span class=""text"">搜索结果:" &"第"
	Response.Write vbCrLf & "		  <select onChange=""ForumJump(this)"" name=""SelectTopicPage"">"
	For intTopicPageLoopCounter = 1 to intTotalNumOfPages
		Response.Write vbCrLf & "		  <option value=""searchchk.asp?kw=" & Server.URLEncode(Request.QueryString("kw")) & "&SM=" & Request.QueryString("SM") & "&si=" & Request.QueryString("si") & "&FM=" & Request.QueryString("FM") & "&OB=" & Request.QueryString("OB") & "&Spn=" & intTopicPageLoopCounter & """"
		If intTopicPageLoopCounter = intRecordPositionPageNum Then
			Response.Write " selected"
		End If
		Response.Write ">" & intTopicPageLoopCounter & "</option>"
	Next
	Response.Write vbCrLf & "		</select> 页,共 <b>" & intTotalNumOfPages & "</b> 页</span></td>"
End If
%>
<td align="right"><!-- #include file="includes/forumjump.asp" --></td>

  </tr>
 </table>
 </form>
<%
Set rsST = Nothing
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
%>
 <table width="617" border="0" cellspacing="0" cellpadding="1" align="center">
     <tr align="center" class="smText">
      <td width="250"><img src="images/nonew.gif" alt="打开主题 (无新回复)"> 打开主题 (无新回复)</td>
      <td width="220"><img src="images/hotnonew.gif" alt="热门主题 (无新回复)"> 热门主题 (无新回复)</td>
     <td width="220"><img src="images/closedtopic.gif" alt="已锁主题"> 已锁主题</td>
	 <td width="180"><img src="images/firsttop.gif" alt="总置定主题">  总置定主题</td>
	 </tr>
     <tr align="center" class="smText">
      <td width="250"><img src="images/newpost.gif" alt="打开主题 (有新回复)"> 打开主题 (有新回复)</td>
      <td width="220"><img src="images/hotnew.gif" alt="热门主题 (有新回复)"> 热门主题 (有新回复)</td>
     <td width="220"><img src="images/pin.gif" alt="置定主题"> 置定主题</td>
	 <td width="180"><img src="images/lockedtop.gif" alt="被锁置定主题"> 被锁置定主题</td>
	 </tr>
 </table>
 <br />
 <br />
<!-- #include file="includes/footer.asp" -->

⌨️ 快捷键说明

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