PDA

View Full Version : DEAD User Cleaner


GenSec
11-11-2004, 10:00 PM
To whom it may concerns...

This hack was written for internal needs and made my admin's life much more comfortable ;)

---------------------------------------------------
This hack helps to maintane your vBulletin database in condition.
It concerns first of all those cases when there is inconsistency between your current users list
and dead users information in any of the database tables ( used by addons and hacks for example).
What does it do? It helps to clean db tables from records which contain old entries with userid's deleted
from the main vBulletin user table.

You can make this script to do this boring task in secs from your ACP.

Of course you should be familiar with your db structure. Otherwise don't waste your time for this hack.

You can add/delete/change your settings, turn on and off. I used it on my live board and it's safe BUT:
\*================================================ ======================*/
Backup your board database and accept responsibility if your board stops working.
This done you can rest assured that if you follow the instructions to the letter the board will be
in the same condition it was before, only with this added functionality.
\*================================================ ======================*/



File to edit: 1
File to add: 1
Add newSQL table: 1


Very easy to install... Just 2"
---------------------------------------------------

1. Run sql to create new work db table and populate it with some examples
( I just include tables to clean from some popular hacks )


CREATE TABLE `user_cleaner` (
`cl_id` int(10) unsigned NOT NULL auto_increment,
`cl_userid` varchar(20) NOT NULL default '',
`cl_table` varchar(200) NOT NULL default '',
`cl_valid` tinyint(1) unsigned NOT NULL default '1',
PRIMARY KEY (`cl_id`)
) TYPE=MyISAM AUTO_INCREMENT=28 ;

#
#

INSERT INTO `user_cleaner` VALUES (1, 'userid', 'attachment', 0),
(2, 'userid', 'gamesessions', 0),
(3, 'XOWNER', 'petz_adopt', 0),
(4, 'UID', 'petz_bank', 0),
(5, 'OWNER', 'petz_petz', 0),
(6, 'userid', 'reputation', 0),
(7, 'whoadded', 'reputation', 0),
(8, 'userid', 'rpg_battle_stats', 0),
(9, 'userid', 'rpg_items_user', 0),
(10, 'userid', 'subscribethread', 0),
(11, 'userid', 'userfield', 0);


2. Upload cleanuser.php file to admincp folder

3. ...And optionally add link in you ACP

Find in admincp/index.php

construct_nav_option($vbphrase['repair_optimize_tables'], 'repair.php?do=list', '<br />');


Add below

construct_nav_option('User Cleaner', 'cleanuser.php', '<br />');

------------------
Thats all!


Run 'User Cleaner' from your ACP when you feel it is necessary ;)

FleaBag
11-12-2004, 08:06 PM
Amazing. No, really - didn't expect a hack such as this to ever come along, very useful for me. Thanks! :)

sabret00the
11-16-2004, 10:25 AM
this is indeed a great hack

Jadelit
11-16-2004, 08:44 PM
what other tables should be cleaned?

I dont allow guests to post, but when I remove someone there post is still there.

Bryan Ex
12-16-2004, 12:28 PM
Wonderful! The arcade game highscores were buggering up my score prunning big time and it was a major PITA to find the deleted user.

Quick question on this... would it be possible to get this to include a secondary database that uses the same loggin info as the VB tables? I have a couple of integrated scripts I would also like to also check against the main user table.

GenSec
12-16-2004, 07:47 PM
The same database - yes. Any other table. And you can use it for any database that has the same user table, as a basic one in vbulletin.

T3MEDIA
09-19-2005, 09:53 PM
how could you remove info from users in a banned group?

curious. THanks.