$user_password = $user->user_password_crypt($user_password); } else { $user_password = $user->user_info['user_password']; } // SET USERNAME TO THE SAME IT WAS BEFORE IF NECESSARY if (!$setting[setting_username]) { $user_username = $user->user_info['user_username']; } // EDIT USER AND REFRESH USER DATA $database->database_query("UPDATE se_users SET user_level_id='{$user_level_id}', user_subnet_id='" . $user->user_info[user_subnet_id] . "', user_profilecat_id='{$user_profilecat_id}', user_email='{$user_email}', user_newemail='{$user_email}', user_username='******', user_password='******', user_enabled='{$user_enabled}', user_invitesleft='{$user_invitesleft}' WHERE user_id='" . $user->user_info[user_id] . "'"); $user = new se_user(array($user->user_info[user_id])); } } // SET USER STATS $total_friends = $database->database_num_rows($database->database_query("SELECT friend_id FROM se_friends WHERE friend_user_id1='" . $user->user_info[user_id] . "'")); $total_messages = $total_pms = $user->user_message_total(0, 0); // LOOP THROUGH COMMENT TABLES TO GET TOTAL COMMENTS $total_comments = 0; $comment_tables = $database->database_query("SHOW TABLES FROM `{$database_name}` LIKE 'se_%comments'"); while ($table_info = $database->database_fetch_array($comment_tables)) { $comment_type = strrev(substr(strrev(substr($table_info[0], 3)), 8)); $table_comments = $database->database_fetch_assoc($database->database_query("SELECT count(*) AS total_comments FROM se_" . $comment_type . "comments WHERE " . $comment_type . "comment_authoruser_id='" . $user->user_info[user_id] . "'")); $total_comments += $table_comments[total_comments]; } // GET USER LEVEL ARRAY $levels = $database->database_query("SELECT level_id, level_name FROM se_levels ORDER BY level_name"); while ($level_info = $database->database_fetch_assoc($levels)) { $level_array[] = $level_info; } // GET PROFILECAT ARRAY $cats = $database->database_query("SELECT profilecat_id AS cat_id, profilecat_title AS cat_title FROM se_profilecats WHERE profilecat_dependency='0' ORDER BY profilecat_order");