PageRenderTime 42ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/membership/app_old/membershipincludes/includes/bp.registration.form.php

https://gitlab.com/najomie/fit-hippie
PHP | 194 lines | 128 code | 65 blank | 1 comment | 34 complexity | 15b36656cd2f28e37b2acabae1e95de2 MD5 | raw file
  1. <?php
  2. if(is_wp_error($error) && method_exists($error, 'get_error_code')) {
  3. $anyerrors = $error->get_error_code();
  4. if( !empty($anyerrors) ) {
  5. // we have an error - output
  6. $messages = $error->get_error_messages();
  7. $errormessages = "<div class='alert alert-error'>";
  8. $errormessages .= implode('<br/>', $messages);
  9. $errormessages .= "</div>";
  10. } else {
  11. $errormessages = '';
  12. }
  13. } else {
  14. $errormessages = '';
  15. }
  16. ?>
  17. <form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
  18. <input type='hidden' name='subscription' value='<?php echo esc_attr($_REQUEST['subscription']); ?>' />
  19. <h2><?php _e( 'Create an Account', 'membership' ) ?></h2>
  20. <?php do_action( 'template_notices' ) ?>
  21. <?php
  22. if(!empty($errormessages)) {
  23. echo $errormessages;
  24. }
  25. ?>
  26. <p><?php _e( 'Registering for this site is easy, just fill in the fields below and we\'ll get a new account set up for you in no time.', 'membership' ) ?></p>
  27. <?php do_action( 'bp_before_account_details_fields' ) ?>
  28. <div class="register-section" id="basic-details-section">
  29. <?php /***** Basic Account Details ******/ ?>
  30. <h4><?php _e( 'Account Details', 'membership' ) ?></h4>
  31. <label for="signup_username"><?php _e( 'Username', 'membership' ) ?> <?php _e( '(required)', 'membership' ) ?></label>
  32. <?php do_action( 'bp_signup_username_errors' ) ?>
  33. <input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
  34. <label for="signup_email"><?php _e( 'Email Address', 'membership' ) ?> <?php _e( '(required)', 'membership' ) ?></label>
  35. <?php do_action( 'bp_signup_email_errors' ) ?>
  36. <input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
  37. <label for="signup_password"><?php _e( 'Choose a Password', 'membership' ) ?> <?php _e( '(required)', 'membership' ) ?></label>
  38. <?php do_action( 'bp_signup_password_errors' ) ?>
  39. <input type="password" name="signup_password" id="signup_password" value="" />
  40. <label for="signup_password_confirm"><?php _e( 'Confirm Password', 'membership' ) ?> <?php _e( '(required)', 'membership' ) ?></label>
  41. <?php do_action( 'bp_signup_password_confirm_errors' ) ?>
  42. <input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" />
  43. </div><!-- #basic-details-section -->
  44. <?php do_action( 'bp_after_account_details_fields' ) ?>
  45. <?php /***** Extra Profile Details ******/ ?>
  46. <?php if ( bp_is_active( 'xprofile' ) ) : ?>
  47. <?php do_action( 'bp_before_signup_profile_fields' ) ?>
  48. <div class="register-section" id="profile-details-section">
  49. <h4><?php _e( 'Profile Details', 'membership' ) ?></h4>
  50. <?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
  51. <?php if ( function_exists('bp_is_active') && bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( 'profile_group_id=1&hide_empty_fields=0' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
  52. <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
  53. <div class="editfield">
  54. <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
  55. <label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'membership' ) ?><?php endif; ?></label>
  56. <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
  57. <input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="<?php bp_the_profile_field_edit_value() ?>" />
  58. <?php endif; ?>
  59. <?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
  60. <label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'membership' ) ?><?php endif; ?></label>
  61. <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
  62. <textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_edit_value() ?></textarea>
  63. <?php endif; ?>
  64. <?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>
  65. <label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'membership' ) ?><?php endif; ?></label>
  66. <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
  67. <select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
  68. <?php bp_the_profile_field_options() ?>
  69. </select>
  70. <?php endif; ?>
  71. <?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
  72. <label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'membership' ) ?><?php endif; ?></label>
  73. <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
  74. <select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" multiple="multiple">
  75. <?php bp_the_profile_field_options() ?>
  76. </select>
  77. <?php endif; ?>
  78. <?php if ( 'radio' == bp_get_the_profile_field_type() ) : ?>
  79. <div class="radio">
  80. <span class="label"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'membership' ) ?><?php endif; ?></span>
  81. <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
  82. <?php bp_the_profile_field_options() ?>
  83. <?php if ( !bp_get_the_profile_field_is_required() ) : ?>
  84. <a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name() ?>' );"><?php _e( 'Clear', 'membership' ) ?></a>
  85. <?php endif; ?>
  86. </div>
  87. <?php endif; ?>
  88. <?php if ( 'checkbox' == bp_get_the_profile_field_type() ) : ?>
  89. <div class="checkbox">
  90. <span class="label"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'membership' ) ?><?php endif; ?></span>
  91. <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
  92. <?php bp_the_profile_field_options() ?>
  93. </div>
  94. <?php endif; ?>
  95. <?php if ( 'datebox' == bp_get_the_profile_field_type() ) : ?>
  96. <div class="datebox">
  97. <label for="<?php bp_the_profile_field_input_name() ?>_day"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'membership' ) ?><?php endif; ?></label>
  98. <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
  99. <select name="<?php bp_the_profile_field_input_name() ?>_day" id="<?php bp_the_profile_field_input_name() ?>_day">
  100. <?php bp_the_profile_field_options( 'type=day' ) ?>
  101. </select>
  102. <select name="<?php bp_the_profile_field_input_name() ?>_month" id="<?php bp_the_profile_field_input_name() ?>_month">
  103. <?php bp_the_profile_field_options( 'type=month' ) ?>
  104. </select>
  105. <select name="<?php bp_the_profile_field_input_name() ?>_year" id="<?php bp_the_profile_field_input_name() ?>_year">
  106. <?php bp_the_profile_field_options( 'type=year' ) ?>
  107. </select>
  108. </div>
  109. <?php endif; ?>
  110. <?php do_action( 'bp_custom_profile_edit_fields' ) ?>
  111. <p class="description"><?php bp_the_profile_field_description() ?></p>
  112. </div>
  113. <?php endwhile; ?>
  114. <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids() ?>" />
  115. <?php endwhile; endif; endif; ?>
  116. </div><!-- #profile-details-section -->
  117. <?php do_action( 'bp_after_signup_profile_fields' ) ?>
  118. <?php endif; ?>
  119. <?php do_action( 'bp_before_registration_submit_buttons' ) ?>
  120. <div class="submit">
  121. <input type="submit"name="signup_submit" id="signup_submit" value="<?php _e( 'Sign Up', 'membership' ) ?> &rarr;" />
  122. </div>
  123. <?php do_action( 'bp_after_registration_submit_buttons' ) ?>
  124. <?php wp_nonce_field( 'bp_new_signup' ) ?>
  125. <?php do_action( 'bp_custom_signup_steps' ) ?>
  126. <input type="hidden" name="action" value="validatepage1bp" />
  127. </form>
  128. <?php
  129. ?>