fixed bug #1446, #1418 and memberlist joined sort order

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3542 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2003-02-26 11:19:25 +00:00
parent 3cac26f65c
commit e3138ed2c4
4 changed files with 22 additions and 16 deletions

View file

@ -30,7 +30,7 @@ if( !empty($setmodules) )
return; return;
} }
$phpbb_root_path = "./../"; $phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx); require('./pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/bbcode.'.$phpEx); require($phpbb_root_path . 'includes/bbcode.'.$phpEx);
@ -56,14 +56,14 @@ else
// //
// Begin program // Begin program
// //
if( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_GET_VARS[POST_USERS_URL]) || isset( $HTTP_POST_VARS[POST_USERS_URL]) ) ) if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_GET_VARS[POST_USERS_URL]) || isset( $HTTP_POST_VARS[POST_USERS_URL]) ) )
{ {
// //
// Ok, the profile has been modified and submitted, let's update // Ok, the profile has been modified and submitted, let's update
// //
if( ( $mode == 'save' && isset( $HTTP_POST_VARS['submit'] ) ) || isset( $HTTP_POST_VARS['avatargallery'] ) || isset( $HTTP_POST_VARS['submitavatar'] ) || isset( $HTTP_POST_VARS['cancelavatar'] ) ) if ( ( $mode == 'save' && isset( $HTTP_POST_VARS['submit'] ) ) || isset( $HTTP_POST_VARS['avatargallery'] ) || isset( $HTTP_POST_VARS['submitavatar'] ) || isset( $HTTP_POST_VARS['cancelavatar'] ) )
{ {
$user_id = intval( $HTTP_POST_VARS['id'] ); $user_id = intval($HTTP_POST_VARS['id']);
if (!($this_userdata = get_userdata($user_id))) if (!($this_userdata = get_userdata($user_id)))
{ {
@ -304,24 +304,28 @@ if( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) |
$error = FALSE; $error = FALSE;
if( stripslashes($username) != $this_userdata['username'] ) if (stripslashes($username) != $this_userdata['username'])
{ {
unset($rename_user); unset($rename_user);
$result = validate_username($username); if ( stripslashes(strtolower($username)) != strtolower($this_userdata['username']) )
if ( $result['error'] )
{ {
$error = TRUE; $result = validate_username($username);
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $result['error_msg']; if ( $result['error'] )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $result['error_msg'];
}
} }
else
if (!$error)
{ {
$username_sql = "username = '" . str_replace("\'", "''", $username) . "', "; $username_sql = "username = '" . str_replace("\'", "''", $username) . "', ";
$rename_user = $username; // Used for renaming usergroup $rename_user = $username; // Used for renaming usergroup
} }
} }
$passwd_sql = ""; $passwd_sql = '';
if( !empty($password) && !empty($password_confirm) ) if( !empty($password) && !empty($password_confirm) )
{ {
// //
@ -349,7 +353,7 @@ if( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) |
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch']; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch'];
} }
if( $signature != "" ) if ($signature != '')
{ {
$sig_length_check = preg_replace('/(\[.*?)(=.*?)\]/is', '\\1]', stripslashes($signature)); $sig_length_check = preg_replace('/(\[.*?)(=.*?)\]/is', '\\1]', stripslashes($signature));
if ( $allowhtml ) if ( $allowhtml )
@ -1127,4 +1131,4 @@ else
include('./page_footer_admin.'.$phpEx); include('./page_footer_admin.'.$phpEx);
?> ?>

View file

@ -960,4 +960,4 @@ $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?> ?>

View file

@ -117,7 +117,7 @@ $template->assign_vars(array(
switch( $mode ) switch( $mode )
{ {
case 'joined': case 'joined':
$order_by = "user_regdate ASC LIMIT $start, " . $board_config['topics_per_page']; $order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
break; break;
case 'username': case 'username':
$order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page']; $order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page'];
@ -306,4 +306,4 @@ $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?> ?>

View file

@ -61,7 +61,9 @@
</table> </table>
<table width="100%" cellpadding="1" cellspacing="1" border="0"> <table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td> <td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table> </table>
<!-- BEGIN switch_user_logged_out --> <!-- BEGIN switch_user_logged_out -->