<%
set rs = Server.Createobject("ADODB.Recordset")
'頁數設定1
page = 0 + request.querystring("page")
if page = 0 then
page = 1
index = page-1
end if
strsql = "select * from Forum_DISCUSSION where fd_sn>0 "&sqlstr&" order by year(fd_adddate) desc ,month(fd_adddate) desc,day(fd_adddate) desc,hour(fd_adddate) desc,minute(fd_adddate) desc,second(fd_adddate) desc "
rs.open strsql, objDBConn, 3
rs.pagesize = 10
count = rs.RecordCount
pagenum = Fix(count/10)
if count mod 10<>0 then pagenum=pagenum+1 end if
%>
|
討論主題 |
留言人數
|
最新張貼時間
|
<%if session("usersn")="1" then%>
管理
|
<%end if%>
<%
dim bg(1)
bg(1)="#F1DDFF"
bg(0)="#E9BBFF"
if rs.eof=false then
rs.absolutepage = page
index = (page-1) * 10 + 1
for i=1 to rs.pagesize
if rs.EOF = false then
k = i mod 2
if index=0 then index=1 end if
adddate = rs("fd_adddate")
replydate = rs("fd_replydate")
if replydate<>"" then adddate=replydate end if
links = "forum3.asp?sn="&rs("fd_sn")&"&fc_sn="&fc_sn
set rs2 = objDBConn.execute("select count(*) from Forum_REPLY where fr_sn>0 and fd_sn="&rs("fd_sn")&" ")
fr_num=rs2(0)
%>
|
<%=fr_num%> |
<%=adddate%> |
<%if session("usersn")="1" then%>
|
<%end if%>
<%
index = index + 1
else exit for end if
rs.movenext
next
else
%>
|
|
目前無資料 |
<%
end if
set rs = nothing
%>
|
<%
url = request.servervariables("SCRIPT_NAME") & "?"&keystr
listnum = request.querystring("listnum")
if listnum="" then listnum=0 end if
if pagenum>1 then
%>
<%
if listnum>0 and pagenum>10 then
thispage = ((listnum-1)*10)+1
%> <%
end if
%>
|
 |
<%
maxpage = (listnum+1)*10
for j=listnum*10+1 to maxpage
if j>pagenum then exit for end if
if j=page then
%><%=j%> | <%
else
%><%=j%> | <%
end if
%> | <%
next
%><%
if maxpage < pagenum and pagenum>10 then
thispage = ((listnum+1)*10)+1
%> <%
end if%>
|
<%end if%>
|
<%
objDBConn.close
set objDBConn = nothing
%>
|