From 0a4f369681c7bf28c49fe9e9435b2c6ea0fd4915 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Wed, 30 Oct 2002 18:59:09 +0000 Subject: Dumped sql_query_array, replaced with build_array, posting updates, fixed quoting in mysql layers, fulltext enabled ... speed/problem feedback welcome git-svn-id: file:///svn/phpbb/trunk@2986 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_forums.php | 176 ++++++++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 77 deletions(-) (limited to 'phpBB/admin/admin_forums.php') diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php index 915a63a56f..25e6ced71c 100644 --- a/phpBB/admin/admin_forums.php +++ b/phpBB/admin/admin_forums.php @@ -168,6 +168,7 @@ switch ($mode) $forum_style = (!empty($_POST['forum_style'])) ? intval($_POST['forum_style']) : 'NULL'; $post_count_inc = (!empty($_POST['disable_post_count'])) ? 0 : 1; + $moderated = (!empty($_POST['moderated'])) ? 1 : 0; $prune_enable = (!empty($_POST['prune_enable'])) ? 1 : 0; $prune_days = intval($_POST['prune_days']); @@ -198,8 +199,8 @@ switch ($mode) $right_id = $left_id + 1; } - $sql = 'INSERT INTO ' . FORUMS_TABLE . " (forum_id, forum_name, forum_desc, parent_id, left_id, right_id, forum_status, forum_style, post_count_inc, prune_enable, prune_days, prune_freq) - VALUES ($forum_id, '$forum_name', '$forum_desc', $parent_id, $left_id, $right_id, $forum_status, $forum_style, $post_count_inc, $prune_enable, $prune_days, $prune_freq)"; + $sql = 'INSERT INTO ' . FORUMS_TABLE . " (forum_id, forum_name, forum_desc, parent_id, left_id, right_id, forum_status, forum_style, post_count_inc, moderate, prune_enable, prune_days, prune_freq) + VALUES ($forum_id, '$forum_name', '$forum_desc', $parent_id, $left_id, $right_id, $forum_status, $forum_style, $post_count_inc, $moderated, $prune_enable, $prune_days, $prune_freq)"; $db->sql_query($sql); $message = $user->lang['Forums_updated'] . "

" . sprintf($user->lang['Click_return_forumadmin'], '', '') . '

' . sprintf($user->lang['Click_return_admin_index'], '', ''); @@ -231,8 +232,9 @@ switch ($mode) 'prune_enable' => (!empty($_POST['prune_enable'])) ? 1 : 0, 'prune_days' => intval($_POST['prune_days']), 'prune_freq' => intval($_POST['prune_freq']), - 'display_on_index' => (!isset($_POST['display_on_index']) || !empty($_POST['display_on_index'])) ? 1 : 0, - 'post_count_inc' => (!empty($_POST['disable_post_count'])) ? 0 : 1 + 'display_on_index' => (!empty($_POST['display_on_index'])) ? 1 : 0, + 'post_count_inc' => (!empty($_POST['disable_post_count'])) ? 0 : 1, + 'moderated' => (!empty($_POST['moderated'])) ? 1 : 0, ); if (!empty($_POST['set_category']) && $action) @@ -249,8 +251,8 @@ switch ($mode) $sql['forum_posts'] = 0; $sql['forum_topics'] = 0; } - - $db->sql_query_array('UPDATE ' . FORUMS_TABLE . " SET WHERE forum_id = $forum_id", $sql); +echo 'UPDATE ' . FORUMS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql) . " WHERE forum_id = $forum_id"; + $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql) . " WHERE forum_id = $forum_id"); $message = $user->lang['Forums_updated'] . "

" . sprintf($user->lang['Click_return_forumadmin'], '', '') . '

' . sprintf($user->lang['Click_return_admin_index'], '', ''); message_die(MESSAGE, $message); @@ -400,6 +402,7 @@ switch ($mode) $forum_name = (!empty($_POST['forum_name'][$parent_id])) ? htmlspecialchars($_POST['forum_name'][$parent_id]) : ''; $post_count_inc = TRUE; + $moderated = FALSE; $prune_enabled = ''; $prune_days = 7; @@ -424,117 +427,136 @@ switch ($mode)

lang['Forum_edit_delete_explain'] ?>

-
" method="post"> - - - - - - - - - - - +" method="post">
lang['General_settings'] ?>
lang['Forum_name'] : $user->lang['Category_name'] ?>
lang['Forum_desc'] ?>
+ + + + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + - - - - + + + + - - - - + + + + - - - -
lang['General_settings'] ?>
lang['Forum_name'] : $user->lang['Category_name'] ?>
lang['Forum_desc'] ?>
lang['Forum_type'] ?>/>lang['Forum'] ?>   />lang['Category'] ?>
lang['Forum_type'] ?>/>lang['Forum'] ?>   />lang['Category'] ?>
lang['Parent'] ?>
lang['Style'] ?>
lang['Parent'] ?>
lang['Style'] ?>
lang['Forum_settings'] ?>
lang['Forum_status'] ?>
lang['Options'] ?> - />lang['Disable_post_count'] ?> +
lang['Forum_settings'] ?>
lang['Forum_status'] ?>
lang['Options'] ?> + + + + + + 0) { - // // if this forum is a subforum put the "display on index" checkbox - // if ($parent_info = get_forum_info($parent_id)) { if ($parent_info['parent_id'] > 0 || $parent_info['forum_status'] != ITEM_CATEGORY) { + ?> -
- />lang['Display_on_index'] ?> + + + - +
/> lang['Disable_post_count'] ?>
/> lang['Forum_is_moderated']; ?>
/> lang['Display_on_index'] ?>
+
lang['Forum_type'] ?>lang['Set_as_category'] ?>
-      lang['Delete_all_posts'] ?>
-      lang['Move_posts_to'] ?> -
lang['Forum_type'] ?> + + + + + + + + + +
lang['Set_as_category'] ?>
      lang['Delete_all_posts'] ?>
      lang['Move_posts_to'] ?>
lang['Forum_pruning'] ?> - - - - - - - - - - - - -
lang['Enabled'] ?>/>
lang['prune_days'] ?>  lang['Days'] ?>
lang['prune_freq'] ?>  lang['Days'] ?>
lang['Forum_pruning'] ?> + + + + + + + + + + + + +
lang['Enabled'] ?>/>
lang['prune_days'] ?>  lang['Days'] ?>
lang['prune_freq'] ?>  lang['Days'] ?>
-
+ + + +