The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Auto-prune users once per month
I want to add a scheduled task that deletes all users that meet all of the following conditions:
- in the 'awaiting email confirmation' usergroup - registered more than 60 days ago - never posted. I want to set the scheduled task to run once per month. I assume I would need to add a php file to the cron directory. What should be in the php file? |
#2
|
|||
|
|||
I put together the attached file, you just need to put it in includes/cron and then do "Add New Scheduled Task" in the adminCP, and enter pruneusers.php as the Filename. Also, I used "Deleted {1} inactive users awaiting confirmation." as the log phrase ({1} is the count of users deleted).
I got the code from admincp/user.php so it should do the same thing as pruning users from the adminCP. It probably does more than necessary for "Users Awaiting Email Confirmation" (for instance it assigns any posts or threads to "guest"), but I thought it was better to just leave everything. I have to admit, I only tested this with one user, so you may want to try it out on a test site first. I am pretty sure that the usergroup, join date, and post conditions work right, I just don't know what would happen if there were many users to delete. I didn't know how many could be done in a batch so I wrote it to do batches of 50, but I didn't test that feature. [attachment removed - new version attached below]. |
#3
|
||||
|
||||
Thanks.
I mostly delete 250-500 users at a time / per month. |
#4
|
|||
|
|||
<a href="https://vborg.vbsupport.ru/showthread.php?t=177403" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=177403</a>
|
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
Quote:
|
#7
|
|||
|
|||
it deletes them
Quote:
|
#8
|
|||
|
|||
I'm not sure if you are planning to use this (after my warnings filled you with confidence ), but FWIW I tested it using 10 users and batches of 2, and I found that in fact there was a problem, so only half of the users were being deleted. I'm attaching a new version that fixes the problem.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|