Quote:
Originally posted by djr
Hi Amy,
It's me again.. in a few days (Tuesday, 11th of March) I'll be losing approx. 1750 users They are inactive for over a year (my setting), I know, but is it possible to adjust the hack so they will be getting one last e-mail warning a day before the actual pruning?
Thanks for considering and the great updates!
@ hypedave: nice idea, updated the hack!
- djr
|
Here is how I would do it.
1. Create a new usergroup for those who are about to be deleted. Note the usergroupid.
2. In manageInactive.php Find:
Add above:
Code:
//Final Warning
$finalWarning = time() - 1036800;
$finalArray=$DB_site->query("SELECT username,userid,usergroupid,email,adminemail,emailDate FROM user WHERE lastactivity<$cutoffdate and emailDate<$finalWarning ORDER BY username");
while ($users=$DB_site->fetch_array($finalArray)) {
if ($emailInactive AND $user[adminemail] AND $user[usergroupid]!=X ){
eval("\$subject = \"".gettemplate("inactiveFinalWarningSubject")."\";");
eval("\$message = \"".gettemplate("inactiveFinalMessage")."\";");
mail ($user[email],$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
$DB_site->query("UPDATE user set usergroupid=X WHERE userid='$user[userid]'");
echo("Emailed ". $user[username]."<br>");
}
(Change X in both places to the new usergroupid that you just created.)
3. Create two new templates:inactiveFinalWarningSubject and inactiveFinalMessage. Put whatever message and subject you choose in them.
Please note: THIS ADDON IS UNTESTED.