diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-18 18:18:32 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-18 18:18:32 +0000 |
commit | 7e25c8d9cc255fbe460c2a970ad7da241c0880bb (patch) | |
tree | 89bb537574b06359d58f515a07fa6e37b6c63cf9 /phpBB/includes/functions_admin.php | |
parent | f15d6862ae4a62421da83e10dfdeb7153756af1a (diff) | |
download | forums-7e25c8d9cc255fbe460c2a970ad7da241c0880bb.tar forums-7e25c8d9cc255fbe460c2a970ad7da241c0880bb.tar.gz forums-7e25c8d9cc255fbe460c2a970ad7da241c0880bb.tar.bz2 forums-7e25c8d9cc255fbe460c2a970ad7da241c0880bb.tar.xz forums-7e25c8d9cc255fbe460c2a970ad7da241c0880bb.zip |
- 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
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r-- | phpBB/includes/functions_admin.php | 29 |
1 files changed, 17 insertions, 12 deletions
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); } |