Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases

Reply
 
Thread Tools
Find, Optionally Email and Optionally Delete Inactive Members Details »»
Find, Optionally Email and Optionally Delete Inactive Members
Version: 1.00, by amykhar amykhar is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-15-2003 Last Update: Never Installs: 17
Is in Beta Stage  
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 02-27-2003, 01:33 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Exempt for the email or just the delete?
Reply With Quote
  #43  
Old 02-28-2003, 01:28 AM
hypedave's Avatar
hypedave hypedave is offline
 
Join Date: Nov 2001
Location: Dallas, Tx
Posts: 320
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by amykhar
Exempt for the email or just the delete?
Just the delete I suppose
Reply With Quote
  #44  
Old 02-28-2003, 01:19 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by hypedave


Just the delete I suppose
Here ya go:

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");
Replace with:
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>");
Replace with: (change X to be the number of posts you choose)
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>");
Replace With: (Change X as above)
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>");
}
Reply With Quote
  #45  
Old 03-01-2003, 07:24 AM
Limitter Limitter is offline
 
Join Date: Aug 2002
Location: Germany
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice great hack !!

THX
Reply With Quote
  #46  
Old 03-04-2003, 11:40 AM
afterlab's Avatar
afterlab afterlab is offline
 
Join Date: Oct 2001
Location: Dallas, TX
Posts: 327
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So far, this script is working good. I'll give you an update in 15 days.
Reply With Quote
  #47  
Old 03-05-2003, 02:08 AM
TheEDIGuy TheEDIGuy is offline
 
Join Date: Jul 2002
Location: Buffalo, NY
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #48  
Old 03-05-2003, 02:12 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can run it every day. It won't email them again for another 30 days.

Amy
Reply With Quote
  #49  
Old 03-05-2003, 10:55 AM
TheEDIGuy TheEDIGuy is offline
 
Join Date: Jul 2002
Location: Buffalo, NY
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #50  
Old 03-05-2003, 03:01 PM
Kmaster Kmaster is offline
 
Join Date: Mar 2002
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

possible change del user i/o move to banned group. cool hack....thx!!!
Reply With Quote
  #51  
Old 03-07-2003, 08:38 PM
djr's Avatar
djr djr is offline
 
Join Date: Nov 2001
Location: Amsterdam
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:44 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05345 seconds
  • Memory Usage 2,312KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete