Ok,
I have been working on the remove old members hack but I know I am doing something wrong here.
Here is what I have:
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;
}
if ($action=="doremovejoindate") {
echo "<p>Deleting...</p>";
$datecut=time()+($joindateremove*86400);
$postcut=$DB_site->query("SELECT joindate FROM user WHERE joindate=$datecut");
$postcuts=$postcut[joindate];
if ($joinpostsremove<=2 AND $postcuts=$datecut) {
$DB_site->query("DELETE FROM user WHERE joindate=$datecut");
$DB_site->query("DELETE FROM user WHERE posts<=$joinpostsremove");
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>";
}
}
What I am trying to do is to remove only those members that are the number of days old that you input into the text box and also meet the number of posts requirement.
I set this to <=2 but would like for the script to look at the $joinpostsremove input and work off that.
The above is just where I got to and would like for some of you code warriors to look it over and add anything that you think is necessary so that you can put in correct code to delete members that are over X number of days old and have X number of posts. They should meet both criteria or you get the "No Members match......." message.
Thanks,
Parker
|