<% Dim width, align, Page_Size, Page_Desc, Repost_Size, PostNo ' 討論區的寬度 最好的範圍為 50-70 width = "60%" ' 頁面對齊方式 align ="center" ' 討論區一頁列出的文章數,必須和討論區文章數對應 Page_Size = 30 ' 回覆文章一頁列出的數量 Repost_Size = 10 Page_Desc = request.querystring("Page_Desc") If Page_Desc = "" Then Page_Desc = "最近回應時間" PageNo = int(request("PageNo")) If PageNo = "" Then PageNo = 1 PostNo = int(request("PostNo")) %> 查看發文內容
<% Dim prePostNo, prePageNo, preTitle, rearPostNo, rearPagNo, rearTitle Dim strSQL, msg, intRecCount, seek_ok ' 開啟使用者資料庫-唯讀 Call OpenDB_Board(20, 3) strSQL = "Select * From Board Order By " & Page_Desc & " DESC" Set Rs = Server.CreateObject("ADODB.Recordset") Rs.Open strSQL, objDBConn, 3, 3, 1 Rs.MoveFirst Rs.PageSize = Page_Size ' 設定每頁的記錄數 intMaxPageCount = Cint(Rs.PageCount) ' 取得目前記錄的頁數 Rs.AbsolutePage = PageNo ' 指定目前的頁數 intRecCount = 0 seek_ok = 1 %>
<% While Not Rs.EOF And intRecCount < Rs.PageSize + 1 And seek_ok Rs.MovePrevious if Not Rs.BOF Then prePostNo = Rs("編號") prePageNo = PageNo preTitle = Rs("主題") if intRecCount = 0 Then prePageNo = prePageNo - 1 end if Rs.MoveNext If Rs("編號") = PostNo Then Rs("瀏覽次數") = Rs("瀏覽次數") + 1 %>
回討論區列表 回覆此主題

<% if Session("UserLV") > 1 or Session("UserID") = Rs("帳號") then %> <% end if %> <% seek_ok = 0 End If Rs.MoveNext if Not Rs.EOF Then rearPostNo = Rs("編號") rearPageNo = PageNo rearTitle = Rs("主題") if intRecCount >= Rs.PageSize Then rearPageNo = rearPageNo + 1 end if intRecCount = intRecCount + 1 Wend If seek_ok Then %>
沒有這篇留言...
<% Else %> <% if preTitle <> "" and prePostNo <> "" Then %> <% End if %> <% if rearPostNo <> PostNo and rearPostNo <> EMPTY Then %> <% End if End If ' 關閉資料庫 Rs.Close %>
討論主題:<% = Rs("主題") %>
發文者:<% = Rs("暱稱") & "(" & Rs("帳號") & ")" %> 發文時間:<% = Rs("發文時間") %>
發文者郵件:"><% =Rs("發文者郵件") %> 發文者IP:<% = Rs("發文者位址") %>

<% =Rs("內容") %>

刪除相關討論文章
▲上一主題:<% =preTitle %>
▼下一主題:<% =rearTitle %>



<% Dim intMaxPageCount, intRepostRecCount, intRepostPageNo strSQL = "Select * From RePost where 回覆編號=" & PostNo & " Order By 時間 DESC" Set Rs = Server.CreateObject("ADODB.Recordset") Rs.Open strSQL, objDBConn, 3, 1, 1 intRepostPageNo = request.querystring("RepostPageNo") If intRepostPageNo = "" Then intRepostPageNo = 1 If Not Rs.EOF Then %> <% Rs.MoveFirst Rs.PageSize = Repost_Size ' 設定每頁的記錄數 intMaxPageCount = Cint(Rs.PageCount) ' 取得目前記錄的頁數 Rs.AbsolutePage = intRepostPageNo ' 指定目前的頁數 intRepostRecCount = 0 %>
相關回應文章
<% If intRepostPageNo-1 > 0 Then %> <% Else %> <% End If If intRepostPageNo+1 <= intMaxPageCount Then %> <% Else %> <% End If %>
    第一頁 上一頁   下一頁 最終頁   第 <% =intRepostPageNo %> 頁 / 共 <% =intMaxPageCount %> 頁
<% While Not Rs.EOF And intRepostRecCount < Rs.PageSize %> <% Rs.MoveNext intRepostRecCount = intRepostRecCount + 1 Wend End IF Rs.Close Call CloseDB_Board %> <% if seek_ok = 0 then %>
回覆者: <% if Rs("回覆者郵件") <> "" Then response.write "" & Rs("暱稱") & "" else response.write Rs("暱稱") end if if Rs("帳號") <> "" then response.write "(" & Rs("帳號") & ")" End if %> <% if Session("UserLV") > 1 or (Session("UserID") <> "" And Session("UserID") = Rs("帳號")) or GetCookie("集亞部品討論區" & Rs("編號"), "") = 1 then %> ">刪除此回覆文章 <% else %>   <% end if %>
回覆時間:<% =Rs("時間") %> 回覆者IP:<% = Rs("回覆者位址") %>

<% =Rs("內容") %>
:')">回覆給 <% =Rs("暱稱") %>
我要回覆
暱 稱: >
E-Mail:
內 文:
    回頂端
<% end if %>