Forum Replies Created

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

    (@schwarzgrau)

    yea found the functions. Thank you.

    Thread Starter schwarzgrau

    (@schwarzgrau)

    You seriously tell me I should contact my provider to delete a folder, which your plugin has created?
    In the meantime I deleted it through the web-ftp-software, offered by my provider, since I couldn’t change the folders permissions.

    Maybe you should consider adding an option to remove all files and folders created by your plugin. For something like an clean uninstall.

    Thread Starter schwarzgrau

    (@schwarzgrau)

    glad to hear someone could use this stuff.
    By the way, I guess it’s ok to change core files, since the plugin will never been updated.

    got it! I just needed to ad an underscore after the random-prefix in my wp_config.php.
    Thank you irriterik and Brummbaer.

    @brummbaer I’m not that into Mysql, I only knew how to delete unwanted entries.
    But there are tables which got the wp_ in front of the actual prefix. In my case it’s like wp_schwarzgraupostmeta. They only contain some stuff like the first hello-world post.
    And then there are tables with a random-prefix containing my real posts. But how do I tell wordpress to use these tables? if I change the prefix in the wp_config.php and try to access the admin it just do a fresh 5-minute-install.

    Thread Starter schwarzgrau

    (@schwarzgrau)

    Oh you will update it for ACF 4.0. that’s some great news. I switched to 4.0 a few days ago and the only field i’m really missing is yours.

    Same here.

    Thread Starter schwarzgrau

    (@schwarzgrau)

    Finally I found the problem:
    AAM seems to block connections from Posts2Posts if you use meta_keys to order them. I still don’t know why, but maybe useful for everyone, who struggles with the same problem.

    ok taxonomies would be the same, since they get saved outside of the custom-fields or meta values. But you’re right, some other field types would be destroyed, even if there values still in the meta.

    The basic fields like Text, textarea, radio, select etc. are all backwards compatibile.
    At least after my upgrade from 3.x.x to 4.0.2 all fields keep their values and stay the same. Just plugin-fields like taxonomy are need to set up again.

    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.

    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.

    At first I used the shortcode, but as long as I can avoid shortcodes I propably will, cause the site will have more moderators and admins and if there is nothing to adjust I don’t want the settings to be avaible from the admin.
    But I guess if I don’t want to change everything with the next update I propably should use the shortcode.

    In admin I used the login-page created by TML. But I deleted the shortcode from the content and choosed a page-template called “my-login-template.php” which contains this code

    while ( have_posts() ) : the_post(); // Content vom Admin-Bereich
    		$argsmain = array(
    			'instance' => '1',
    			'register_template' => 'tml-templates/register-form.php',
    			'login_template' => 'tml-templates/login-form.php',
    			'user_template' => 'tml-templates/user-panel.php',
    			'lostpassword_template' => 'tml-templates/lostpassword-form.php',
    			'resetpass_template' => 'tml-templates/resetpass-form.php',
    			'show_title' => FALSE,
    			'show_gravatar' => FALSE
    			);
    		theme_my_login( $argsmain );
    	endwhile;

    This is what it looks like.

    And I used this code in my header to show an additional header-login-form if you click on “anmelden”

    $args_top = array(
    			'instance' => 'top',
    			'login_template' => 'tml-templates/top-login-form.php',
    			'user_template' => 'tml-templates/top-user-panel.php',
    			'show_title' => FALSE,
    			'show_gravatar' => FALSE,
    			);
    		theme_my_login( $args_top );

    Which can be seen here

    I guess this is something more special. But it would be nice if I could still use the template-code instead of the shortcode.

    I don’t know if my problem is a “real issue” but I would update again and help you as best as I can.
    But I guess my problem is a general conflict with the way 6.3 works.

Viewing 15 replies - 1 through 15 (of 68 total)