The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Find, Optionally Email and Optionally Delete Inactive Members Details »» | |||||||||||||||||||||||||||
Find, Optionally Email and Optionally Delete Inactive Members
Developer Last Online: Nov 2013
This hack is designed to allow you to:
a) Find users who have not logged in to your board in X days. X is configurable by you in the control panel. b) Email the inactive users. When the email is set, the date is recorded so that you will not email them again within X days c) Delete the inactive users. This can happen in two ways: 1) If you don't have email users set, it will simply delete users who have not logged in to your forums in the past X days. 2) If you have emails turned on, it will delete users who have not logged in during the past X days AND who were sent the warning email more than 15 days before. The email is a template configurable by you. Here is how this hack will behave: If you have email on and delete off, it will email inactive users every X days. If you have email on and delete on, it will email a warning then delete 15 days later. If you have emails off and delete on, it will delete users who have been incactive for X days. If you have email off and delete off, it will list the inactive users for you in a very crude plain text list. This is not a hack for newbies. If you don't know how to run Queries, don't touch this hack. It is still In Beta. If I get bored and ambitious, I will write an install script and make it idiot-proof. Screen Shots to Follow I will Support this hack for users with some hacking experience. I will fix bugs. I will not teach hacking basics though. !Important - After You Install the hack, go to your Control Panel and Set the Options! Otherwise it will NOT work. Show Your Support
|
Comments |
#42
|
||||
|
||||
Exempt for the email or just the delete?
|
#43
|
||||
|
||||
Quote:
|
#44
|
||||
|
||||
Quote:
in manageInactive.php Find: Code:
$userArray=$DB_site->query("SELECT username,userid,email,adminemail,emailDate FROM user WHERE lastactivity<$cutoffdate and emailDate<$dateCut ORDER BY username"); Code:
$userArray=$DB_site->query("SELECT username,userid,email,posts,adminemail,emailDate FROM user WHERE lastactivity<$cutoffdate and emailDate<$dateCut ORDER BY username"); Find: Code:
// We are just going to delete the inactive users with no warning $DB_site->query("UPDATE post SET username='".addslashes($user[username])."',userid=0 WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM user WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM userfield WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM access WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM calendar_events WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM customavatar WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM moderator WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM privatemessage WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM subscribeforum WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM subscribethread WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM session WHERE userid='$user[userid]'"); $countDelete++; $inactiveUsersDeleted .=$user[username]."\n"; echo("Deleted ". $user[username]."<br>"); Code:
if($user[posts] < X) { // We are just going to delete the inactive users with no warning $DB_site->query("UPDATE post SET username='".addslashes($user[username])."',userid=0 WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM user WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM userfield WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM access WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM calendar_events WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM customavatar WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM moderator WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM privatemessage WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM subscribeforum WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM subscribethread WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM session WHERE userid='$user[userid]'"); $countDelete++; $inactiveUsersDeleted .=$user[username]."\n"; echo("Deleted ". $user[username]."<br>"); } Find: Code:
if($user[emailDate]<$dateCut) { $DB_site->query("UPDATE post SET username='".addslashes($user[username])."',userid=0 WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM user WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM userfield WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM access WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM calendar_events WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM customavatar WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM moderator WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM privatemessage WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM subscribeforum WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM subscribethread WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM session WHERE userid='$user[userid]'"); $countDelete++; $inactiveUsersDeleted .=$user[username]."\n"; echo("Deleted ". $user[username]."<br>"); Code:
if ($user[posts] < X) { if($user[emailDate]<$dateCut) { $DB_site->query("UPDATE post SET username='".addslashes($user[username])."',userid=0 WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM user WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM userfield WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM access WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM calendar_events WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM customavatar WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM moderator WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM privatemessage WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM subscribeforum WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM subscribethread WHERE userid='$user[userid]'"); $DB_site->query("DELETE FROM session WHERE userid='$user[userid]'"); $countDelete++; $inactiveUsersDeleted .=$user[username]."\n"; echo("Deleted ". $user[username]."<br>"); } |
#45
|
|||
|
|||
Nice great hack !!
THX |
#46
|
||||
|
||||
So far, this script is working good. I'll give you an update in 15 days.
|
#47
|
|||
|
|||
Amykhar, thank you for a great hack! I'm installed.
One quick question, before I cron this. Let's say I want to e-mail users who haven't visited in 30 days. Would I cron this to run every 30 days, or is it safe to run every day? If I run it every day, would it re-email the same people again, or would it only e-mail people who've reached their 30 days since the last run? Does that make any sense, or is it just too late at night for me to type coherently? |
#48
|
||||
|
||||
You can run it every day. It won't email them again for another 30 days.
Amy |
#49
|
|||
|
|||
Excellent. I was pretty sure that's how it worked, but wanted to make sure before I cron'ed it.
Thank you for an excellent hack! |
#50
|
|||
|
|||
possible change del user i/o move to banned group. cool hack....thx!!!
|
#51
|
||||
|
||||
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 |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|