Untested, and I only changed one line of code, but I
think it should work now
Please note that if you type in "0" in days and like "1000000" in posts, it will probably delete ALL your users - admins included. There is no error checking or usergroup checking! (Although that's pretty simple) If this works, let me know and I'll add the checks!
Code:
if ($action=="joindates") {
echo "<p>Remove by length of membership</p>\n";
echo doformheader("thread","doremovejoindate");
echo "<table border=0>";
echo makeinputcode("Delete accounts older than x days:","joindateremove","");
echo makeinputcode("Number of Posts:","joinpostsremove","");
echo doformfooter("Submit");
exit;
} #end joindates
if ($action=="doremovejoindate") {
echo "<p>Deleting...</p>";
//Bah - screw the checking :)
$datecut=time()-($joindateremove*86400); //<-- the fix
// time() is NOW in unix timestamp, minus for older dates!
if($cuts=$DB_site->query("SELECT username,userid FROM user WHERE (joindate<=$datecut AND posts<=$joinpostsremove)")) {
while($user=$DB_site->fetch_array($cuts)) {
$DB_site->query("DELETE FROM user WHERE userid=$user[userid]");
echo "$user[username] deleted...<BR>";
}
echo "<p>Accounts removed successfully! It is recommend that you <a href=\"misc.php\">update counters</a> now.</p>";
} else {
echo "<p>No Members match this criteria. Click <a href=\"index.php\">here</a> to return to the admin index page.</p>";
}
} #end doremovejoindate