1<?php if (!defined('BB2_CORE')) die('I said no cheating!');
2
3function bb2_housekeeping($settings, $package)
4{
5	// FIXME Yes, the interval's hard coded (again) for now.
6	$query = "DELETE FROM `" . $settings['log_table'] . "` WHERE `date` < DATE_SUB('" . bb2_db_date() . "', INTERVAL 7 DAY)";
7	bb2_db_query($query);
8
9	// Waste a bunch more of the spammer's time, sometimes.
10	if (rand(1,1000) == 1) {
11		$query = "OPTIMIZE TABLE `" . $settings['log_table'] . "`";
12		bb2_db_query($query);
13	}
14}
15
16?>
17