📄 admin_select_members.asp
字号:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="admin_common.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<%
'****************************************************************************************
'** Copyright Notice
'**
'** Web Wiz Forums(TM)
'** http://www.webwizforums.com
'**
'** Copyright (C)2001-2008 Web Wiz(TM). All Rights Reserved.
'**
'** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'.
'**
'** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE
'** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'** AND DERIVATIVE WORKS IMMEDIATELY.
'**
'** If you have not received a copy of the license with this work then a copy of the latest
'** license contract can be found at:-
'**
'** http://www.webwizguide.com/license
'**
'** For more information about this software and for licensing information please contact
'** 'Web Wiz' at the address and website below:-
'**
'** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'** http://www.webwizguide.com
'**
'** Removal or modification of this copyright notice will violate the license contract.
'**
'****************************************************************************************
'*************************** SOFTWARE AND CODE MODIFICATIONS ****************************
'**
'** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE
'** AGREEMENT AND IS STRICTLY PROHIBITED
'**
'** If you wish to modify any part of this software a license must be purchased
'**
'****************************************************************************************
'Set the response buffer to true as we maybe redirecting
Response.Buffer = false
'Dimension variables
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 lngNumOfPosts 'Holds the number of posts the user has made
Dim intMemberGroupID 'Holds the users interger group ID
Dim strMemberGroupName 'Holds the umembers group name
Dim intRankStars 'holds the number of rank stars the user holds
Dim dtmRegisteredDate 'Holds the date the usre registered
Dim intTotalRecordsPages 'Holds the total number of pages
Dim intTotalRecords 'Holds the total number of forum members
Dim intRecordPositionPageNum 'Holds the page number we are on
Dim dtmLastPostDate 'Holds the date of the users las post
Dim intLinkPageNum 'Holds the page number to link to
Dim strSearchCriteria 'Holds the search critiria
Dim strSortBy 'Holds the way the records are sorted
Dim intGetGroupID 'Holds the group ID
Dim strRankCustomStars 'Holds custom stars for the user group
Dim sarryMembers 'Holds the getrows db call for members
Dim intPageSize 'Holds the number of memebrs shown per page
Dim intStartPosition 'Holds the start poition for records to be shown
Dim intEndPosition 'Holds the end poition for records to be shown
Dim intCurrentRecord 'Holds the current record position
Dim dtmLastActiveDate 'Holds the date this user was last active
Dim strSortDirection 'Holds the sort order
Dim intPageLinkLoopCounter 'Holds the loop counter for the page links
Dim strUsername 'Holds the users username
Dim strSearchBy
Dim strAuthorEmail
'Initalise variables
blnShowEmail = False
intGetGroupID = CInt(Request.QueryString("GID"))
intPageSize = 25
'If this is the first time the page is displayed then the members record position is set to page 1
If Request.QueryString("PN") = "" 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("PN"))
End If
'Get the what we are searching in email or username
If NOT Request.QueryString("SB") = "" Then
strSearchBy = Trim(Mid(Request.QueryString("SB"), 1, 15))
End If
'Get the search critiria for the members to display
If NOT Request.QueryString("SF") = "" Then
strSearchCriteria = Trim(Mid(Request.QueryString("SF"), 1, 15))
End If
'Get rid of milisous code
strSearchCriteria = formatSQLInput(strSearchCriteria)
'Get the sort critiria
Select Case Request.QueryString("SO")
Case "PT"
strSortBy = strDbTable & "Author.No_of_posts "
Case "LU"
strSortBy = strDbTable & "Author.Join_date "
Case "OU"
strSortBy = strDbTable & "Author.Join_date "
Case "GP"
strSortBy = strDbTable & "Group.Name "
Case "LA"
strSortBy = strDbTable & "Author.Last_visit "
Case "EM"
strSortBy = strDbTable & "Author.Author_email "
Case Else
strSortBy = strDbTable & "Author.Username "
End Select
'Sort the direction of db results
If Request.QueryString("OB") = "desc" Then
strSortDirection = "asc"
strSortBy = strSortBy & "DESC"
Else
strSortDirection = "desc"
strSortBy = strSortBy & "ASC"
End If
'Read in from db
If intGroupID <> 2 Then
'If this is to show a group the query the database for the members of the group
If intGetGroupID <> 0 Then
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Group_ID, " & strDbTable & "Author.Last_visit, " & strDbTable & "Author.No_of_posts, " & strDbTable & "Author.Join_date, " & strDbTable & "Author.Active, " & strDbTable & "Group.Name, " & strDbTable & "Group.Stars, " & strDbTable & "Group.Custom_stars, " & strDbTable & "Author.Author_email " & _
"FROM " & strDbTable & "Author" & strDBNoLock & ", " & strDbTable & "Group" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Author.Group_ID = " & strDbTable & "Group.Group_ID AND " & strDbTable & "Author.Group_ID =" & intGetGroupID & " " & _
"ORDER BY " & strSortBy & ";"
'Else get all the members from the database
Else
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Group_ID, " & strDbTable & "Author.Last_visit, " & strDbTable & "Author.No_of_posts, " & strDbTable & "Author.Join_date, " & strDbTable & "Author.Active, " & strDbTable & "Group.Name, " & strDbTable & "Group.Stars, " & strDbTable & "Group.Custom_stars, " & strDbTable & "Author.Author_email " & _
"FROM " & strDbTable & "Author " & strDBNoLock & ", " & strDbTable & "Group " & strDBNoLock & " " & _
"WHERE " & strDbTable & "Author.Group_ID = " & strDbTable & "Group.Group_ID "
If strSearchBy = "email" Then
strSQL = strSQL & "AND " & strDbTable & "Author.Author_email LIKE '%" & strSearchCriteria & "%' "
Else
strSQL = strSQL & "AND " & strDbTable & "Author.Username LIKE '" & strSearchCriteria & "%' "
End If
strSQL = strSQL & "ORDER BY " & strSortBy & ";"
End If
'Query the database
rsCommon.Open strSQL, adoCon
'If there are records get em from rs
If NOT rsCommon.EOF Then
'Read in the row from the db using getrows for better performance
sarryMembers = rsCommon.GetRows()
'Count the number of records
intTotalRecords = Ubound(sarryMembers,2) + 1
'Count the number of pages for the topics using '\' so that any fraction is omitted
intTotalRecordsPages = intTotalRecords \ intPageSize
'If there is a remainder or the result is 0 then add 1 to the total num of pages
If intTotalRecords Mod intPageSize > 0 OR intTotalRecordsPages = 0 Then intTotalRecordsPages = intTotalRecordsPages + 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -