Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Users Cleanup Details »»
Users Cleanup
Version: 0.4, by Vitaly Vitaly is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.0.x Rating:
Released: 06-15-2010 Last Update: 03-20-2011 Installs: 153
Uses Plugins
Re-useable Code Additional Files  
No support by the author.

3.8 version repost. The same code.

This mod helps to automatically delete user account upon custom-defined rules. For example, you can delete members, who didn't comfirmed emails after 3 days, delete members, who have zero posts and didn't visited your forum for a long time, and so on.

Any conditions can be defined! Cleanup can be done in both automatic and manual mode.

Difference between built-in vB user pruner:

1. Completely automated.
2. Comfotable management of multiple rules.
3. More flexible prune criterias.

Some stat for my forum (only zero-posts users were cleared):

- last user ID 50652
- total users left 19359

60% effectivity!!!

Installation:

Upload files and import product XML.

Configuration:
  • Enter ACP and go to Users -> Cleanup.
  • Create cleanup rules you needs, and save in inactive state.
  • Test you rules. Do manual cleanup, if you wish.
  • Activate rules (enable automatic cleanup), if you are satisfied with testing results.
Warning! Don't activate cleanup rules without testing! Don't forget to backup your forum database!

PS. Product is marked as beta, because i can't test all possible rules combinations. But those been used - works fine. If you have strange results duging testing, don't hesitate to post screenshot with your rule, and explain what is wrong.

Was NOT tested with 3.6.x & 3.7.x, but probably works.

This mod is delelopped here http://github.com/rcdesign/vb-users_cleanup . Patches are welcome.

History:

0.4
- Fixed SQL queries for some conditions (thnks to phr4nk13)

0.3
- compleete code rafactoring
- removed deletet posts count as useless
- added support for blogs & social groups

(!) For upgraders - your cleanup rule swill be disabled! Plese, recheck & enable again.

Download Now

File Type: zip Users-Cleanup-0.1.zip (12.2 KB, 201 views)
File Type: zip vb-users_cleanup-0.3.zip (12.0 KB, 55 views)
File Type: zip vb-users_cleanup-0.4.zip (12.0 KB, 786 views)

Screenshots

