<% Set ForumConn = Server.CreateObject("ADODB.Connection") ForumConn.Open ForumDb Set rs = ForumConn.Execute("select * from forum where replyno=0 and dept='" & dept & "' order by -1*indate") CurPage= 0 if Request.QueryString("Page")<>"" then CurPage = cint(Request.QueryString("Page")) if Request.Form("ToPage")<>"" then CurPage = cint(Request.Form("ToPage")) if CurPage <=0 then CurPage = 1 Do While Not RS.EOF Count = Count + 1 RS.MoveNext Loop if Count/15 > (Count\15) then TotalPage=(Count\15)+1 else TotalPage=(Count\15) If RS.EOF AND Count > 0 Then RS.MoveFirst End IF if CurPage > TotalPage then CurPage = TotalPage IF not RS.EOF Then RS.Move (CurPage-1) * 15 End IF '*********************************************************************************** '' Local Functions '*********************************************************************************** sub MkDateFormat(inStr) if isNULL(inStr) then Response.Write "尚未回應" else Response.Write FormatDateTime(inStr,2) end if end sub %> background="../images/oop.gif">


討論區搜尋類別      關鍵字       

<% i=0 ' 每次 15 筆 Do While Not Rs.EOF and i<15 i=i+1 %> <%rs.MoveNext Loop rs.Close Set ForumConn = nothing%>
討論主題 作者 回應/點閱 發表日期 回應日期
"><%=Server.HTMLEncode(Replace(rs("subject"),"''","'"))%> <%=rs("username")%> <%=rs("reply")%>/<%if rs("viewcnt") < 1 Then Response.Write 0 else Response.Write rs("viewcnt")%> <%= FormatDateTime(rs("indate"), 2) %> <% MkDateFormat(rs("replydate")) %>

<%=CurPage%>/<%=TotalPage%> <% if CurPage >= 2 then %> 上一頁<%End If%> | 前往頁 | <% if CurPage < TotalPage then %>下一頁<% end if %>