From 42ec5e67da2b91d3230e61f7ca12bcb619af38f9 Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Fri, 28 Mar 2003 00:41:16 +0000 Subject: MCP: resync() function deemed stable enough to replace sync() in functions_admin.php. I will keep extensively testing it though... Pruning: now works as expected. git-svn-id: file:///svn/phpbb/trunk@3737 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_forums.php | 4 ++-- phpBB/adm/admin_prune.php | 36 +++++++++++++++--------------------- 2 files changed, 17 insertions(+), 23 deletions(-) (limited to 'phpBB/adm') diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php index 84e99eb4c1..3b61263482 100644 --- a/phpBB/adm/admin_forums.php +++ b/phpBB/adm/admin_forums.php @@ -377,7 +377,7 @@ switch ($mode) break; case 'sync': - sync('forum', intval($_GET['this_f'])); + sync('forum', 'forum_id', intval($_GET['this_f'])); break; case 'add': @@ -973,7 +973,7 @@ function move_forum_content($from_id, $to_id) { $db->sql_query('DELETE FROM ' . TOPICS_TABLE . ' WHERE topic_id IN (' . implode(', ', $topic_ids) . ')'); } - sync('forum', $to_id); + sync('forum', 'forum_id', $to_id); // // TODO: there might be conflicts in ACL tables =\ diff --git a/phpBB/adm/admin_prune.php b/phpBB/adm/admin_prune.php index 5b0f5c48c9..a672acff16 100644 --- a/phpBB/adm/admin_prune.php +++ b/phpBB/adm/admin_prune.php @@ -44,17 +44,7 @@ if (!$auth->acl_get('a_prune')) } // Get the forum ID for pruning -if (isset($_REQUEST['f'])) -{ - $forum_id = intval($_REQUEST['f']); - $forum_sql = ($forum_id == -1) ? '' : "AND forum_id = $forum_id"; -} -else -{ - $forum_id = ''; - $forum_sql = ''; -} - +$forum_id = (isset($_REQUEST['f'])) ? intval($_REQUEST['f']) : -1; // Check for submit to be equal to Prune. If so then proceed with the pruning. if (isset($_POST['doprune'])) @@ -81,19 +71,21 @@ if (isset($_POST['doprune'])) sql_query($sql); if ($row = $db->sql_fetchrow($result)) { + $prune_ids = array(); $log_data = ''; do { - $p_result = prune($forum_rows[$i]['forum_id'], $prunedate); - sync('forum', $forum_rows[$i]['forum_id']); - + $prune_ids[] = $row['forum_id']; + $p_result = prune($row['forum_id'], $prunedate, FALSE); $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; ?> @@ -104,12 +96,14 @@ if (isset($_POST['doprune'])) sql_fetchrow($result)); + while ($row = $db->sql_fetchrow($result)); add_log('admin', 'log_prune', $log_data); + // Sync all pruned forums at once + sync('forum', 'forum_id', $prune_ids, TRUE); } else { @@ -146,11 +140,11 @@ page_header($user->lang['PRUNE']); // If they haven't selected a forum for pruning yet then // display a select box to use for pruning. -if (empty($forum_id)) +if ($forum_id == -1) { // Output a selection table if no forum id has been specified. - $select_list = '' . make_forum_select(false, false, false); + $select_list = '' . make_forum_select(false, false, false); ?> -- cgit v1.2.1