diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php
index 6c5184094d..214eae0b8a 100644
--- a/phpBB/admin/admin_forums.php
+++ b/phpBB/admin/admin_forums.php
@@ -76,10 +76,10 @@ function get_info($mode, $id)
$count = $db->sql_fetchrow($result);
$count = $count['total'];
-
$sql = "SELECT *
FROM $table
- WHERE $idfield = $id";
+ WHERE $idfield = $id";
+
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql);
@@ -289,26 +289,33 @@ if( !empty($mode) )
"body" => "admin/forum_edit_body.tpl")
);
+ $s_hidden_fields = '';
+
$template->assign_vars(array(
'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"),
- 'S_CATLIST' => $catlist,
- 'S_STATUSLIST' => $statuslist,
- 'S_FORUMID' => $forum_id,
- 'S_NEWMODE' => $newmode,
+ "S_HIDDEN_FIELDS" => $s_hidden_fields,
+ 'S_SUBMIT_VALUE' => $buttonvalue,
+ 'S_CAT_LIST' => $catlist,
+ 'S_STATUS_LIST' => $statuslist,
'S_PRUNE_ENABLED' => $prune_enabled,
- 'S_PRUNE_DAYS' => ( isset($pr_row['prune_days']) ) ? $pr_row['prune_days'] : 7,
- 'S_PRUNE_FREQ' => ( isset($pr_row['prune_freq']) ) ? $pr_row['prune_freq'] : 1,
"L_FORUM_TITLE" => $l_title,
"L_FORUM_EXPLAIN" => $lang['Forum_edit_delete_explain'],
+ "L_FORUM_SETTINGS" => $lang['Forum_settings'],
+ "L_FORUM_NAME" => $lang['Forum_name'],
+ "L_CATEGORY" => $lang['Category'],
+ "L_FORUM_DESCRIPTION" => $lang['Forum_desc'],
+ "L_FORUM_STATUS" => $lang['Forum_status'],
+ "L_AUTO_PRUNE" => $lang['Forum_pruning'],
'L_ENABLED' => $lang['Enabled'],
'L_PRUNE_DAYS' => $lang['prune_days'],
'L_PRUNE_FREQ' => $lang['prune_freq'],
'L_DAYS' => $lang['days'],
- 'FORUMNAME' => $forumname,
- 'DESCRIPTION' => $forumdesc,
- 'BUTTONVALUE' => $buttonvalue)
+ 'PRUNE_DAYS' => ( isset($pr_row['prune_days']) ) ? $pr_row['prune_days'] : 7,
+ 'PRUNE_FREQ' => ( isset($pr_row['prune_freq']) ) ? $pr_row['prune_freq'] : 1,
+ 'FORUM_NAME' => $forumname,
+ 'DESCRIPTION' => $forumdesc)
);
$template->pparse("body");
break;
@@ -324,7 +331,7 @@ if( !empty($mode) )
$sql = "SELECT MAX(forum_order) AS max_order
FROM " . FORUMS_TABLE . "
- WHERE cat_id = " . $HTTP_POST_VARS['cat_id'];
+ WHERE cat_id = " . intval($HTTP_POST_VARS['cat_id']);
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get order number from forums table", "", __LINE__, __FILE__, $sql);
@@ -370,19 +377,25 @@ if( !empty($mode) )
}
}
- $show_index = TRUE;
+ $message = $lang['Forums_updated'] . "
" . sprintf($lang['Click_return_forumadmin'], "", "") . "
" . sprintf($lang['Click_return_admin_index'], "", "");
+
+ message_die(GENERAL_MESSAGE, $message);
+
break;
case 'modforum':
// Modify a forum in the DB
- if( $HTTP_POST_VARS['prune_enable'] != 1)
+ if( isset($HTTP_POST_VARS['prune_enable']))
{
- $HTTP_POST_VARS['prune_enable'] = 0;
+ if( $HTTP_POST_VARS['prune_enable'] != 1 )
+ {
+ $HTTP_POST_VARS['prune_enable'] = 0;
+ }
}
$sql = "UPDATE " . FORUMS_TABLE . "
- SET forum_name = '" . $HTTP_POST_VARS['forumname'] . "', cat_id = " . $HTTP_POST_VARS['cat_id'] . ", forum_desc = '" . $HTTP_POST_VARS['forumdesc'] . "', forum_status = " . $HTTP_POST_VARS['forumstatus'] . ", prune_enable = " . $HTTP_POST_VARS['prune_enable'] . "
- WHERE forum_id = ".$HTTP_POST_VARS['forum_id'];
+ SET forum_name = '" . $HTTP_POST_VARS['forumname'] . "', cat_id = " . intval($HTTP_POST_VARS['cat_id']) . ", forum_desc = '" . $HTTP_POST_VARS['forumdesc'] . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
+ WHERE forum_id = " . intval($HTTP_POST_VARS['forum_id']);
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update forum information", "", __LINE__, __FILE__, $sql);
@@ -397,7 +410,7 @@ if( !empty($mode) )
$sql = "SELECT *
FROM " . PRUNE_TABLE . "
- WHERE forum_id = " . $HTTP_POST_VARS['forum_id'];
+ WHERE forum_id = " . intval($HTTP_POST_VARS['forum_id']);
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get forum Prune Information","",__LINE__, __FILE__, $sql);
@@ -406,13 +419,13 @@ if( !empty($mode) )
if( $db->sql_numrows($result) > 0 )
{
$sql = "UPDATE " . PRUNE_TABLE . "
- SET prune_days = " . $HTTP_POST_VARS['prune_days'] . ", prune_freq = " . $HTTP_POST_VARS['prune_freq'] . "
- WHERE forum_id = " . $HTTP_POST_VARS['forum_id'];
+ SET prune_days = " . intval($HTTP_POST_VARS['prune_days']) . ", prune_freq = " . intval($HTTP_POST_VARS['prune_freq']) . "
+ WHERE forum_id = " . intval($HTTP_POST_VARS['forum_id']);
}
else
{
$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
- VALUES(" . $HTTP_POST_VARS['forum_id'] . ", " . $HTTP_POST_VARS['prune_days'] . ", " . $HTTP_POST_VARS['prune_freq'] . ")";
+ VALUES(" . intval($HTTP_POST_VARS['forum_id']) . ", " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")";
}
if( !$result = $db->sql_query($sql) )
@@ -420,7 +433,11 @@ if( !empty($mode) )
message_die(GENERAL_ERROR, "Couldn't Update Forum Prune Information","",__LINE__, __FILE__, $sql);
}
}
- $show_index = TRUE;
+
+ $message = $lang['Forums_updated'] . "
" . sprintf($lang['Click_return_forumadmin'], "", "") . "
" . sprintf($lang['Click_return_admin_index'], "", "");
+
+ message_die(GENERAL_MESSAGE, $message);
+
break;
case 'addcat':
@@ -451,27 +468,42 @@ if( !empty($mode) )
message_die(GENERAL_ERROR, "Couldn't insert row in categories table", "", __LINE__, __FILE__, $sql);
}
- $show_index = TRUE;
+ $message = $lang['Forums_updated'] . "
" . sprintf($lang['Click_return_forumadmin'], "", "") . "
" . sprintf($lang['Click_return_admin_index'], "", "");
+
+ message_die(GENERAL_MESSAGE, $message);
+
break;
case 'editcat':
+ //
// Show form to edit a category
+ //
$newmode = 'modcat';
- $buttonvalue = 'Change';
+ $buttonvalue = $lang['Update'];
+
+ $cat_id = intval($HTTP_GET_VARS['cat_id']);
- $cat_id = $HTTP_GET_VARS['cat_id'];
$row = get_info('category', $cat_id);
$cat_title = $row['cat_title'];
$template->set_filenames(array(
"body" => "admin/category_edit_body.tpl")
);
+
+ $s_hidden_fields = '';
+
$template->assign_vars(array(
- 'CAT_TITLE' => $cat_title,
- 'S_CATID' => $cat_id,
- 'S_NEWMODE' => $newmode,
- 'BUTTONVALUE' => $buttonvalue)
+ "CAT_TITLE" => $cat_title,
+
+ "L_EDIT_CATEGORY" => $lang['Edit_Category'],
+ "L_EDIT_CATEGORY_EXPLAIN" => $lang['Edit_Category_explain'],
+ "L_CATEGORY" => $lang['Category'],
+
+ "S_HIDDEN_FIELDS" => $s_hidden_fields,
+ 'S_SUBMIT_VALUE' => $buttonvalue,
+ "S_FORUM_ACTION" => append_sid("admin_forums.$phpEx"))
);
+
$template->pparse("body");
break;
@@ -479,37 +511,53 @@ if( !empty($mode) )
// Modify a category in the DB
$sql = "UPDATE " . CATEGORIES_TABLE . "
SET cat_title = '" . $HTTP_POST_VARS['cat_title'] . "'
- WHERE cat_id = " . $HTTP_POST_VARS['cat_id'];
+ WHERE cat_id = " . intval($HTTP_POST_VARS['cat_id']);
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update forum information", "", __LINE__, __FILE__, $sql);
}
- $show_index = TRUE;
+
+ $message = $lang['Forums_updated'] . "
" . sprintf($lang['Click_return_forumadmin'], "", "") . "
" . sprintf($lang['Click_return_admin_index'], "", "");
+
+ message_die(GENERAL_MESSAGE, $message);
+
break;
case 'deleteforum':
// Show form to delete a forum
- $forum_id = $HTTP_GET_VARS['forum_id'];
+ $forum_id = intval($HTTP_GET_VARS['forum_id']);
+
$select_to = '';
- $buttonvalue = "Move&Delete";
+
+ $buttonvalue = $lang['Move_and_Delete'];
+
$newmode = 'movedelforum';
+
$foruminfo = get_info('forum', $forum_id);
$name = $foruminfo['forum_name'];
$template->set_filenames(array(
"body" => "admin/forum_delete_body.tpl")
);
+
+ $s_hidden_fields = '';
+
$template->assign_vars(array(
- 'NAME' => $name,
- 'S_FORUM_ACTION' => $PHP_SELF,
- 'S_FROM_ID' => $forum_id,
+ "NAME" => $name,
+
+ "L_FORUM_DELETE" => $lang['Forum_delete'],
+ "L_FORUM_DELETE_EXPLAIN" => $lang['Forum_delete_explain'],
+ "L_MOVE_CONTENTS" => $lang['Move_contents'],
+ "L_FORUM_NAME" => $lang['Forum_name'],
+
+ 'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"),
'S_SELECT_TO' => $select_to,
- 'S_NEWMODE' => $newmode,
- 'BUTTONVALUE' => $buttonvalue)
+ 'S_SUBMIT_VALUE' => $buttonvalue)
);
+
$template->pparse("body");
break;
@@ -521,7 +569,6 @@ if( !empty($mode) )
$to_id = intval($HTTP_POST_VARS['to_id']);
$delete_old = intval($HTTP_POST_VARS['delete_old']);
-
// Either delete or move all posts in a forum
if($to_id == -1)
{
@@ -565,7 +612,9 @@ if( !empty($mode) )
message_die(GENERAL_ERROR, "Couldn't delete forum", "", __LINE__, __FILE__, $sql);
}
- $show_index = TRUE;
+ $message = $lang['Forums_updated'] . "
" . sprintf($lang['Click_return_forumadmin'], "", "") . "
" . sprintf($lang['Click_return_admin_index'], "", "");
+
+ message_die(GENERAL_MESSAGE, $message);
break;
@@ -575,7 +624,7 @@ if( !empty($mode) )
//
$cat_id = intval($HTTP_GET_VARS['cat_id']);
- $buttonvalue = "Move&Delete";
+ $buttonvalue = $lang['Move_and_Delete'];
$newmode = 'movedelcat';
$catinfo = get_info('category', $cat_id);
$name = $catinfo['cat_title'];
@@ -597,7 +646,7 @@ if( !empty($mode) )
}
else
{
- $select_to = 'Nowhere to move';
+ $select_to = $lang['Nowhere_to_move'];
}
}
else
@@ -610,14 +659,22 @@ if( !empty($mode) )
$template->set_filenames(array(
"body" => "admin/forum_delete_body.tpl")
);
+
+ $s_hidden_fields = '';
+
$template->assign_vars(array(
- 'NAME' => $name,
+ "NAME" => $name,
+
+ "L_FORUM_DELETE" => $lang['Forum_delete'],
+ "L_FORUM_DELETE_EXPLAIN" => $lang['Forum_delete_explain'],
+ "L_MOVE_CONTENTS" => $lang['Move_contents'],
+ "L_FORUM_NAME" => $lang['Forum_name'],
+
'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"),
- 'S_FROM_ID' => $cat_id,
'S_SELECT_TO' => $select_to,
- 'S_NEWMODE' => $newmode,
- 'BUTTONVALUE' => $buttonvalue)
+ 'S_SUBMIT_VALUE' => $buttonvalue)
);
+
$template->pparse("body");
break;
@@ -658,7 +715,9 @@ if( !empty($mode) )
message_die(GENERAL_ERROR, "Couldn't delete category", "", __LINE__, __FILE__, $sql);
}
- $show_index = TRUE;
+ $message = $lang['Forums_updated'] . "
" . sprintf($lang['Click_return_forumadmin'], "", "") . "
" . sprintf($lang['Click_return_admin_index'], "", "");
+
+ message_die(GENERAL_MESSAGE, $message);
break;
@@ -716,6 +775,7 @@ if( !empty($mode) )
message_die(GENERAL_MESSAGE, $lang['No_mode']);
break;
}
+
if ($show_index != TRUE)
{
include('page_footer_admin.'.$phpEx);
@@ -762,66 +822,62 @@ if( $total_categories = $db->sql_numrows($q_categories) )
message_die(GENERAL_ERROR, "Could not query forums information", "", __LINE__, __FILE__, $sql);
}
- if( !$total_forums = $db->sql_numrows($q_forums) )
- {
- $lang['No_forums'];
-
- $template->assign_block_vars("no_forums", array());
-
- }
-
$forum_rows = $db->sql_fetchrowset($q_forums);
- //
- // Okay, let's build the index
- //
- $gen_cat = array();
-
- for($i = 0; $i < $total_categories; $i++)
+ if( $total_forums = $db->sql_numrows($q_forums) )
{
- $cat_id = $category_rows[$i]['cat_id'];
+ //
+ // Okay, let's build the index
+ //
+ $gen_cat = array();
- $template->assign_block_vars("catrow", array(
- "S_ADD_FORUM_SUBMIT" => "addforum[$cat_id]",
- "S_ADD_FORUM_NAME" => "forumname[$cat_id]",
-
- "CAT_ID" => $cat_id,
- "CAT_DESC" => $category_rows[$i]['cat_title'],
-
- "U_CAT_EDIT" => append_sid("admin_forums.$phpEx?mode=editcat&cat_id=$cat_id"),
- "U_CAT_DELETE" => append_sid("admin_forums.$phpEx?mode=deletecat&cat_id=$cat_id"),
- "U_CAT_MOVE_UP" => append_sid("admin_forums.$phpEx?mode=cat_order&move=-15&cat_id=$cat_id"),
- "U_CAT_MOVE_DOWN" => append_sid("admin_forums.$phpEx?mode=cat_order&move=15&cat_id=$cat_id"),
- "U_VIEWCAT" => append_sid($phpbb_root_path."index.$phpEx?viewcat=$cat_id"))
- );
-
- for($j = 0; $j < $total_forums; $j++)
+ for($i = 0; $i < $total_categories; $i++)
{
- $forum_id = $forum_rows[$j]['forum_id'];
-
- if ($forum_rows[$j]['cat_id'] == $cat_id)
+ $cat_id = $category_rows[$i]['cat_id'];
+
+ $template->assign_block_vars("catrow", array(
+ "S_ADD_FORUM_SUBMIT" => "addforum[$cat_id]",
+ "S_ADD_FORUM_NAME" => "forumname[$cat_id]",
+
+ "CAT_ID" => $cat_id,
+ "CAT_DESC" => $category_rows[$i]['cat_title'],
+
+ "U_CAT_EDIT" => append_sid("admin_forums.$phpEx?mode=editcat&cat_id=$cat_id"),
+ "U_CAT_DELETE" => append_sid("admin_forums.$phpEx?mode=deletecat&cat_id=$cat_id"),
+ "U_CAT_MOVE_UP" => append_sid("admin_forums.$phpEx?mode=cat_order&move=-15&cat_id=$cat_id"),
+ "U_CAT_MOVE_DOWN" => append_sid("admin_forums.$phpEx?mode=cat_order&move=15&cat_id=$cat_id"),
+ "U_VIEWCAT" => append_sid($phpbb_root_path."index.$phpEx?viewcat=$cat_id"))
+ );
+
+ for($j = 0; $j < $total_forums; $j++)
{
+ $forum_id = $forum_rows[$j]['forum_id'];
+
+ if ($forum_rows[$j]['cat_id'] == $cat_id)
+ {
- $template->assign_block_vars("catrow.forumrow", array(
- "FORUM_NAME" => $forum_rows[$j]['forum_name'],
- "FORUM_DESC" => $forum_rows[$j]['forum_desc'],
- "ROW_COLOR" => $row_color,
- "NUM_TOPICS" => $forum_rows[$j]['forum_topics'],
- "NUM_POSTS" => $forum_rows[$j]['forum_posts'],
+ $template->assign_block_vars("catrow.forumrow", array(
+ "FORUM_NAME" => $forum_rows[$j]['forum_name'],
+ "FORUM_DESC" => $forum_rows[$j]['forum_desc'],
+ "ROW_COLOR" => $row_color,
+ "NUM_TOPICS" => $forum_rows[$j]['forum_topics'],
+ "NUM_POSTS" => $forum_rows[$j]['forum_posts'],
- "U_VIEWFORUM" => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&" . $forum_rows[$j]['forum_posts']),
- "U_FORUM_EDIT" => append_sid("admin_forums.$phpEx?mode=editforum&forum_id=$forum_id"),
- "U_FORUM_DELETE" => append_sid("admin_forums.$phpEx?mode=deleteforum&forum_id=$forum_id"),
- "U_FORUM_MOVE_UP" => append_sid("admin_forums.$phpEx?mode=forum_order&move=-15&forum_id=$forum_id"),
- "U_FORUM_MOVE_DOWN" => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&forum_id=$forum_id"),
- "U_FORUM_RESYNC" => append_sid("admin_forums.$phpEx?mode=forum_sync&forum_id=$forum_id"))
- );
+ "U_VIEWFORUM" => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&" . $forum_rows[$j]['forum_posts']),
+ "U_FORUM_EDIT" => append_sid("admin_forums.$phpEx?mode=editforum&forum_id=$forum_id"),
+ "U_FORUM_DELETE" => append_sid("admin_forums.$phpEx?mode=deleteforum&forum_id=$forum_id"),
+ "U_FORUM_MOVE_UP" => append_sid("admin_forums.$phpEx?mode=forum_order&move=-15&forum_id=$forum_id"),
+ "U_FORUM_MOVE_DOWN" => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&forum_id=$forum_id"),
+ "U_FORUM_RESYNC" => append_sid("admin_forums.$phpEx?mode=forum_sync&forum_id=$forum_id"))
+ );
- }// if ... forumid == catid
-
- } // for ... forums
+ }// if ... forumid == catid
+
+ } // for ... forums
- } // for ... categories
+ } // for ... categories
+
+ }// if ... total_forums
}// if ... total_categories
diff --git a/phpBB/language/lang_english/lang_admin.php b/phpBB/language/lang_english/lang_admin.php
index 89d0930d62..11f2d9809d 100644
--- a/phpBB/language/lang_english/lang_admin.php
+++ b/phpBB/language/lang_english/lang_admin.php
@@ -277,6 +277,27 @@ $lang['Resync'] = "Resync";
$lang['No_mode'] = "No mode was set";
$lang['Forum_edit_delete_explain'] = "The form below will allow you to customize all the general board options. For User and Forum configurations use the related links on the left hand side";
+$lang['Move_contents'] = "Move all contents";
+$lang['Forum_delete'] = "Delete Forum";
+$lang['Forum_delete_explain'] = "The form below will allow you to delete a forum (or category) and decide where you want to put all topics (or forums) it contained.";
+
+$lang['Forum_settings'] = "General Forum Settings";
+$lang['Forum_name'] = "Forum name";
+$lang['Forum_desc'] = "Description";
+$lang['Forum_status'] = "Forum status";
+$lang['Forum_pruning'] = "Auto-pruning";
+
+$lang['Move_and_Delete'] = "Move and Delete";
+
+$lang['Delete_all_posts'] = "Delete all posts";
+$lang['Nowhere_to_move'] = "Nowhere to move too";
+
+$lang['Edit_Category'] = "Edit Category";
+$lang['Edit_Category_explain'] = "Use this form to modify a categories name.";
+
+$lang['Forums_updated'] = "Forum and Category information updated successfully";
+
+$lang['Click_return_forumadmin'] = "Click %sHere%s to return to Forum Administration";
//
// Smiley Management
diff --git a/phpBB/templates/subSilver/admin/category_edit_body.tpl b/phpBB/templates/subSilver/admin/category_edit_body.tpl
index 5ed799c590..eb99540e01 100644
--- a/phpBB/templates/subSilver/admin/category_edit_body.tpl
+++ b/phpBB/templates/subSilver/admin/category_edit_body.tpl
@@ -1,28 +1,21 @@
-
-
Use this form to modify a category.
+{L_EDIT_CATEGORY_EXPLAIN}
- -The form below will allow you to delete a forum/category and decide where you want to put all topics/forums inside that forum/category.
+{L_FORUM_DELETE_EXPLAIN}
- diff --git a/phpBB/templates/subSilver/admin/forum_edit_body.tpl b/phpBB/templates/subSilver/admin/forum_edit_body.tpl index 59cd4620f6..db795b5087 100644 --- a/phpBB/templates/subSilver/admin/forum_edit_body.tpl +++ b/phpBB/templates/subSilver/admin/forum_edit_body.tpl @@ -3,68 +3,48 @@{L_FORUM_EXPLAIN}
-