From ecc9b5eb415362e9970bcc78242df0217a1119a2 Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Thu, 4 Sep 2003 21:53:43 +0000 Subject: [PATCH] Less bugged version. If you sync a forum, you'll be taken back to the forum list where a message will be displayed. git-svn-id: file:///svn/phpbb/trunk@4469 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_forums.php | 48 ++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php index f770fd7993..2b8795e083 100644 --- a/phpBB/adm/admin_forums.php +++ b/phpBB/adm/admin_forums.php @@ -38,7 +38,7 @@ require('pagestart.' . $phpEx); // Get general vars $mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : ''; $action = (isset($_POST['action'])) ? htmlspecialchars($_POST['action']) : ''; -$forum_id = (isset($_REQUEST['this_f'])) ? intval($_REQUEST['this_f']) : ((isset($_REQUEST['f'])) ? intval($_REQUEST['f']) : 0); +$forum_id = (isset($_REQUEST['f'])) ? intval($_REQUEST['f']) : 0; $parent_id = (isset($_REQUEST['parent_id'])) ? intval($_REQUEST['parent_id']) : 0; $forum_data = $errors = array(); @@ -69,9 +69,12 @@ if (isset($_POST['update'])) { case 'delete': $action_subforums = (!empty($_POST['action_subforums'])) ? $_POST['action_subforums'] : ''; - $action_posts = (!empty($_POST['action_posts'])) ? $_POST['action_posts'] : ''; + $subforums_to_id = (!empty($_POST['subforums_to_id'])) ? intval($_POST['subforums_to_id']) : 0; - delete_forum($forum_id); + $action_posts = (!empty($_POST['action_posts'])) ? $_POST['action_posts'] : ''; + $posts_to_id = (!empty($_POST['posts_to_id'])) ? intval($_POST['posts_to_id']) : 0; + + delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id); trigger_error($user->lang['FORUM_DELETED']); break; @@ -531,8 +534,6 @@ switch ($mode) case 'move_up': case 'move_down': - $forum_id = intval($_GET['f']); - $sql = 'SELECT parent_id, left_id, right_id FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id"; @@ -564,13 +565,13 @@ switch ($mode) if ($mode == 'move_up') { - $log_action = 'UP'; + $log_action = 'LOG_FORUM_MOVE_UP'; $up_id = $forum_id; $down_id = $row['forum_id']; } else { - $log_action = 'DOWN'; + $log_action = 'LOG_FORUM_MOVE_DOWN'; $up_id = $row['forum_id']; $down_id = $forum_id; } @@ -623,13 +624,11 @@ switch ($mode) $db->sql_transaction('commit'); $forum_data = get_forum_info($forum_id); - add_log('admin', 'LOG_FORUM_MOVE_' . $log_action, $forum_data['forum_name'], $move_forum_name); + add_log('admin', $log_action, $forum_data['forum_name'], $move_forum_name); unset($forum_data); break; case 'sync': - $forum_id = (isset($_REQUEST['this_f'])) ? intval($_REQUEST['this_f']) : ((isset($_REQUEST['f'])) ? intval($_REQUEST['f']) : 0); - if (!$forum_id) { trigger_error($user->lang['NO_FORUM']); @@ -646,17 +645,15 @@ switch ($mode) } $db->sql_freeresult($result); + sync('forum', 'forum_id', $forum_id); add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']); - sync('forum', 'forum_id', $forum_id); break; } // Default management page -$forum_id = (!empty($_GET['f'])) ? intval($_GET['f']) : 0; - -if (!$forum_id) +if (!$parent_id) { $navigation = $user->lang['FORUM_INDEX']; } @@ -664,22 +661,22 @@ else { $navigation = '' . $user->lang['FORUM_INDEX'] . ''; - $forums_nav = get_forum_branch($forum_id, 'parents', 'descending'); + $forums_nav = get_forum_branch($parent_id, 'parents', 'descending'); foreach ($forums_nav as $row) { - if ($row['forum_id'] == $forum_id) + if ($row['forum_id'] == $parent_id) { $navigation .= ' -> ' . $row['forum_name']; } else { - $navigation .= ' -> ' . $row['forum_name'] . ''; + $navigation .= ' -> ' . $row['forum_name'] . ''; } } } // Jumpbox -$forum_box = make_forum_select($forum_id); +$forum_box = make_forum_select($parent_id); // Front end adm_page_header($user->lang['MANAGE']); @@ -688,9 +685,14 @@ adm_page_header($user->lang['MANAGE']);

lang['MANAGE']; ?>

-

lang['FORUM_ADMIN_EXPLAIN']; ?>

+

lang['FORUM_ADMIN_EXPLAIN']; ?>

"> +if ($mode == 'sync') +{ + echo '
' . $user->lang['FORUM_RESYNCED'] . '
'; +} + +?>">
@@ -704,7 +706,7 @@ adm_page_header($user->lang['MANAGE']); $sql = 'SELECT * FROM ' . FORUMS_TABLE . " - WHERE parent_id = $forum_id + WHERE parent_id = $parent_id ORDER BY left_id"; $result = $db->sql_query($sql); @@ -729,10 +731,10 @@ while ($row = $db->sql_fetchrow($result)) } } - $forum_title = ($forum_type != FORUM_LINK) ? "' : ''; + $forum_title = ($forum_type != FORUM_LINK) ? "' : ''; $forum_title .= $row['forum_name']; $forum_title .= ($forum_type != FORUM_LINK) ? '' : ''; - $url = "$phpEx$SID&parent_id=$forum_id&f=" . $row['forum_id']; + $url = "$phpEx$SID&parent_id=$parent_id&f=" . $row['forum_id']; ?>