vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Users Cleanup (https://vborg.vbsupport.ru/showthread.php?t=244707)

Vitaly 06-15-2010 10:00 PM

Users Cleanup
 
1 Attachment(s)
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.

Marek58 06-16-2010 08:26 AM

1 Attachment(s)
Polish version

gwerzal 06-16-2010 10:16 AM

Could be very useful for one of my sites.

Thank you.

BozzaJos 06-16-2010 10:22 AM

Tagged for future use, thanks for the hard work!

tornado88 06-30-2010 12:07 PM

Worked for me... did exactly what it said it would do.

I only used the test and manual delete function....

Maybe later, I'll try the cron enabled function.

In any case - thanks for the handy utility!

cobaku 07-13-2010 02:26 PM

it works
thank you

Vitaly 03-21-2011 10:32 AM

Code is completely refactored to make it clear & more effective. Blogs & SG support added.

After upgrade your previous rules wil be disabled. Please, check those manually & enable again.

BadgerDog 03-21-2011 01:10 PM

Installed with thanks for testing on 4.04 .... :)

We'd like to use it to clear out any users "Awaiting Email Confirmation" user group who haven't responded to validation email in 14 days or more ...

Regards,
Doug

phr4nk13 03-21-2011 04:57 PM

1 Attachment(s)
That'S exatly what i've searched for. Thanks.

But I gat a SQL/database-error with it when selecting "User has never posted (also count in social groups and blogs)" and test this option.


With my little SQL knowlegde and some Try and Error this function_users_cleanup.php (attachment) is working i think. Anyway please chekc my changes if there are any security mistakes.

Is there a chance to include custom profilefields in the options?

Using vBulletin Suite 4.1.2. German

Sorry for my bad english :)

Vitaly 03-21-2011 05:44 PM

Thanks for your help. Could you tell full text of SQL error?

May be, problem can be with scopes, but "never posted" condition works at my forum. Can't accept your patch into mainline, because you removed table prefix - that will not be compatible with all installations. But i'll try to do somerthing, if you tell me more info about error. Please, tell me also your SQL version & exact selections set in your cleanup rule, that cause problems.

phr4nk13 03-21-2011 06:30 PM

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;


BadgerDog 03-21-2011 06:36 PM

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

Thanks ... :)

Regards,
Doug

phr4nk13 03-21-2011 06:44 PM

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.

Vitaly 03-21-2011 07:05 PM

Thanks again for your efforts. Try 0.4 updated version.

phr4nk13 03-21-2011 07:14 PM

Yay it works. Thanks :)

And now my question from above: Is there a chance to include custom profilefields in the options?

Vitaly 03-21-2011 07:23 PM

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.

combs 03-23-2011 02:22 PM

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!

Merriweather 04-04-2011 03:10 AM

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

Vitaly 04-05-2011 05:48 PM

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.

Kraxell 04-09-2011 04:37 PM

Hello,

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

giaguaro 04-09-2011 06:20 PM

this is funny..
I added the product and this worked correctly.
I have it in the installed products.
I have it in the ACP general options.
I havent it in the ACP users panel.. :(

i am running 4.1.2

giaguaro 04-09-2011 07:14 PM

i mean i can set the time and frequence options in the ACP panel, but i dont find where to set WHAT users i have to clean

giaguaro 04-10-2011 09:47 AM

by the way, i have a ton of RC jeepers on my site..

Kraxell 04-11-2011 07:48 PM

@giaguaro

this option is in the "Users"-Panel (where you can edit users etc.) in ACP.

giaguaro 04-26-2011 05:51 PM

as i told you, i have not the option in the User panel.
Everything else seem to be there correctly..

rob01 04-26-2011 11:25 PM

there is no way for recovering the userids, of the people which got deleted?

LBGSHI 04-27-2011 08:14 PM

I'm using 4.1.3, and I've also installed the mod as instructed, and do not see it under Users in the Admin CP...

giaguaro 04-28-2011 06:07 PM

Quote:

Originally Posted by LBGSHI (Post 2189413)
I'm using 4.1.3, and I've also installed the mod as instructed, and do not see it under Users in the Admin CP...

me too. But no answer..

AWMGolfer 04-28-2011 10:16 PM

Great mod, what I would love to see and would absolutely use it if it is possible is if instead of deleting members they would be moved into a membergroup. For example I want to have a deactivated accounts membergroup and if they haven't visited in two months they are moved into this group.

giaguaro 04-30-2011 05:37 PM

Quote:

Originally Posted by giaguaro (Post 2189750)
me too. But no answer..

up. Need assistance.. :(

giaguaro 05-07-2011 06:50 AM

Quote:

Originally Posted by giaguaro (Post 2190392)
up. Need assistance.. :(

up, need assistance

dmm2020 06-21-2011 03:18 AM

What I would like to see in something like this is ability to prune members who have not accepted the rules yet. Any way to add that in easily?

Gecuba 06-27-2011 01:28 PM

Quote:

Originally Posted by AWMGolfer (Post 2189826)
For example I want to have a deactivated accounts membergroup and if they haven't visited in two months they are moved into this group.

Try Move Inactive and Lurker Users To New Usergroup mod

pantani 06-29-2011 01:04 PM

Nice and easy tool, works perfect here on 4.1.4, thanks for this ;)

ckeins 07-11-2011 09:39 AM

I've got some other problems with spam-users. Let me explain my problem, and see if this mod can do this or can be modified easily.

I run a car forum, where every user can specify his car/model via 2 custom profile fields. spam bots do always fill out these fields upon registration and always choose the first option of these custom fields.
can I insert these custom profile fields into this mod, to find only users, who have filled out these 2 profile fields with the first answers?

LBGSHI 08-04-2011 07:19 PM

Awesome; thanks.

Videx 08-06-2011 12:50 AM

Quote:

Originally Posted by ckeins (Post 2219237)
...can I insert these custom profile fields into this mod, to find only users, who have filled out these 2 profile fields with the first answers?

Assuming you've already eliminated spambots with one of the many solutions for them, I can only say I wish I was as lucky as you that our spam-humans would be so obvious. The way it is, I can't tell them from real members and that makes squashing them particularly difficult.

riteshsanap 01-24-2012 02:33 PM

The Best Mod Ever, thank you very much

TombstoneWarrior 01-24-2012 05:42 PM

why do i need a title and what do i put there also what would i put in display order?
also how would i do a admin control of this mod?

14DH01 01-24-2012 06:13 PM

hello,
This mod allows it to put the id in order?

ID:1,2,5,7,8,10...
ID:1,2,3,4,5,6...

Thank you ;)


All times are GMT. The time now is 07:07 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.01623 seconds
  • Memory Usage 1,829KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete