value('user_id')) { header_redirect('members_area.php'); } else { include_once ('global_header.php'); $template->set('box_top', box_top('Register')); $template->set('box_bottom', box_bottom()); /* From here we load the custom registration sections */ (string) $custom_sections_table = null; $user = new user(); $user->setts = &$setts;## now we will save all post variables selected //$user->save_vars($_POST); $form_submitted = FALSE;## if save button is pressed, proceed if ($_REQUEST['operation'] == 'submit') { define ('FRMCHK_USER', 1); (bool) $frmchk_user_edit = 0; $frmchk_details = $_POST; include ('includes/procedure_frmchk_user.php'); /* Formchecker for user creation/edit */ if ($fv->is_error()) { $template->set('display_formcheck_errors', $fv->display_errors()); } else { $form_submitted = TRUE;## we wont create any emails either until we decide how many ways of registration we have. (string) $register_success_message = null; $user_id = $user->insert($_POST); // instant activation $sql_update_user = $db->query("UPDATE " . DB_PREFIX . "users SET active=1, approved=1 WHERE user_id=" . $user_id); $message_content = '

' . MSG_REGISTER_SUCCESS_TYPE0 . '

';## include registration success email $mail_input_id = $user_id; include('language/' . $setts['site_lang'] . '/mails/register_success_no_fee_user_notification.php'); $template->set('message_content', $message_content); $template->set('box_top', box_top('Register')); $template->set('box_bottom', box_bottom()); $template_output .= $template->process('single_message.tpl.php'); } } if (!$form_submitted) { $template->set('register_post_url', 'register.php'); $template->set('proceed_button', GMSG_REGISTER_BTN); $template->set('user_details', $_POST); $post_country = ($_POST['country']) ? $_POST['country'] : $db->get_sql_field("SELECT c.id FROM " . DB_PREFIX . "countries c WHERE c.parent_id=0 ORDER BY c.country_order ASC, c.name ASC LIMIT 1", 'id'); $template->set('country_dropdown', $user->countries_dropdown('country', $post_country, 'registration_form')); $template->set('state_box', $user->states_box('state', $_POST['state'], $post_country)); $template->set('birthdate_box', $user->birthdate_box($_POST)); $session->set('pin_value', md5(rand(2,99999999))); $generated_pin = generate_pin($session->value('pin_value')); $pin_image_output = show_pin_image($session->value('pin_value'), $generated_pin); $template->set('pin_image_output', $pin_image_output); $template->set('pin_value', $session->value('pin_value')); //$template->set('registration_terms_box', terms_box('registration', $_POST['agree_terms'])); $template_output .= $template->process('register.tpl.php'); } /*$news_listing = new news; $news_listing->start = $start; $news_listing->limit = 3; $news_listing->image_position = 3; $news_listing->template_path = 'themes/' . $setts['default_theme'] . '/templates/modules/news/'; $news_listing->template_file = 'news_listing.tpl.php'; $items = $news_listing->ListItems(); $paginate = $news_listing->GetPaginate(); $template->set('items', $items); $template->set('paginate', $paginate); $template_output .= $template->process('news.tpl.php');*/ include_once ('global_footer.php'); echo $template_output; } ?>