MyBB Hacks

Full Version: Auto Prune dump file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to create a dump file of the pruned users which get deleted after X amount of days with Dennis's auto prune mod?  I've asked on his board and on the community boards with 0 replies.  =(  Maybe someone here can help!

Thanks,
-Shemo
What sort of information do you want in the file?
Here's a way to save the user info to the DB.

  1. Make a copy of the structure of the users table, with phpMyAdmin (or whatever you use to administrate your MySQL).  Call this copied table mybb_users_pruned (replace "mybb_" with your table prefix)
  2. In the copied table, edit the uid field - remove it's auto_increment.
  3. In /inc/plugins/autoprune.php, find:

    PHP Code:
    $uid_list = implode(',', $uids);

    After, add:

    PHP Code:
    		$query = $db->simple_select(TABLE_PREFIX.'users', '*', 'uid IN ('.$uid_list.')');
    		while($user = $db->fetch_array($query))
    			$db->insert_query(TABLE_PREFIX.'users_pruned', $user);



When the users are pruned, they'll be added to the new table before deleting.
Basically I just wanted a log of the pruned users that DennisTTs mod was pruning.

Maybe a simple .txt file that says

2/2/08:
Shemo-pruned
Test-pruned
Etc-pruned

2/3/08:
Test123-pruned
Etc123-pruned

so on...
I generally don't like writing to files for PHP.

Probably better to use my method, as it saves ALL details of the users down (allowing you to do some sort of restoration if needed), plus you can query/sort the information.
Ok, check the attached file.  I think I did what you were saying right.

[Image: phpmyadmin.jpg]

And I also inserted the code into the autoprune.php where you asked.  Now, if this is setup properly, where will I go to view pruned users?
Attached file?

You can view the pruned users in the mybb_users_pruned table (use phpMyAdmin or whatever).
Reference URL's