% Response.buffer = True %>
![]() |
messageboards |
<%if Session("admin")="Yes" Then %> [ Logout ] <% End If %>
|
|
|
<%
Set RS = Server.CreateObject("ADODB.Recordset")
MySql="SELECT Count(*) AS MessageTot FROM messages"
Rs.Open MySql, my_conn
MessageTot=rs("MessageTot")
rs.close
%>
Forum contains <%=MessageTot%> messages:
<% Rem Now extract the message list from the database and thread messages%>
<%
'MySql="SELECT messages.* FROM threads INNER JOIN messages ON threads.ThreadID = messages.threadID ORDER BY messages.threadID DESC, messages.MessageID;"
MySql="SELECT messages.* FROM messages ORDER BY messages.threadID DESC, messages.MessageID;"
RS.cursorlocation=aduseclient
RS.Open MySql, my_Conn, adOpenStatic, adLockReadOnly, adCmdText
If Request.QueryString("page") = "" Then
iCurrentPage = 1
Else
iCurrentPage = CInt(Request.QueryString("page"))
End If
RS.PageSize = postsperpage
If RS.PageCount > 0 then
RS.AbsolutePage = iCurrentPage
Else
iCurrentPage = 0
End If
Session("CurrentPage") = iCurrentPage
indents=0
do while RS.AbsolutePage = iCurrentPage And Not RS.EOF
dim tt
tt = rs("messageID")
For n = 1 to len(tt)
if mid(tt, n, 1) = "." Then
indents = indents + 1
End If
next
Response.write ""
For n= 1 to indents
Response.write " "
Next
lpDate=RS("Posted")
If DateDiff("d",lpDate , DATE) < DAYflag then
lastpostday=weekday(lpDate)
pTime = formatdatetime(lpDate, 4)
lpDate =pweekday(lastpostday) & " " & pTime
End If
Response.write "
<%
If RS.PageCount > 1 then
'Print Previous Page if required
If iCurrentPage <> 1 then
Response.Write "Previous Page"
Else
Response.Write "Previous Page"
End If
'Print direct access page numbers.
For intCount = 1 to RS.PageCount
If intCount = 1 then
Response.Write " | "
End If
If intCount = iCurrentPage then
Response.Write "" & intCount & " | "
Else
Response.Write "" & intCount & " | "
End If
Next
'Print Next Page if required
If iCurrentPage <> RS.PageCount then
Response.Write "Next Page"
Else
Response.Write "Next Page"
End If
End If
Response.Write " <% Rem Not draw the form where new messages can be entered:%> <% TypeofPost="New" PrevID="" my_conn.close %> |
|||
|
steveoliver.co.uk |
|||