<% if request.form <> "" then Dim mode, strSQL, objRS, objCon, allData, hasSearch dim firstCheck dim firstBox dim secondCheck dim secondBox dim thirdCheck dim thirdBox dim fourthCheck mode = request.queryString("mode") strSQL = _ "SELECT top 50 P.Mem, login, totalposts, (SELECT count(messageID) FROM pgd_messages m WHERE parent=0 and P.Mem = m.Mem) as Threads, "&_ "(SELECT count(messageID) FROM pgd_messages n WHERE parent >0 and P.Mem = n.Mem) as Replies, lastLogin, dateSignUp, banned, "&_ "(SELECT max(dateCreated) FROM pgd_messages K WHERE P.Mem = K.Mem) as LastPost " &_ "FROM pgd_members P WHERE P.mem > 0 " SELECT Case mode Case "1" firstCheck = request.form("1_r_c") firstBox = ""&request.form("1_r_t") secondCheck = request.form("1_b_c") hasSearch = false strSQL = strSQL & "AND totalposts = 0 " if firstCheck = "on" and firstBox <> "" and isNumeric(firstBox) then strSQL = strSQL & "AND regStatus > 0 AND dateSignUp < DateADD (dd, "&-Clng(firstBox)&", GetDate())" hasSearch = true end if if secondCheck = "on" then strSQL = strSQL & "AND banned=1 " hasSearch = true else strSQL = strSQL & "AND banned=0 " hasSearch = true end if if hasSearch = false then response.redirect ("admin_u_delete.asp") response.end end if Case "2" firstCheck = request.form("2_p_c") firstBox = ""&request.form("2_p_t") secondCheck = request.form("2_l_c") secondBox = ""&request.form("2_l_t") thirdCheck = request.form("2_s_c") thirdBox = ""&request.form("2_s_t") fourthCheck = request.form("2_b_c") hasSearch = false 'strSQL = strSQL & "AND totalposts > 0 " if firstCheck = "on" and firstBox <> "" and isNumeric(firstBox) then strSQL = strSQL & "AND (SELECT max(dateCreated) FROM pgd_messages S WHERE P.Mem = S.Mem) < DateADD (dd, "&-Clng(firstBox)&", GetDate()) " hasSearch = true end if if secondCheck = "on" and secondBox <> "" and isNumeric(secondBox) then strSQL = strSQL & "AND lastLogin < DateADD (dd, "&-Clng(secondBox)&", GetDate())" hasSearch = true end if if thirdCheck = "on" and thirdBox <> "" and isNumeric(thirdBox) then strSQL = strSQL & "AND totalposts < "&Clng(thirdBox)&" " hasSearch = true end if if fourthCheck = "on" then strSQL = strSQL & "AND banned=1 " hasSearch = true else strSQL = strSQL & "AND banned=0 " hasSearch = true end if if hasSearch = false then response.redirect ("admin_u_delete.asp") response.end end if Case "3" dim delName:delName = SQLStrip(trim(""&request.form("3_n"))) if delName = "" then response.redirect ("admin_u_delete.asp") response.end end if strSQL = strSQL & "AND login='"&delName&"' " END SELECT ' response.write(strSQL) ' response.end set objRS = server.createobject("adodb.recordset") with objRS .CacheSize = 50 .open strSQL, datastore, , , adCmdText If not (.EOF or .BOF) then allData = .getrows Else response.redirect ("admin_u_delete.asp?done=no") End if .close end with set objRS=nothing dim i, memIDs %> Delete User Options <%= OutputCSS() %>
User Delete Options :       Help

> <% for i = 0 to ubound(allData,2) %> > <% memIDs = memIDs & allData (0,i) &","%> <% next %>
Analysis Results
  Member ID Login Total posts Threads Replies Last Login Sign-up date banned? (1=yes, 0=no) Last post on
<%= i+1 %> <%= allData (0,i) %> <%= HTMLEncode(""&allData (1,i)) %> <%= allData (2,i) %> <%= allData (3,i) %> <%= allData (4,i) %> <%= allData (5,i) %> <%= allData (6,i) %> <%= allData (7,i) %> <%= allData (8,i) %>


"> Keep their messages

 

<% response.end end if %> Delete User Options <%= OutputCSS() %>
User Delete Options :       Help

<% if request.querystring("done") = "no" then response.write("No member matches your criteria!
") %> <% if request.querystring("done") = "yes" then response.write("Members deleted successfully!
") %>
> > >
Option 1: Delete space-wasting users (w/o posts, banned, haven't registered, 50 users at once)
>Delete users who:
> haven't passed registration requirements for days
> have been banned

> > > > >
Option 2: Delete lurking Users (50 users at once)
>Delete users who:
> haven't posted for days
> haven't logged in for days
> have less than posts
> have been banned

>
Option 3: Delete a specific user
>Delete this user named " size="30" maxlength="50">