Hướng dẫn tạo lập forum đơn giản trên website



tải về 58.03 Kb.
Chuyển đổi dữ liệu30.08.2016
Kích58.03 Kb.





<%
if not bNoRecords then
response.write "
Trang " & iPage & " / " & iTotalPages & "
"
end if
%>




Dien Dan Tin hoc DONGDO

<%
cmd.CommandText = "MESSAGETHREADS"
cmd.CommandType = 4

iPageSize = 20


iPage = cint(Request.QueryString("Page"))
if iPage = 0 then iPage = 1

rs.open cmd, , 1, 3

if not rs.Eof and not rs.bof then
rs.MoveLast
lTotalRecords = rs.RecordCount

iTotalPages = int(lTotalRecords / iPageSize)


if lTotalRecords MOD iPageSize <> 0 then iTotalPages = iTotalPages + 1

if lTotalRecords <= iPageSize then


rs.MoveFirst
bOnePage = true
lPageEnd = lTotalRecords
lPageStart = 1
iTotalPages = 1
else
lPageStart = ((iPage - 1) * iPageSize) + 1
lPageEnd = lPageStart + (iPageSize - 1)

if lPageEnd >= lTotalRecords Then


lPageEnd = lTotalRecords
bLastPage = true
end if

if iPage > 1 then


rs.AbsolutePosition = ((iPage - 1) * iPageSize) + 1
else
rs.MoveFirst
end if
end if
else
bNoRecords = true
end if

%>










<%
if bNoRecords then
response.write ""

else
for lCtr = lPageStart to lPageEnd

response.write "

"
response.write " "

response.write "

"
response.write ""
rs.movenext
Next
end if
response.write "
Chu de Nguoi Gui/Hoi Dap tra lai Thoi gian
There are no messages available at the present time " & rs("Topic") & ""
response.write "" & rs("AuthorName") & ""

response.write "

" & rs("ReplyCount") & "" & rs("LastThreadPost") & "
"

if bOnePage = false and bNoRecords = false then

response.write ""
response.write "
 
 "

if iPage > 1 then


sPrevQuery = "Page=" & iPage - 1
response.write "<< Trang truoc"
else
response.write " "
end if

response.write "

"

if bLastPage = false then

sNextQuery = "Page=" & iPage + 1


response.write "Trang tiep >>"
else
response.write " "
end if
response.write "
 
"
response.write "

"

for iCtr = 1 to iTotalPages


sPageQuery = "Page=" & iCtr & sQuery
if iCtr <> iPage then
response.write ""
else
response.write ""
end if
response.write iCtr

if iCtr <> iPage then


response.write ""
else
response.write "
"
end if
if iCtr < iTotalPages then response.write "  |  "

Next
response.write "

"


end if
%>


Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2016
được sử dụng cho việc quản lý

    Quê hương