From 7e25c8d9cc255fbe460c2a970ad7da241c0880bb Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 18 May 2006 18:18:32 +0000 Subject: - added a few missing log variables - include acp/common.php language file if displaying logs (LOG_ variables should be stored there only now) - added check to cron.php - added database_gc config variable - recalculate binary trees every once a week ;) git-svn-id: file:///svn/phpbb/trunk@5929 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 2df3c37f9b..5751e39290 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -178,6 +178,7 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = $iteration++; } + $db->sql_freeresult($result); unset($padding_store); return $forum_list; @@ -2264,27 +2265,31 @@ function tidy_warnings() $db->sql_transaction('commit'); } - set_config('warnings_last_gc', time()); + set_config('warnings_last_gc', time(), true); } /** -* Tidy database -* Removes all tracking rows older than 6 months, including mark_posted informations +* Tidy database, doing some maintanance tasks */ function tidy_database() { global $db; -/* - $remove_date = time() - (3 * 62 * 24 * 3600); - $sql = 'DELETE FROM ' . FORUMS_TRACK_TABLE . ' - WHERE mark_time < ' . $remove_date; - $db->sql_query($sql); + // Recalculate binary tree for forums + recalc_btree('forum_id', FORUMS_TABLE); + + // Recalculate binary tree for modules + $sql = 'SELECT module_class + FROM ' . MODULES_TABLE . ' + GROUP BY module_class'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + recalc_btree('module_id', MODULES_TABLE, $row['module_class']); + } + $db->sql_freeresult($result); - $sql = 'DELETE FROM ' . TOPICS_TRACK_TABLE . ' - WHERE mark_time < ' . $remove_date; - $db->sql_query($sql); -*/ set_config('database_last_gc', time(), true); } -- cgit v1.2.1