% Option Explicit %> <% ' ## ASP Discussion Forum ## ' ## Copyright (C)2001 Bruce Corkhill ## ' ## URL: http://www.webwizguide.com ## 'Set the response buffer to true as we maybe redirecting Response.Buffer = True 'Dimension variables Dim rsMembers 'Holds the Database Recordset for the forum members Dim rsLastPostDate 'Holds the Database Recordset for the users last post Dim strUsername 'Holds the users username Dim strLocation 'Holds the users location Dim strHomepage 'Holds the users homepage if they have one Dim strEmail 'Holds the users e-mail address Dim blnShowEmail 'Boolean set to true if the user wishes there e-mail address to be shown Dim lngUserID 'Holds the new users ID number Dim intNumOfPosts 'Holds the number of posts the user has made Dim dtmRegisteredDate 'Holds the date the usre registered Dim strReturnPage 'Holds the page to return to Dim intTotalNumMembersPages 'Holds the total number of pages Dim intTotalNumMembers 'Holds the total number of forum members Dim intRecordPositionPageNum 'Holds the page number we are on Dim intRecordLoopCounter 'Recordset loop counter Dim dtmLastPostDate 'Holds the date of the users las post Dim intLinkPageNum 'Holds the page number to link to Dim strReturnPageProperties 'Holds the properties of the return page Dim strSearchCriteria 'Holds the search critiria Dim strSortBy 'Holds the way the records are sorted Dim intSortSelectField 'Holds the sort selection to be shown in the sort list box 'Initalise variables blnShowEmail = False strSearchCriteria = "%" 'Get the forum page to return to Select Case Request.QueryString("ReturnPage") Case "Topic" 'Read in the forum and topic to return to strReturnPage = "display_forum_topics.asp" strReturnPageProperties = "?ReturnPage=" & Request.QueryString("ReturnPage") & "&ForumID=" & CInt(Request.QueryString("ForumID")) & "&PagePosition=" & CInt(Request.QueryString("PagePosition")) 'Read in the thread and forum to return to Case "Thread" strReturnPage = "display_topic_threads.asp" strReturnPageProperties = "?ReturnPage=" & Request.QueryString("ReturnPage") & "&ForumID=" & CInt(Request.QueryString("ForumID")) & "&TopicID=" & CLng(Request.QueryString("TopicID")) & "&PagePosition=" & CInt(Request.QueryString("PagePosition")) 'Read in the search to return to Case "Search" strReturnPage = "search.asp" strReturnPageProperties = "?ReturnPage=" & Request.QueryString("ReturnPage") & "&SearchPagePosition=" & Request.QueryString("SearchPagePosition") & "&search=" & Server.URLEncode(Request.QueryString("search")) & "&searchMode=" & Request.QueryString("searchMode") & "&searchIn=" & Request.QueryString("searchIn") & "&forum=" & Request.QueryString("forum") & "&searchSort=" & Request.QueryString("searchSort") 'Else return to the forum main page Case Else strReturnPage = "default.asp" strReturnPageProperties = "?ForumID=0" End Select 'If this is the first time the page is displayed then the members record position is set to page 1 If Request.QueryString("MemPagePosition") = "" Then intRecordPositionPageNum = 1 'Else the page has been displayed before so the members page record postion is set to the Record Position number Else intRecordPositionPageNum = CInt(Request.QueryString("MemPagePosition")) End If 'Get the search critiria for the members to display If NOT Request.QueryString("find") = "" Then strSearchCriteria = Request.QueryString("find") & "%" End If 'Get the sort critiria Select Case Request.QueryString("Sort") Case "post" strSortBy = "No_of_posts DESC" intSortSelectField = 1 Case "latestUsers" strSortBy = "Join_date DESC" intSortSelectField = 2 Case "oldestUsers" strSortBy = "Join_date ASC" intSortSelectField = 3 Case "location" strSortBy = "Location ASC" intSortSelectField = 4 Case Else strSortBy = "Username ASC" intSortSelectField = 0 End Select %>
"
'If we are showing all the forum memebers then display how many members there are
If Request.QueryString("find") = "" Then
Response.Write vbCrLf & " จำนวนสมาชิกปัจจุบันมีทั้งหมด " & intTotalNumMembers & " คน Forum members on " & intTotalNumMembersPages & " pages และขณะนี้อยู่ที่หน้า " & intRecordPositionPageNum 'Else display how many results were fround from the search Else Response.Write vbCrLf & " ค้นหาสมาชิกได้จำนวน " & intTotalNumMembers & " ท่าน" End If Response.Write vbCrLf & " | "
Response.Write vbCrLf & "