Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Auto Prune dump file
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #1
Auto Prune dump file
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
02-01-2008 05:53 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Auto Prune dump file
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.

My Blog
02-02-2008 07:37 PM
Find all posts by this user
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #3
RE: Auto Prune dump file
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...
02-03-2008 04:40 AM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Auto Prune dump file
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.

My Blog
02-03-2008 11:17 AM
Find all posts by this user
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #5
RE: Auto Prune dump file
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?
02-03-2008 02:25 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Auto Prune dump file
Attached file?

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

My Blog
02-03-2008 02:48 PM
Find all posts by this user

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: