• Hello all, I’m fairly new to WordPress and PHP but slowly getting up to speed modifying my first WordPress site.

    So this is a great plugin, very useful. I’m doing a bilingual site en/fr, so the first problem I ran into is switching the registration image to the french version. I’m using the URL variable lang=fr on the french registration page. So I imagine I need some if-else PHP code somewhere to make the switch. The question is where? Do I modify the wp-login page, the plugin php code or is there a function that I can modify?

    Another question, I’m using WPML plugin to scan the register plus redux plugin and then translating the text. Works well except it’s not finding all the text, it finds first name, last name but not some I added such as city and country? Where does RPR store the extra form fields, in the dB. How would I translate.

    Thanks, I’m sure after a few months this WordPress/PHP stuff will become clearer…

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mcbryant

    (@mcbryant)

    Well figured this out, or the part about switching logos on the registration page. I added this to the function.php page and it worked. Not sure if this is best practice PHP code as I’m fairly new to it but it worked. So now the french page gets the french logo, english page gets the english logo.

    $lang = $_GET[‘lang’];
    if($lang == “fr”) {
    function login_logo() {
    echo ‘<style type=”text/css”>
    h1 a { background-image: url(‘.get_bloginfo(‘template_directory’).’/register-logo-f.jpg); }
    </style>’;
    }
    }
    else {
    function login_logo() {
    echo ‘<style type=”text/css”>
    h1 a { background-image: url(‘.get_bloginfo(‘template_directory’).’/register-logo.jpg); }
    </style>’;
    }
    }
    add_action(‘login_head’, ‘login_logo’);

    Still looking for a way to translate all form fields though, the existing ones and the ones I added using this plugin.

    Plugin Author radiok

    (@radiok)

    The way you handled the logo looks great and I think that should probably be handled in the theme’s functions file as you did. I’m not really sure how to resolve the added fields being translated. They aren’t static fields like the first name, last name fields. Like you said they are stored in the database in the options table. I’m really not sure how other developers get around this particular issue.

    Thread Starter mcbryant

    (@mcbryant)

    It looks like there’s 4 separate things to translate the registration form then. The logo, static RPR, the fixed username/email and the dynamic dB RPR. This is my solution for the fixed username/email, modified the wp-login.php file:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I guess the code must pull this info into variables somewhere, if I can write some code to change the variable holding the label name then it should be good. Any idea where that code is, where they stuff this info into variables?

    Thread Starter mcbryant

    (@mcbryant)

    Here is the pastebin link

    https://wordpress.pastebin.com/cuF0skH8

    Thread Starter mcbryant

    (@mcbryant)

    Well just to finish this off for anyone wanting to do the same thing, this is what I came up with for changing the dynamic extra fields taken from the dB.

    I modified the register-plus-redux.php file around line 1600+ where it uses this code.

    echo stripslashes($v[“custom_field_name”]), “
    <input type=’text’ name=’$key’ id=’$key’ class=’input’ value='”, $_POST[$key], “‘ size=’25’ “;

    I replaced $v[“custom_field_name”] with a variable I created in the loop by using if/else statements. Then by checking whether it’s french and if it’s the custom_field_name I’m looking for I can generate a french equivalent.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Register Plus Redux] Switching logo files and other translation questions’ is closed to new replies.