• Resolved schwarzgrau

    (@schwarzgrau)


    I tried to use Theme My Login in combination with Register Plus Redux.
    Register Plus Redux just to easily create the additional input fields on the registration.
    If I got Theme My Login activated the additional fields are at the register page and in the profile, but the values from the register didn’t show up at the profile.
    Do you know if there is some general incompatibility between Theme My Login and Register Plus Redux?

    https://www.ads-software.com/extend/plugins/theme-my-login/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter schwarzgrau

    (@schwarzgrau)

    I added the custom select-fields in the theme-my-login-custom.php and removed Register Plus Redux.
    But if you find time to add it, the function to add custom fields in Theme My Login could be very useful.

    hi schwarzgrau, I am looking for the same. Could you pls tell me how did you achieve it. Would greatly appreciate if you can give me the step-by-step as I am a novice in PHP coding.Thanks

    Thread Starter schwarzgrau

    (@schwarzgrau)

    Just tell me what you trying to add. Cause you need to handle non-text input a bit different than text input.
    Another option is to add a field, which is only used in the mail to the admin and doesn’t show up on the profile.

    Thank you for your swift response.
    Now I have a much bigger problem. Before pinging you, I followed the below mentioned link
    https://www.jfarthing.com/development/theme-my-login/adding-extra-registration-fields/

    and added the first and last name fields to the registration page. It didn’t work when I click on the registration link but only the registration button. so I deleted the changes I made – I mean deleted the register.php from my theme folder and also deleted the ..custom.php file as well. After that, now I am not even getting the login page. I deleted and added TML again, still the same. Any thoughts?

    Here’s my website..its in it preliminary stage, so you wouldn’t see anything except the login page:
    Site

    Regarding the fields in the registration page, I would like to include the following:

    First Name
    Last Name
    Captcha
    Password strength indicator (is it possible?)
    Photo upload.

    Btw, am using 6.2.3

    Thank you so very much for your help.

    Thread Starter schwarzgrau

    (@schwarzgrau)

    I expected something like gender or maybe age, but a captcha, a password strength indicator and a photo upload are things I can’t help you with.
    I integrated Simple-Local-Avatars in my registration page, but that took me two or three days and it’s not that simple to explain. If you want to use the photo upload for an avatar too I could send you my code.

    However, first-name and last-name are fairly simple and maybe this gives you a good starting point.

    1. duplicate the template-file called register-form.php from the plugin-contents to your theme and reference it in the shortcode
    2. open register-form.php and search for this line
      <p>
      <label for="user_email<?php $template->the_instance(); ?>"><?php _e( 'E-mail', 'theme-my-login' ) ?></label>
                  <input type="text" name="user_email" id="user_email<?php $template->the_instance(); ?>" class="input" value="<?php $template->the_posted_value( 'user_email' ); ?>" size="20" />
              </p>

      paste this text-block underneath it:

      <p>
                  <label for="first_name<?php $template->the_instance(); ?>">First Name</label>
                  <input type="text" name="first_name" id="first_name<?php $template->the_instance(); ?>" class="input" value="<?php $template->the_posted_value( 'first_name' ); ?>" size="20" />
              </p>
              <p>
                  <label for="last_name<?php $template->the_instance(); ?>">Last Name</label>
                  <input type="text" name="last_name" id="last_name<?php $template->the_instance(); ?>" class="input" value="<?php $template->the_posted_value( 'last_name' ); ?>" size="20" />
              </p>

      If you uploaded the file, you can already see the new fields in the register-form.

    3. Now you need to create a file called theme-my-login-custom.php if you haven’t already and place it in the plugin-directory of your wordpress install.
      Paste the following code in it to check if the fields are set and show an error-message if not (if you don’t want to make the fields required just skip this step)

      function tml_registration_errors( $errors ) {
      	if ( empty( $_POST['first_name'] ) )
      		$errors->add( 'empty_first_name', '<strong>ERROR</strong>: Please insert your first name.' );
      	if ( empty( $_POST['last_name'] ) )
      		$errors->add( 'empty_last_name', '<strong>ERROR</strong>: Please inser your last name.' );
      	return $errors;
      }
      add_filter( 'registration_errors', 'tml_registration_errors' );
    4. Again in the theme-my-login-custom.php paste the following code to fill the fields in the user-profile with the fields from your registration page.
      function tml_user_register( $user_id ) {
      	if ( !empty( $_POST['first_name'] ) )
      		update_user_meta( $user_id, 'first_name', $_POST['first_name'] );
      	if ( !empty( $_POST['last_name'] ) )
      		update_user_meta( $user_id, 'last_name', $_POST['last_name'] );
      }
      add_action( 'user_register', 'tml_user_register' );

    I guess this is all you need to do. If you stuck at some point feel free to ask me again.

    And your other problem with the missing register-page is propably due to your shortcode referencing on a file, which isn’t exisiting anymore.

    Thank you so much, schwarzgrau. I will try this today.

    Regarding Captcha, I found that the upgraded version of TML (6.3.4) has Captcha enabled in it!! Hail Jeff Farthing ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Compatibility with Register Plus Redux?’ is closed to new replies.