% Dim strSQL, criteria, searchTerm, orderSC, currpage, searchTop, perPage, totalMem, pages, innerOrder Dim totalQualifiedMem, restrictedWhere dim objRS, arrMemList, iMem, maxShortMsg, criteriaSQL, outerorder, allforum,view,gid,showGroupInfo, showGroupMember Dim allmoderators:allmoderators = "" if not isGuest then criteria = request.queryString("criteria") searchTerm = SQLStrip(trim(request.queryString("searchTerm"))) orderSC = request.queryString("orderSC") currpage = request.queryString("currpage") view = lcase(request.querystring("view")&"") gid = request.querystring("gid")&"" showGroupInfo = false showGroupMember = false if view = "group" then if len(gid)<>0 and isNumeric(gid) then showGroupMember = true end if elseif view="groupinfo" then showGroupInfo = true end if perPage = Application(dbName&"tpg") totalMem = Application(dbName&"totalmem") maxShortMsg = Application(dbName&"maxShortMsg") restrictedWhere = "" allforum = Application(dbName&"foruminfo") if isArray(allforum) then Dim moderatorArray:moderatorArray = ExtractOneDimension(allforum, 11) allmoderators = Join(moderatorArray,",") end if if not IsNumeric(currpage) then currpage = 1 else if cint(currpage)<1 then currpage = 1 else currpage = cint(currpage) end if SELECT Case criteria Case "1" criteriaSQL = "login" Case "2" criteriaSQL = "totalposts" restrictedWhere = "AND totalposts>0" Case "3" criteriaSQL = "datesignup" Case "4" criteriaSQL = "location" restrictedWhere = "AND location<>''" Case else criteriaSQL = "login" End SELECT if criteriaSQL = "login" and searchTerm<>"" then restrictedWhere = "AND login like '"&searchTerm&"%'" end if SELECT CASE orderSC Case "2" outerorder = "DESC" innerorder = "ASC" Case else outerorder = "ASC" innerorder = "DESC" End SELECT 'Get the group lists Dim arrGroups set objRS = server.createobject("adodb.recordset") with objRS .CacheSize = 150 .open dbOwnerPrefix&"spGetGroupListForMemberList("&memID&","&iff(isBMan or isUMan,"1","0")&")", datastore, , , adCmdStoredProc If not (.EOF or .BOF) then arrGroups = .getrows End if .close end with set objRS=nothing Dim allAvailableGroups:allAvailableGroups = iff(isArray(arrGroups),join(extractonedimension(arrGroups,0),","),"-4000") Dim sqlGroupWhere:sqlGroupWhere = "" Dim extraqString:extraqString = "" if showGroupMember then extraqString = "&view=group&gid="&gid Dim sameSQL sameSQL = " AND GM.GID = "&gid&" AND Exists(SELECT GID FROM pgd_usergroup UG with (nolock) WHERE UG.GID=GM.GID"&_ iff(isAdmin,""," AND UG.GID in ("&allAvailableGroups&")")&_ "))" sqlGroupWhere = " AND exists (SELECT mem FROM pgd_groupMember GM with (nolock) WHERE GM.mem = pgd_members.mem"&sameSQL end if ' End Get the group lists Dim strShowHiddenUsers:strShowHiddenUsers = "" if not (isAdmin or Application(dbName&"allowHideProfile") = 0) then strShowHiddenUsers = " and (hideprofile=0 or (hideprofile=1 and mem="&memID&")) " end if if not showGroupInfo then Set objRS = Server.CreateObject("adodb.recordset") with objRS .open "SELECT count(*) FROM pgd_members with (nolock) WHERE Mem>-1 and banned=0 and regstatus=0 "&strShowHiddenUsers&restrictedWhere&sqlGroupWhere, datastore, , , adCmdText totalQualifiedMem = .fields(0).value .close if (totalQualifiedMem mod perPage) <> 0 then pages = (totalQualifiedMem\perPage)+1 else pages = (totalQualifiedMem\perPage) if currpage>pages then currpage = pages if currpage*perPage > totalQualifiedMem then searchTop = totalQualifiedMem - (currpage-1)*perPage else searchTop = perPage end if if currpage < pages/2 then strSQL = "SELECT m.Mem, m.Login, m.dateSignUp, m.Email, m.Homepage, m.emailview, m.location, m.totalposts, m.AcceptShortMsg, m.ICQ, m.Yahoo, m.AOL, m.allowShortMsg, m.customTitle, m.score FROM pgd_members m with (nolock) "&_ "INNER JOIN "&_ "(SELECT TOP "&searchTop&" "&criteriaSQL&", Mem FROM "&_ " (SELECT TOP "&currpage*perPage&" "&criteriaSQL&", Mem FROM pgd_Members with (nolock) WHERE (Banned=0 AND regStatus=0 "&strShowHiddenUsers&restrictedWhere&sqlGroupWhere&") ORDER BY "&criteriaSQL&" "&outerorder&") j "&_ " ORDER BY j."&criteriaSQL&" "&innerOrder&_ ") t "&_ "ON m.Mem = t.Mem "&_ "WHERE (m.Mem>-1 ) "&_ "ORDER BY t."&criteriaSQL&" "&outerorder else Dim specialTop, lastPageNum lastPageNum = totalQualifiedMem - (currpage-1)*perPage if currpage = pages then specialTop = lastPageNum else specialTop = perPage strSQL = "SELECT TOP "&specialTop&" m.Mem, m.Login, m.dateSignUp, m.Email, m.Homepage, m.emailview, m.location, m.totalposts, m.AcceptShortMsg, m.ICQ, m.Yahoo, m.AOL, m.allowShortMsg, m.customTitle, m.score FROM pgd_members m with (nolock) "&_ "INNER JOIN "&_ "(SELECT TOP "&lastPageNum&" "&criteriaSQL&", Mem FROM pgd_Members with (nolock) "&_ " WHERE (Banned=0 AND regStatus=0 "&strShowHiddenUsers&restrictedWhere&sqlGroupWhere&") "&_ " ORDER BY "&criteriaSQL&" "&innerOrder&_ ") t "&_ "ON m.Mem = t.Mem "&_ "WHERE (m.Mem>-1 ) "&_ "ORDER BY t."&criteriaSQL&" "&outerorder end if ' response.write ("") ' response.end .cacheSize = perPage .open strSQL, datastore, , , adCmdText if not .eof or not .bof then _ arrMemList = .getrows .close end with set objRS = nothing end if end if function NullHandler(ByRef str) if isNull(str) or str="" then NullHandler = " " else NullHandler = str end function function underCriteria(criteria, searched, columnName) if lcase(searched)=lcase(criteria) then columnName = ""&columnName&"" underCriteria = columnName end function %>
| <%= RightViolationMessage %> |