Best Nokkers HallHelpForumStoreNews

Email us here:

 

 

<% ' Function treeMessage_Build() goes through the messages recursively, ' and shows all messages in a tree-like structure. ' This is the basis of the "threaded" discussion that is ' unique to this script. Public Sub treeMessage_Build(MessageID, Level) Dim rsUsers,userEmail,rsMessages 'Response.write("begin-userGroup-MESSAGE_ID="&Level&" time="&Now&"
") 'Response.write("before="&Now&"
") Set rsMessages = DB.Execute ("SELECT * FROM USERGROUP ORDER BY message_date DESC ") rsMessages.Filter = "MESSAGE_ID = '" & MessageID & "'" Set rsUsers = DB.Execute ("SELECT Email FROM USERS WHERE USER_ID = '"&rsMessages("USER_ID")&"'") 'Response.write("after="&Now&"
") If Not (rsUsers.EOF And rsUsers.BOF) Then rsUsers.MoveFirst userEmail = rsUsers ("Email") else userEmail = "#" end if if Level>0 then 'reply %>
<%'=now%> &u_id=<%= trim(Request("u_id"))%>&password=<%= Request("password")%>"><%= rsMessages ("Subject") %><%= rsMessages ("USER_ID") %>, <%= ShortDate(rsMessages ("message_Date")) %>
<%else%>
<%'=now%> &u_id=<%= trim(Request("u_id"))%>&password=<%= Request("password")%>"><%= rsMessages ("Subject") %>, <%= rsMessages ("USER_ID") %>, <%= ShortDate(rsMessages ("message_Date")) %>
<% end if rsMessages.Filter = "InReplyTo = '" & MessageID & "'" If Not (rsMessages.EOF And rsMessages.BOF) Then rsMessages.MoveFirst While Not rsMessages.EOF treeMessage_Build rsMessages("Message_ID"), Level+1 rsMessages.MoveNext Wend End If End Sub %> <% '''''''''''''''''''''''''' MAIN ''''''''''''''''''''''''''''''''''''''''' Dim DB,rsThreads,iPageSize,iPageCount,iPageCurrent,I,iRecordsShown,rsMessages Set DB = Connect iPageSize = 5 'Set rsForum = DB.Execute ("SELECT * FROM Forums WHERE ForumID = " & ForumID) 'Set rsMessages = DB.Execute ("SELECT * FROM Messages WHERE ForumID = " & ForumID & " ORDER BY Date DESC") 'Set rsThreads = DB.Execute ("SELECT * FROM Messages WHERE ForumID = " & ForumID & " AND InReplyTo = 0 ORDER BY Date DESC") 'Response.write("begin="&now) 'Set rsMessages = DB.Execute ("SELECT * FROM USERGROUP ") Set rsThreads = Server.CreateObject ("ADODB.Recordset") rsThreads.PageSize = iPageSize rsThreads.Open "SELECT MESSAGE_ID FROM USERGROUP WHERE InReplyTo = '0' AND UG_LANGUAGE='ENGLISH' ORDER BY message_date DESC ", DB, adOpenStatic, adLockReadOnly'adOpenDynamic, adLockOptimistic ' Get the count of the pages using the given page size iPageCount = rsThreads.PageCount+0 iPageCurrent = Request("pageNo")+0 ' If the request page falls outside the acceptable range, ' give them the closest match (1 or max) If iPageCurrent > iPageCount Then iPageCurrent = iPageCount end if If iPageCurrent < 1 Then iPageCurrent = 1 end if If rsThreads.BOF And rsThreads.EOF Then ShowError ("

There are no messages in this forum.

") %>

You should Post a New Message

&password=<%= Request("password")%>">Post a Message

<% Else rsThreads.MoveFirst %>
Add new message here
&password=<%= Request("password")%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','Images/Forum_Images/Add_over.gif',1)">
<% ' Loop through our records and ouput 1 row per record rsThreads.AbsolutePage = iPageCurrent iRecordsShown = 0 'Loop controller for displaying just iPageSize records Do While iRecordsShown < iPageSize And Not rsThreads.EOF 'Response.write(" message="&iRecordsShown&" now="&Now) treeMessage_Build rsThreads("MESSAGE_ID"), 0 iRecordsShown = iRecordsShown + 1 rsThreads.MoveNext Loop rsThreads.Close Set rsThreads = nothing %>
Go to page <% ' Show "previous" and "next" page links which pass the page to view ' and any parameters needed to rebuild the query. You could just as ' easily use a form but you'll need to change the lines that read ' the info back in at the top of the script. If iPageCurrent > 1 Then %> &password=<%= Request("password")%>">[<< Prev] <% End If ' You can also show page numbers: For I = 1 To iPageCount If I = iPageCurrent Then %> <%= I %> <% Else %> &password=<%= Request("password")%>"><%= I %> <% End If Next 'I If iPageCurrent < iPageCount Then %> &password=<%= Request("password")%>">[Next >>] <% End If End if %>