View Full Version : Mass Deletion of Users...
is this possible?
So you could delete all users with 0 or 0-3 etc posts...
i really need this..
<?
require("admin/config.php");
if($action=="") {
print("<form action=\"delete.php\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"deleteusers\"><p>Delete users with less than <input type=\"text\" size=\"5\" name=\"numberposts\"> posts.</p><p><input type=\"submit\" value=\"DELETE USERS\"></form>");
}
if($action==deleteusers) {
$query = mysql_query("DELETE from USER where POSTS < '$numberposts'");
print("You have successfully deleted all users with less than $numberposts posts.")
}
?>
Put that into a file called delete.php and stick it in your forums directory. There is no error checking in it or anything like that, but it should do the basic thing you're looking for.
HTH, or at least sets you in the right direction.
-jim
it doesn't work..
i pu it in the /admin directory and changed
require("admin/config.php");
to
require("config.php");
does it matter anything what directory it's in?
Jim, you forgot to connect to MySQL. :)
[code]<?php
require("global.php");
if($action=="") {
print("<form action=\"delete.php\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"deleteusers\"><p>Delete users with less than <input type=\"text\" size=\"5\" name=\"numberposts\"> posts.</p><p><input type=\"submit\" value=\"DELETE USERS\"></form>");
}
if($action==deleteusers) {
$DB_site->query("DELETE FROM user WHERE posts < '$numberposts'");
print("You have successfully deleted all users with less than $numberposts posts.")
}
?>
Originally posted by Ed Sullivan
Jim, you forgot to connect to MySQL. :)
Yeah I realized that - was just coming back to fix.
-jim
can you please post the whole text for delete.php ?!
PLEASE!!!!
this is the code:
<?php
require("global.php");
if($action=="") {
print("<form action=\"delete.php\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"deleteusers\"><p>Delete users with less than <input type=\"text\" size=\"5\" name=\"numberposts\"> posts.</p><p><input type=\"submit\" value=\"DELETE USERS\"></form>");
}
if($action==deleteusers) {
$DB_site->query("DELETE FROM user WHERE posts < '$numberposts'");
print("You have successfully deleted all users with less than $numberposts posts.")
}
?>
i've tried that but it doesn't work~~~~
The quick way:
Just run this query in PHPMyAdmin:
DELETE FROM user WHERE posts < 4
or whatever number of posts you like.
Do you realize that you're now also deleting members who just have registered?
its smarter do it by last time posted ;)
Then you should do it like this:
delete from user WHERE POSTS = 0 AND lastpost<UNIX_TIMESTAMP('2001-02-01')
or any other date in y-m-d format.
Instead of lastpost you could use lastvisit or lastactivity as well to not delete any silent readers.
Originally posted by Fryzid
Then you should do it like this:
delete from user WHERE POSTS = 0 AND lastpost<UNIX_TIMESTAMP('2001-02-01')
or any other date in y-m-d format.
Instead of lastpost you could use lastvisit or lastactivity as well to not delete any silent readers.
how do i do that?? what's phpadvmin?
Originally posted by CGiFORCE
is this possible?
So you could delete all users with 0 or 0-3 etc posts...
i really need this..
i made a fully working hack of this ages ago
http://vbulletin.com/forum/showthread.php?threadid=10108
if you download it jsut put a reply to that thread
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.