mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Changes to rank handling and the admin panel
- Removal of unneeded code - Deletions now require confirmation - A few miscellaneous bug fixes Note to translators: This adds a new language variable Note to designers: This adds a new template file git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5489 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c85e442a63
commit
cd887d4414
3 changed files with 92 additions and 118 deletions
|
@ -19,8 +19,6 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
|
||||
if( !empty($setmodules) )
|
||||
{
|
||||
$file = basename(__FILE__);
|
||||
|
@ -28,6 +26,8 @@ if( !empty($setmodules) )
|
|||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
|
||||
//
|
||||
// Let's set the root dir for phpBB
|
||||
//
|
||||
|
@ -37,7 +37,7 @@ require('./pagestart.' . $phpEx);
|
|||
|
||||
if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
||||
{
|
||||
$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
|
||||
$mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
|
||||
$mode = htmlspecialchars($mode);
|
||||
}
|
||||
else
|
||||
|
@ -214,7 +214,9 @@ if( $mode != "" )
|
|||
$rank_id = 0;
|
||||
}
|
||||
|
||||
if( $rank_id )
|
||||
$confirm = isset($HTTP_POST_VARS['confirm']);
|
||||
|
||||
if( $rank_id && $confirm )
|
||||
{
|
||||
$sql = "DELETE FROM " . RANKS_TABLE . "
|
||||
WHERE rank_id = $rank_id";
|
||||
|
@ -238,135 +240,95 @@ if( $mode != "" )
|
|||
message_die(GENERAL_MESSAGE, $message);
|
||||
|
||||
}
|
||||
elseif( $rank_id && !$confirm)
|
||||
{
|
||||
// Present the confirmation screen to the user
|
||||
$template->set_filenames(array(
|
||||
'body' => 'admin/confirm_body.tpl')
|
||||
);
|
||||
|
||||
$hidden_fields = '<input type="hidden" name="mode" value="delete" /><input type="hidden" name="id" value="' . $rank_id . '" />';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'MESSAGE_TITLE' => $lang['Confirm'],
|
||||
'MESSAGE_TEXT' => $lang['Confirm_delete_rank'],
|
||||
|
||||
'L_YES' => $lang['Yes'],
|
||||
'L_NO' => $lang['No'],
|
||||
|
||||
'S_CONFIRM_ACTION' => append_sid("admin_ranks.$phpEx"),
|
||||
'S_HIDDEN_FIELDS' => $hidden_fields)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['Must_select_rank']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// They didn't feel like giving us any information. Oh, too bad, we'll just display the
|
||||
// list then...
|
||||
//
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/ranks_list_body.tpl")
|
||||
);
|
||||
|
||||
$sql = "SELECT * FROM " . RANKS_TABLE . "
|
||||
ORDER BY rank_min, rank_title";
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
$template->pparse("body");
|
||||
|
||||
$rank_rows = $db->sql_fetchrowset($result);
|
||||
$rank_count = count($rank_rows);
|
||||
|
||||
$template->assign_vars(array(
|
||||
"L_RANKS_TITLE" => $lang['Ranks_title'],
|
||||
"L_RANKS_TEXT" => $lang['Ranks_explain'],
|
||||
"L_RANK" => $lang['Rank_title'],
|
||||
"L_RANK_MINIMUM" => $lang['Rank_minimum'],
|
||||
"L_SPECIAL_RANK" => $lang['Special_rank'],
|
||||
"L_EDIT" => $lang['Edit'],
|
||||
"L_DELETE" => $lang['Delete'],
|
||||
"L_ADD_RANK" => $lang['Add_new_rank'],
|
||||
"L_ACTION" => $lang['Action'],
|
||||
|
||||
"S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))
|
||||
);
|
||||
|
||||
for( $i = 0; $i < $rank_count; $i++)
|
||||
{
|
||||
$rank = $rank_rows[$i]['rank_title'];
|
||||
$special_rank = $rank_rows[$i]['rank_special'];
|
||||
$rank_id = $rank_rows[$i]['rank_id'];
|
||||
$rank_min = $rank_rows[$i]['rank_min'];
|
||||
|
||||
if($special_rank)
|
||||
{
|
||||
$rank_min = $rank_max = "-";
|
||||
}
|
||||
|
||||
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
|
||||
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
|
||||
|
||||
$template->assign_block_vars("ranks", array(
|
||||
"ROW_COLOR" => "#" . $row_color,
|
||||
"ROW_CLASS" => $row_class,
|
||||
"RANK" => $rank,
|
||||
"RANK_MIN" => $rank_min,
|
||||
|
||||
"SPECIAL_RANK" => ( $special_rank == 1 ) ? $lang['Yes'] : $lang['No'],
|
||||
|
||||
"U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&id=$rank_id"),
|
||||
"U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&id=$rank_id"))
|
||||
);
|
||||
}
|
||||
}
|
||||
include('./page_footer_admin.'.$phpEx);
|
||||
}
|
||||
else
|
||||
|
||||
//
|
||||
// Show the default page
|
||||
//
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/ranks_list_body.tpl")
|
||||
);
|
||||
|
||||
$sql = "SELECT * FROM " . RANKS_TABLE . "
|
||||
ORDER BY rank_min ASC, rank_special ASC";
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
{
|
||||
//
|
||||
// Show the default page
|
||||
//
|
||||
$template->set_filenames(array(
|
||||
"body" => "admin/ranks_list_body.tpl")
|
||||
);
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
$rank_count = $db->sql_numrows($result);
|
||||
|
||||
$sql = "SELECT * FROM " . RANKS_TABLE . "
|
||||
ORDER BY rank_min ASC, rank_special ASC";
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
$rank_rows = $db->sql_fetchrowset($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
"L_RANKS_TITLE" => $lang['Ranks_title'],
|
||||
"L_RANKS_TEXT" => $lang['Ranks_explain'],
|
||||
"L_RANK" => $lang['Rank_title'],
|
||||
"L_RANK_MINIMUM" => $lang['Rank_minimum'],
|
||||
"L_SPECIAL_RANK" => $lang['Rank_special'],
|
||||
"L_EDIT" => $lang['Edit'],
|
||||
"L_DELETE" => $lang['Delete'],
|
||||
"L_ADD_RANK" => $lang['Add_new_rank'],
|
||||
"L_ACTION" => $lang['Action'],
|
||||
|
||||
"S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))
|
||||
);
|
||||
|
||||
for($i = 0; $i < $rank_count; $i++)
|
||||
{
|
||||
$rank = $rank_rows[$i]['rank_title'];
|
||||
$special_rank = $rank_rows[$i]['rank_special'];
|
||||
$rank_id = $rank_rows[$i]['rank_id'];
|
||||
$rank_min = $rank_rows[$i]['rank_min'];
|
||||
|
||||
if( $special_rank == 1 )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);
|
||||
$rank_min = $rank_max = "-";
|
||||
}
|
||||
$rank_count = $db->sql_numrows($result);
|
||||
|
||||
$rank_rows = $db->sql_fetchrowset($result);
|
||||
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
|
||||
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
|
||||
|
||||
$template->assign_vars(array(
|
||||
"L_RANKS_TITLE" => $lang['Ranks_title'],
|
||||
"L_RANKS_TEXT" => $lang['Ranks_explain'],
|
||||
"L_RANK" => $lang['Rank_title'],
|
||||
"L_RANK_MINIMUM" => $lang['Rank_minimum'],
|
||||
"L_SPECIAL_RANK" => $lang['Rank_special'],
|
||||
"L_EDIT" => $lang['Edit'],
|
||||
"L_DELETE" => $lang['Delete'],
|
||||
"L_ADD_RANK" => $lang['Add_new_rank'],
|
||||
"L_ACTION" => $lang['Action'],
|
||||
$rank_is_special = ( $special_rank ) ? $lang['Yes'] : $lang['No'];
|
||||
|
||||
"S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))
|
||||
$template->assign_block_vars("ranks", array(
|
||||
"ROW_COLOR" => "#" . $row_color,
|
||||
"ROW_CLASS" => $row_class,
|
||||
"RANK" => $rank,
|
||||
"SPECIAL_RANK" => $rank_is_special,
|
||||
"RANK_MIN" => $rank_min,
|
||||
|
||||
"U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&id=$rank_id"),
|
||||
"U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&id=$rank_id"))
|
||||
);
|
||||
|
||||
for($i = 0; $i < $rank_count; $i++)
|
||||
{
|
||||
$rank = $rank_rows[$i]['rank_title'];
|
||||
$special_rank = $rank_rows[$i]['rank_special'];
|
||||
$rank_id = $rank_rows[$i]['rank_id'];
|
||||
$rank_min = $rank_rows[$i]['rank_min'];
|
||||
|
||||
if( $special_rank == 1 )
|
||||
{
|
||||
$rank_min = $rank_max = "-";
|
||||
}
|
||||
|
||||
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
|
||||
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
|
||||
|
||||
$rank_is_special = ( $special_rank ) ? $lang['Yes'] : $lang['No'];
|
||||
|
||||
$template->assign_block_vars("ranks", array(
|
||||
"ROW_COLOR" => "#" . $row_color,
|
||||
"ROW_CLASS" => $row_class,
|
||||
"RANK" => $rank,
|
||||
"SPECIAL_RANK" => $rank_is_special,
|
||||
"RANK_MIN" => $rank_min,
|
||||
|
||||
"U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&id=$rank_id"),
|
||||
"U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&id=$rank_id"))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$template->pparse("body");
|
||||
|
|
|
@ -557,6 +557,7 @@ $lang['No_update_ranks'] = 'The rank was successfully deleted. However, user acc
|
|||
|
||||
$lang['Click_return_rankadmin'] = 'Click %sHere%s to return to Rank Administration';
|
||||
|
||||
$lang['Confirm_delete_rank'] = 'Are you sure you want to delete this rank?';
|
||||
|
||||
//
|
||||
// Disallow Username Admin
|
||||
|
|
11
phpBB/templates/subSilver/admin/confirm_body.tpl
Executable file
11
phpBB/templates/subSilver/admin/confirm_body.tpl
Executable file
|
@ -0,0 +1,11 @@
|
|||
|
||||
<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
|
||||
<tr>
|
||||
<th class="thHead" height="25" valign="middle"><span class="tableTitle">{MESSAGE_TITLE}</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><form action="{S_CONFIRM_ACTION}" method="post"><span class="gen"><br />{MESSAGE_TEXT}<br /><br />{S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{L_YES}" class="mainoption" /> <input type="submit" name="cancel" value="{L_NO}" class="liteoption" /></span></form></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br clear="all" />
|
Loading…
Add table
Reference in a new issue