File Type: gif uc1.gif (37.6 KB, 0 views)
File Type: gif uc2.gif (53.4 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
Insta-Gator

Comments
  #12  
Old 03-21-2011, 06:30 PM
phr4nk13 phr4nk13 is offline
 
Join Date: Jul 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't remove the table prefix, i added it. That ist the errormessage onli with this option "User has never posted (also count in social groups and blogs)" selectet and clicked on "test":


Quote:
Datenbankfehler in vBulletin 4.1.2:

Invalid SQL:
SELECT
`user`.*
FROM
vb_user AS user
LEFT JOIN vb_groupmessage ON `groupmessage`.postuserid = `user`.userid
LEFT JOIN vb_blog_text ON `blog_text`.bloguserid = `user`.userid
WHERE
`user`.`posts` = 0 AND `groupmessage`.gmid IS NULL AND `blog_text`.blogtextid IS NULL AND `user`.`userid` NOT IN (0);

MySQL-Fehler : Unknown column 'groupmessage.gmid' in 'where clause'
Fehler-Nr. : 1054
Fehler-Zeit : Monday, 21.03.2011 @ 20:23:28
Datum : Monday, 21.03.2011 @ 20:23:28
Skript : vbroot/admincp/users_cleanup.php?do=test
Referrer : vbroot/admincp/users_cleanup.php?do=add
IP-Adresse : xXx
Benutzername : xXx
Klassenname : vB_Database
MySQL-Version : 5.1.43-nmm4-log
I was first trying to hardcode the prefix. Than i got the variable to work.

That are the only lines i changed:

Code:
// social groups
                $join[] = 'LEFT JOIN ' . TABLE_PREFIX . 'groupmessage ON ' . TABLE_PREFIX .'groupmessage.postuserid = `user`.userid';
                $where[] = TABLE_PREFIX .'groupmessage.gmid IS NULL';

                // blog
                if ($vbulletin->products['vbblog'])
                {
                    $join[] = 'LEFT JOIN ' . TABLE_PREFIX . 'blog_text ON ' . TABLE_PREFIX .'blog_text.bloguserid = `user`.userid';
                    $where[] = TABLE_PREFIX .'blog_text.blogtextid IS NULL';
                }
                break;
Reply With Quote
  #13  
Old 03-21-2011, 06:36 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does the last few posts mean there's a problem with the mod and we should put it's use on hold for now?

Thanks ...

Regards,
Doug
Reply With Quote
  #14  
Old 03-21-2011, 06:44 PM
phr4nk13 phr4nk13 is offline
 
Join Date: Jul 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats only a problem at my installation (atm) and the last option selected. If you push "test" you can try it yourself. All other options working fine for me.
Reply With Quote
  #15  
Old 03-21-2011, 07:05 PM
Vitaly's Avatar
Vitaly Vitaly is offline
 
Join Date: Apr 2004
Location: Russia, St.Petersburg
Posts: 428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks again for your efforts. Try 0.4 updated version.
Reply With Quote
  #16  
Old 03-21-2011, 07:14 PM
phr4nk13 phr4nk13 is offline
 
Join Date: Jul 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yay it works. Thanks

And now my question from above: Is there a chance to include custom profilefields in the options?
Reply With Quote
  #17  
Old 03-21-2011, 07:23 PM
Vitaly's Avatar
Vitaly Vitaly is offline
 
Join Date: Apr 2004
Location: Russia, St.Petersburg
Posts: 428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Chances are a bit less than zero . But if you could explain, why this required for my progect, or at least to hundreds of vborg visitors - somerthing can change.
Reply With Quote
  #18  
Old 03-23-2011, 02:22 PM
combs combs is offline
 
Join Date: Aug 2007
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK...this is a lifesaver...great plugin! I had about 100K in posts and pruning would just cause time out. so I used this and was able to prune users by certain post counts. If the list of users list was too large it wouldn't work but it's an enormous list of users...so I just had to shorten the distance in posts.

After doing that I ran SQL Query of DELETE FROM post WHERE userid = 0 to get rid of all the posts from users who were turned into guests. Updated all counters and I accomplished what I have been trying to do for about a month.

I'm nominating for MOTM!
Reply With Quote
  #19  
Old 04-04-2011, 03:10 AM
Merriweather Merriweather is offline
 
Join Date: Nov 2006
Posts: 389
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed on 4.1.2 but getting the same issue as a previous user - db error when I choose "User has never posted (also count in social groups and blogs)."

The error is:

Quote:
Database error in vBulletin 4.1.2:

Invalid SQL:
SELECT
`user`.*
FROM
user AS user
LEFT JOIN groupmessage AS groupmessage ON `groupmessage`.postuserid = `user`.userid
LEFT JOIN blog_text AS blog_text ON `blog_text`.bloguserid = `user`.userid
WHERE
`user`.`lastactivity` < 1270354181 AND `user`.`usergroupid` = 2 AND `user`.`posts` = 0 AND `groupmessage`.gmid IS NULL AND `blog_text`.blogtextid IS NULL AND `user`.`userid` NOT IN (0);

MySQL Error : The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
Error Number : 1104
Request Date : Sunday, April 3rd 2011 @ 09:09:41 PM
Error Date : Sunday, April 3rd 2011 @ 09:09:41 PM
Script : http://www.mysite.com/admincp/users_cleanup.php?do=test
Referrer : http://www.mysite.com/admincp/users_cleanup.php?do=add
IP Address : 76.28.215.148
Username : MyUserName
Classname : vB_Database
MySQL Version : 5.0.51a-24+lenny5-log
Reply With Quote
  #20  
Old 04-05-2011, 05:48 PM
Vitaly's Avatar
Vitaly Vitaly is offline
 
Join Date: Apr 2004
Location: Russia, St.Petersburg
Posts: 428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems to be mysql 5.0 bug http://www.zen-cart.com/forum/showpo...14&postcount=4

Try to insert
PHP Code:
$db->query_write("SET OPTION SQL_BIG_SELECTS=1"); 
BEFORE that line

https://github.com/rcdesign/vb-users...eanup.php#L151

and tell me result + how many visitors registered on your forum.
Reply With Quote
  #21  
Old 04-09-2011, 04:37 PM
Kraxell's Avatar
Kraxell Kraxell is offline
 
Join Date: Jun 2010
Location: Germany
Posts: 481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

i have installed this plugin but if a run the task, its nothing happen. any idea?
Reply With Quote
Reply


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 07:41 PM.


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.05659 seconds
  • Memory Usage 2,349KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (5)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete