Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

 
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-17-2000 Last Update: Never Installs: 0
 
No support by the author.

Mass Delete old users/Mass Email inactive users.

I would like a way to do the above. Perhaps a way to email all users that havent visited in x days, and tell them to do so. If they do not send another email x days later to tell them they will need to visit in x days or acct will be deleted then in x days delete it.

Just a thought. I know I have a lot of users that sign up and forget to come back lol.

For example say once every ten days you clean up your board. First time you email all people that have not posted in say 30 days. 10 Days later you email everyone that hasnt visited in 40 days telling them that if they still wish to be a member to log in (send url) then ten days later purge who ever hasnt logged in after second email.

See what I mean?

-Brian

Show Your Support

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

Comments
  #12  
Old 08-01-2000, 05:14 AM
Guest
 
Posts: n/a
Default

Ed:

A couple of things:

Shouldn't it be:

(joindate>=$datecut AND posts<=$joinpostsremove)

instead of:

(joindate<=$datecut AND posts<=$joinpostsremove)

if you are trying to remove those memberships that are older than the number of days that your wanting to take out?

I noticed that the } else { line doesn't work. If it takes out memberships it lists them like it should but if it doesn't find anything that matches the criteria it should give you the "No Members match....." line and it doesn't.

Also, the reason that I asked about the time stamp thing
is because my own joindate is listed as 867992400. I have been on our forum for 1122 days. If you multiply this by
the 86,400 you get 96940800. Shouldn't these be the same?

Don't you just love it when a newbie asks all kinds of questions like this?

Thanks,
Parker
Reply With Quote
  #13  
Old 08-02-2000, 12:41 AM
Guest
 
Posts: n/a
Default

Quote:
Shouldn't it be:

(joindate>=$datecut AND posts<=$joinpostsremove)

instead of:

(joindate<=$datecut AND posts<=$joinpostsremove)
No, the newer the registration, the larger the number. (Which, I just realized makes some code invalid. I'll get to that later)

Quote:
Also, the reason that I asked about the time stamp thing
is because my own joindate is listed as 867992400. I have been on our forum for 1122 days. If you multiply this by
the 86,400 you get 96940800. Shouldn't these be the same?
That timestamp is seconds from Jan 1, 1970, not how long it's on the board.

I did the math, but now that I look at it, it didn't generate that number. I think my unix timestamp info may be wrong. I guess it's not 1970.

Just trust me with what I'm saying here

Now, next post will update the code a little...
Reply With Quote
  #14  
Old 08-02-2000, 12:45 AM
Guest
 
Posts: n/a
Default

Actually, I just made a mistake in my math, so now it works (forgot to subtract 1122)

(365 * 30) + 212 - 1122 = 10040 days since Jan 1, 1970

10,040 * 86,400 = 867456000 seconds since Jan 1, 1970

867456000
867992400

The small difference is because I didn't take into account for leap years.

Ok, did that - not NEXT post will update code.
Reply With Quote
  #15  
Old 08-02-2000, 12:53 AM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #16  
Old 08-02-2000, 04:16 AM
Guest
 
Posts: n/a
Default

Ed:

I really appreciate all your hard work but it isn't working right.

I signed up today and it took me out because I had zero messages. And I set the number of days as 730 and the message count as zero.

Parker
Reply With Quote
  #17  
Old 08-02-2000, 04:22 AM
Guest
 
Posts: n/a
Default

Hmm... lemme go play around with this on my test board.
Reply With Quote
  #18  
Old 08-02-2000, 04:29 AM
Guest
 
Posts: n/a
Default

Ed:

Never mind. It worked. It took me out because I didn't have a sign up date.

Ok this working now how about those checks that you were talking about. Or is it a humbug?

Parker
Reply With Quote
  #19  
Old 08-02-2000, 05:00 AM
Guest
 
Posts: n/a
Default

Ok,

This is what I have so far.

In admin/index.php look for:

<p><b>Threads</b><br>
<a href="thread.php?action=prune">Prune</a><br>
<a href="thread.php?action=move">Move</a><br>

and below this add:

<a href="thread.php?action=remove">Remove</a><br>
<a href="thread.php?action=joindates">Join Date</a></p>

Then in thread.php

look for:

Code:
// ###################### Start move by user selected #######################
if ($action=="domoveuser") {
  echo "<p>Deleting...</p>";

  while (list($key,$val)=each($movethread)) {
    if ($val==1) {
      $DB_site->query("UPDATE thread SET forumid=$destforumid WHERE threadid=$key");
    }
  }

  echo "<p>Posts moved successfully! It is recommend that you <a href=\"misc.php\">update counters</a> now.</p>";
}
and below this put.

Code:
// ###################### Start Remove by Account Date #######################

  if ($action=="remove") {

  echo "<p>Remove members by number of posts</p>\n";
  echo doformheader("thread","doremoveposts");
  echo "<table border=0>";
  echo makeinputcode("Delete member by number of posts :","postsremove","");
  echo doformfooter("Submit");
  
  exit;

}
  
if ($action=="doremoveposts") {

  echo "<p>Deleting...</p>";
  
  if ($postsremove==0) {
  $DB_site->query("DELETE FROM user WHERE posts=0");
  } 
  elseif ($postsremove>=1) {
  $DB_site->query("DELETE FROM user WHERE posts<=$postsremove");
  }


 echo "<p>Posts deleted successfully! It is recommend that you <a href=\"misc.php\">update counters</a> now.</p>";
}

// ###################### Start Remove by Join Date #######################
 
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>";

$datecut=time()-($joindateremove*86400); 
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
This will delete the member by the number of posts or by the time they have been a member and the number of posts they have.

Be sure to back up your original files before using this. I am really new at this stuff and I would use any of this with caution. It worked ok on my test board.

Ed:

If there is anything that you think should be added please feel free to add what you think is necessary.

Parker


[Edited by Parker Clack on 08-02-2000 at 02:02 AM]
Reply With Quote
  #20  
Old 01-06-2001, 11:09 PM
Guest
 
Posts: n/a
Default

Can you add a control panel options to delete all users that have not posted anything since X day (using the "last post" from their profile)
Reply With Quote
  #21  
Old 01-14-2001, 09:34 PM
Guest
 
Posts: n/a
Default

Thanks for this :-) it has saved me a lot of time
Reply With Quote
 

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:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04384 seconds
  • Memory Usage 2,280KB
  • 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
  • (3)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
  • (2)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_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
  • 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