The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL Querry required for Deleting users not active.
Dear All
I need an SQL query to run from phpmyAdmin to remove all the users who are not active since 100 days. I tried from adminCP but looks like it is huge number of spammer and non active users which make my whole site getting slower. So i feel its good to run a query instead of doing it from AdminCP. So if someone know kindly give answer. Thank You in Advance. I have searched from google alot but looks like i am not able to find one |
#3
|
|||
|
|||
Quote:
My forum is readonly so there is no such loss for me, most of my active users are visitors they dont care to make account. Most of accounts are of Bots/Spammer/Spider etc |
#4
|
|||
|
|||
I am not responsible for any damage caused by you following this!
***THIS IS NOT RECOMMENDED FOR USERS WITH POSTS*** I put that disclaimer, but I did test it myself just to be sure In phpMyAdmin, under your vBulletin database, look for the table "user". This shows you all sorts of information, including the "lastactivity". This is based on Unix time, for example on my users table last activity, the first date I see is: 1380060934, which is 9/24/13 5:15:34pm EST You can choose a date that you would like to remove users before, you wanted 100 days ago, which is June 17, 2013 ( Add/subtract Dates Here ) Go here to get the Unix time of a date: http://www.unixtimestamp.com/index.php June 17, 2013 in Unix time is: 1371445200 Now to delete the users before that timestamp should look something like: Code:
DELETE FROM user WHERE lastactivity < '1371445200' If your users may have posts use the below code instead, the above was only for alirex's special case. Code:
DELETE FROM user WHERE lastactivity < '1371445200' AND posts = '0' |
Благодарность от: | ||
alirex |
#5
|
|||
|
|||
Quote:
Thank you , it works without problem. Its really helpfull query specially when alot of spammer need to be remove. From admincp it was easy if number of members are less. But now its good. Thanks once again. |
#6
|
|||
|
|||
I hope you only deleted the members with 0 posts if I was not so busy I could of helped more
|
#7
|
|||
|
|||
Yes as i said above it is read only forum , so guest and registered members are not able to make any post. Only staff can post content rest all are watching it or discussing in shoutbox.
|
#8
|
|||
|
|||
So u deleted members with 0 posts good will be less problems
|
#9
|
|||
|
|||
Quote:
Code:
DELETE FROM user WHERE lastactivity < '1371445200' AND posts = '0' |
#10
|
||||
|
||||
You should really use the prune function, and decrease the number of users you're doing in a single pass. You're not removing all of the user data correctly if you only drop from the user table.
|
Благодарность от: | ||
tbworld |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|