diff --git a/upload/admin/admin_attach_cp.php b/upload/admin/admin_attach_cp.php index 36e0e33d9..d7c54dac8 100644 --- a/upload/admin/admin_attach_cp.php +++ b/upload/admin/admin_attach_cp.php @@ -440,16 +440,7 @@ if ($view == 'attachments') WHERE a.attach_id IN (" . implode(', ', $attach_id) . ") " . $order_by; - } - else if ($search_based) - { - // we are called from search - $attachments = search_attachments($order_by, $total_rows); - } - - if (!$search_based) - { - if ( !($result = DB()->sql_query($sql)) ) + if ( !($result = DB()->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql); } @@ -458,6 +449,11 @@ if ($view == 'attachments') $num_attach = DB()->num_rows($result); DB()->sql_freeresult($result); } + else + { + // we are called from search + $attachments = search_attachments($order_by, $total_rows); + } if (sizeof($attachments) > 0) { diff --git a/upload/includes/ucp/usercp_register.php b/upload/includes/ucp/usercp_register.php index 1be0074ec..32fcbb452 100644 --- a/upload/includes/ucp/usercp_register.php +++ b/upload/includes/ucp/usercp_register.php @@ -311,8 +311,11 @@ foreach ($profile_fields as $field => $can_edit) { $errors[] = $err; } - $pr_data['user_active'] = 0; - $db_data['user_active'] = 0; + if ($bb_cfg['require_activation'] == USER_ACTIVATION_SELF || $bb_cfg['require_activation'] == USER_ACTIVATION_ADMIN) + { + $pr_data['user_active'] = 0; + $db_data['user_active'] = 0; + } $db_data['user_email'] = $email; } }