<% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide ASP Discussion Forum '** '** Copyright 2001 Bruce Corkhill All Rights Reserved. '** '** This program is free software; you can redistribute it and/or modify '** it under the terms of the GNU General Public License as published by '** the Free Software Foundation; either version 2 of the License, or '** any later version. '** '** All copyright notices must remain intacked in the scripts and the '** outputted HTML. '** '** You may not pass the whole or any part of this application off as your own work. '** '** All links to Web Wiz Guide must remain in place and the powered by '** logo with link back to Web Wiz Guide must remain visiable when the pages '** are viewed. '** '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '** GNU General Public License for more details. '** '** You should have received a copy of the GNU General Public License '** along with this program; if not, write to the Free Software '** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA '** '** '** No official support is available for this program but you may post support questions at: - '** http://www.webwizguide.info/forum '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** info@webwizguide.com '** '** or at: - '** '** Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom '**************************************************************************************** '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 %> Forum Members List

<% = strTxtForumMembersList %>

<% = strTxtReturnToDiscussionForum %>

<% = strTxtMemberSearch %>: "> "> "> "> "> "> "> "> "> ">
<% = strTxtAll %> A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
<% 'If the user has not logged in dispaly an error message If lngLoggedInUserID = 0 Then Response.Write vbCrLf & "" & strTxtMustBeRegistered & "

" Response.Write vbCrLf & "  " 'If the user has logged in then read in the members from the database and dispaly them Else 'Intialise the ADO recordset object Set rsMembers = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database strSQL = "SELECT tblAuthor.* " strSQL = strSQL & "FROM tblAuthor " strSQL = strSQL & "WHERE ((([tblAuthor].[Username]) Like '" & strSearchCriteria & "')) " strSQL = strSQL & "ORDER BY tblAuthor." & strSortBy & ";" 'Set the cursor type property of the record set to dynamic so we can naviagate through the record set rsMembers.CursorType = 1 'Query the database rsMembers.Open strSQL, strCon 'Set the number of records to display on each page rsMembers.PageSize = 20 'If there are no memebers to display then show an error message If rsMembers.EOF Then Response.Write "Sorry, your search found no forum members that match your criteria" 'If there is a recorset returned by the query then read in the details Else 'Set the page number to display records for rsMembers.AbsolutePage = intRecordPositionPageNum 'Count the number of members there are in the database by returning the number of records in the recordset intTotalNumMembers = rsMembers.RecordCount 'Count the number of pages there are in the database calculated by the PageSize attribute set above intTotalNumMembersPages = rsMembers.PageCount 'Display the HTML for the total number of pages and total number of records in the database for the users Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & "
" 'If we are showing all the forum memebers then display how many members there are If Request.QueryString("find") = "" Then Response.Write vbCrLf & " " & strTxtThereAre & " " & intTotalNumMembers & " " & strTxtForumMembersOn & " " & intTotalNumMembersPages & " " & strTxtPageYouAerOnPage & " " & intRecordPositionPageNum 'Else display how many results were fround from the search Else Response.Write vbCrLf & " " & strTxtYourSearchMembersFound & " " & intTotalNumMembers & " " & strTxtMatches End If Response.Write vbCrLf & "
" Response.Write vbCrLf & "
" %>
<% = strTxtSortResultsBy %>
<% 'Intialise the ADO recordset object for last post date Set rsLastPostDate = Server.CreateObject("ADODB.Recordset") 'For....Next Loop to loop through the recorset to display the forum members For intRecordLoopCounter = 1 to 20 'If there are no member's records left to display then exit loop If rsMembers.EOF Then Exit For 'Initialise varibles dtmLastPostDate = "" 'Read in the profile from the recordset lngUserID = CLng(rsMembers("Author_ID")) strUsername = rsMembers("Username") strEmail = rsMembers("Author_email") blnShowEmail = CBool(rsMembers("Show_email")) strHomepage = rsMembers("Homepage") strLocation = rsMembers("Location") intNumOfPosts = CInt(rsMembers("No_of_posts")) dtmRegisteredDate = CDate(rsMembers("Join_date")) 'Initalise the strSQL variable with an SQL statement to query the database strSQL = "SELECT tblThread.Message_date, tblThread.Author_ID " strSQL = strSQL & "FROM tblThread " strSQL = strSQL & "WHERE tblThread.Author_ID = " & lngUserID & " " strSQL = strSQL & "ORDER BY tblThread.Message_date DESC;" 'Query the database rsLastPostDate.Open strSQL, strCon 'Read in the date of the last post If NOT rsLastPostDate.EOF Then dtmLastPostDate = CDate(rsLastPostDate("Message_date")) 'Write the HTML of the Topic descriptions as hyperlinks to the Topic details and message %> <% 'Move to the next record in the database rsMembers.MoveNext 'Close the post date recordset rsLastPostDate.Close 'Loop back round Next End If %>
  <% = strTxtUsername %> <% = strTxtPosts %> <% = strTxtLastPost %> <% = strTxtRegistered %> <% = strTxtLocation %> <% = strTxtSearch %>
<% If NOT strHomepage = "" Then Response.Write "" %> <% If NOT strEmail = "" AND (blnShowEmail = True OR lngLoggedInUserID = 1) Then Response.Write " " %> <% If strHomepage = "" AND strEmail = "" AND (blnShowEmail = False OR lngLoggedInUserID > 1) Then Response.Write " " %> <% = strUsername %> <% = intNumOfPosts %> <% If dtmLastPostDate = "" Then Response.Write " " Else Response.Write DateFormat(dtmLastPostDate) End If %> <% = DateFormat(dtmRegisteredDate) %> <% If strLocation = "" Then Response.Write " " Else Response.Write strLocation End If %> <% If Request.QueryString("ReturnPage") = "Search" Then %>Search for other posts by <% = strUsername %><% Else %><% = strTxtSearchForPosts %> <% = strUsername %><% End If %>
<% 'If there is more than 1 page of members then dispaly drop down list to the other members If intTotalNumMembersPages > 1 Then 'Display an drop down list to the other members in list Response.Write vbCrLf & " " End If %>
" & strTxtPage & " " Response.Write vbCrLf & "
<% 'Reset Server Variables rsMembers.Close Set rsMembers = Nothing Set rsLastPostDate = Nothing End If 'Reset Server Objects Set adoCon = Nothing Set strCon = Nothing %>

<% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If blnLCode = "True" Then If blnTextLinks = "True" Then Response.Write("Powered by: - Web Wiz Guide Discussion Forums") Else Response.Write("
") End If End If '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** %>