|
From: Paul S. O. <ps...@us...> - 2001-11-19 21:57:54
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv3124/admin
Modified Files:
admin_forums.php
Log Message:
More lang updates
Index: admin_forums.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_forums.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** admin_forums.php 2001/10/30 23:44:39 1.25
--- admin_forums.php 2001/11/19 21:57:50 1.26
***************
*** 77,84 ****
$count = $count['total'];
-
$sql = "SELECT *
FROM $table
! WHERE $idfield = $id";
if( !$result = $db->sql_query($sql) )
{
--- 77,84 ----
$count = $count['total'];
$sql = "SELECT *
FROM $table
! WHERE $idfield = $id";
!
if( !$result = $db->sql_query($sql) )
{
***************
*** 290,305 ****
);
$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_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_ENABLED' => $lang['Enabled'],
'L_PRUNE_DAYS' => $lang['prune_days'],
--- 290,311 ----
);
+ $s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode .'" /><input type="hidden" name="forum_id" value="' . $forum_id . '" />';
+
$template->assign_vars(array(
'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"),
! "S_HIDDEN_FIELDS" => $s_hidden_fields,
! 'S_SUBMIT_VALUE' => $buttonvalue,
! 'S_CAT_LIST' => $catlist,
! 'S_STATUS_LIST' => $statuslist,
'S_PRUNE_ENABLED' => $prune_enabled,
"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'],
***************
*** 307,313 ****
'L_DAYS' => $lang['days'],
! 'FORUMNAME' => $forumname,
! 'DESCRIPTION' => $forumdesc,
! 'BUTTONVALUE' => $buttonvalue)
);
$template->pparse("body");
--- 313,320 ----
'L_DAYS' => $lang['days'],
! '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");
***************
*** 325,329 ****
$sql = "SELECT MAX(forum_order) AS max_order
FROM " . FORUMS_TABLE . "
! WHERE cat_id = " . $HTTP_POST_VARS['cat_id'];
if( !$result = $db->sql_query($sql) )
{
--- 332,336 ----
$sql = "SELECT MAX(forum_order) AS max_order
FROM " . FORUMS_TABLE . "
! WHERE cat_id = " . intval($HTTP_POST_VARS['cat_id']);
if( !$result = $db->sql_query($sql) )
{
***************
*** 371,387 ****
}
! $show_index = TRUE;
break;
case 'modforum':
// Modify a forum in the DB
! 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'];
if( !$result = $db->sql_query($sql) )
{
--- 378,400 ----
}
! $message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
!
! message_die(GENERAL_MESSAGE, $message);
!
break;
case 'modforum':
// Modify a forum in the DB
! if( isset($HTTP_POST_VARS['prune_enable']))
{
! 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 = " . 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) )
{
***************
*** 398,402 ****
$sql = "SELECT *
FROM " . PRUNE_TABLE . "
! WHERE forum_id = " . $HTTP_POST_VARS['forum_id'];
if( !$result = $db->sql_query($sql) )
{
--- 411,415 ----
$sql = "SELECT *
FROM " . PRUNE_TABLE . "
! WHERE forum_id = " . intval($HTTP_POST_VARS['forum_id']);
if( !$result = $db->sql_query($sql) )
{
***************
*** 407,417 ****
{
$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'];
}
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'] . ")";
}
--- 420,430 ----
{
$sql = "UPDATE " . PRUNE_TABLE . "
! 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(" . intval($HTTP_POST_VARS['forum_id']) . ", " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")";
}
***************
*** 421,425 ****
}
}
! $show_index = TRUE;
break;
--- 434,442 ----
}
}
!
! $message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
!
! message_die(GENERAL_MESSAGE, $message);
!
break;
***************
*** 452,464 ****
}
! $show_index = TRUE;
break;
case 'editcat':
// Show form to edit a category
$newmode = 'modcat';
! $buttonvalue = 'Change';
- $cat_id = $HTTP_GET_VARS['cat_id'];
$row = get_info('category', $cat_id);
$cat_title = $row['cat_title'];
--- 469,487 ----
}
! $message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
!
! message_die(GENERAL_MESSAGE, $message);
!
break;
case 'editcat':
+ //
// Show form to edit a category
+ //
$newmode = 'modcat';
! $buttonvalue = $lang['Update'];
!
! $cat_id = intval($HTTP_GET_VARS['cat_id']);
$row = get_info('category', $cat_id);
$cat_title = $row['cat_title'];
***************
*** 467,476 ****
"body" => "admin/category_edit_body.tpl")
);
$template->assign_vars(array(
! 'CAT_TITLE' => $cat_title,
! 'S_CATID' => $cat_id,
! 'S_NEWMODE' => $newmode,
! 'BUTTONVALUE' => $buttonvalue)
);
$template->pparse("body");
break;
--- 490,508 ----
"body" => "admin/category_edit_body.tpl")
);
+
+ $s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="cat_id" value="' . $cat_id . '" />';
+
$template->assign_vars(array(
! "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;
***************
*** 480,500 ****
$sql = "UPDATE " . CATEGORIES_TABLE . "
SET cat_title = '" . $HTTP_POST_VARS['cat_title'] . "'
! WHERE cat_id = " . $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;
break;
case 'deleteforum':
// Show form to delete a forum
! $forum_id = $HTTP_GET_VARS['forum_id'];
$select_to = '<select name="to_id">';
! $select_to .= "<option value=\"-1\"$s>Delete all posts</option>\n";
$select_to .= get_list('forum', $forum_id, 0);
$select_to .= '</select>';
! $buttonvalue = "Move&Delete";
$newmode = 'movedelforum';
$foruminfo = get_info('forum', $forum_id);
$name = $foruminfo['forum_name'];
--- 512,540 ----
$sql = "UPDATE " . CATEGORIES_TABLE . "
SET cat_title = '" . $HTTP_POST_VARS['cat_title'] . "'
! 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);
}
!
! $message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
!
! message_die(GENERAL_MESSAGE, $message);
!
break;
case 'deleteforum':
// Show form to delete a forum
! $forum_id = intval($HTTP_GET_VARS['forum_id']);
!
$select_to = '<select name="to_id">';
! $select_to .= "<option value=\"-1\"$s>" . $lang['Delete_all_posts'] . "</option>\n";
$select_to .= get_list('forum', $forum_id, 0);
$select_to .= '</select>';
!
! $buttonvalue = $lang['Move_and_Delete'];
!
$newmode = 'movedelforum';
+
$foruminfo = get_info('forum', $forum_id);
$name = $foruminfo['forum_name'];
***************
*** 503,514 ****
"body" => "admin/forum_delete_body.tpl")
);
$template->assign_vars(array(
! 'NAME' => $name,
! 'S_FORUM_ACTION' => $PHP_SELF,
! 'S_FROM_ID' => $forum_id,
'S_SELECT_TO' => $select_to,
! 'S_NEWMODE' => $newmode,
! 'BUTTONVALUE' => $buttonvalue)
);
$template->pparse("body");
break;
--- 543,562 ----
"body" => "admin/forum_delete_body.tpl")
);
+
+ $s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="from_id" value="' . $forum_id . '" />';
+
$template->assign_vars(array(
! "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_SUBMIT_VALUE' => $buttonvalue)
);
+
$template->pparse("body");
break;
***************
*** 522,526 ****
$delete_old = intval($HTTP_POST_VARS['delete_old']);
-
// Either delete or move all posts in a forum
if($to_id == -1)
--- 570,573 ----
***************
*** 566,570 ****
}
! $show_index = TRUE;
break;
--- 613,619 ----
}
! $message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
!
! message_die(GENERAL_MESSAGE, $message);
break;
***************
*** 576,580 ****
$cat_id = intval($HTTP_GET_VARS['cat_id']);
! $buttonvalue = "Move&Delete";
$newmode = 'movedelcat';
$catinfo = get_info('category', $cat_id);
--- 625,629 ----
$cat_id = intval($HTTP_GET_VARS['cat_id']);
! $buttonvalue = $lang['Move_and_Delete'];
$newmode = 'movedelcat';
$catinfo = get_info('category', $cat_id);
***************
*** 598,602 ****
else
{
! $select_to = 'Nowhere to move';
}
}
--- 647,651 ----
else
{
! $select_to = $lang['Nowhere_to_move'];
}
}
***************
*** 611,622 ****
"body" => "admin/forum_delete_body.tpl")
);
$template->assign_vars(array(
! 'NAME' => $name,
'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"),
- 'S_FROM_ID' => $cat_id,
'S_SELECT_TO' => $select_to,
! 'S_NEWMODE' => $newmode,
! 'BUTTONVALUE' => $buttonvalue)
);
$template->pparse("body");
break;
--- 660,679 ----
"body" => "admin/forum_delete_body.tpl")
);
+
+ $s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="from_id" value="' . $cat_id . '" />';
+
$template->assign_vars(array(
! "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_SUBMIT_VALUE' => $buttonvalue)
);
+
$template->pparse("body");
break;
***************
*** 659,664 ****
}
! $show_index = TRUE;
break;
--- 716,723 ----
}
! $message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
+ message_die(GENERAL_MESSAGE, $message);
+
break;
***************
*** 717,720 ****
--- 776,780 ----
break;
}
+
if ($show_index != TRUE)
{
***************
*** 763,826 ****
}
- 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++)
! {
! $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'],
!
! "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
! } // for ... categories
}// if ... total_categories
--- 823,882 ----
}
$forum_rows = $db->sql_fetchrowset($q_forums);
! if( $total_forums = $db->sql_numrows($q_forums) )
! {
! //
! // Okay, let's build the index
! //
! $gen_cat = array();
! for($i = 0; $i < $total_categories; $i++)
{
! $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'],
!
! "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
!
! } // for ... categories
! }// if ... total_forums
}// if ... total_categories
|