Community Support Forums — WordPress® ( Users Helping Users ) — 2012-01-07T19:05:55-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=16622 2012-01-07T19:05:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59965#p59965 <![CDATA[Re: Edit Username Field]]>

Statistics: Posted by Raam Dev — January 7th, 2012, 7:05 pm


]]>
2012-01-06T12:53:46-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59858#p59858 <![CDATA[Re: Edit Username Field]]>

Statistics: Posted by mcmcmc — January 6th, 2012, 12:53 pm


]]>
2012-01-05T19:14:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59817#p59817 <![CDATA[Re: Edit Username Field]]> viewtopic.php?f=4&t=15672&p=49082#p49082

Could you update what's in your PHP file and try it again?

Statistics: Posted by Raam Dev — January 5th, 2012, 7:14 pm


]]>
2012-01-04T20:32:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59704#p59704 <![CDATA[Re: Edit Username Field]]>
Also getting errors on the page, http://themagicpeople.org/test/wp-login ... n=register

Thanks!

Code:
<?php
add_action ("login_head", "s2_email_to_username", 1000);
function s2_email_to_username ()
    {
?>
        <script type = "text/javascript">
            (function ($) /* Wraps this `$ = jQuery` routine. */
                {
                    $.fn.swapWith = function (to) /* Utility extension for jQuery. */
                        {
                            return this.each (function ()
                                {
                                    var $to = $ (to).clone (true), $from = $ (this).clone (true);
                                    $(to).replaceWith ($from), $ (this).replaceWith ($to);
                                });
                        };
                    /**/
                    $(document).ready (function () /* Handles email-to-username on keyup. */
                        {
                            /* Generate random number to append to username,
                            hopefully making it unique (yes, this isn't perfect!) */
                            var randomNum = Math.ceil(Math.random()*999999);
                           
                            var email = 'input#user_email';
                            var login = 'input#user_login';
                            var firstname = 'input#ws-plugin--s2member-custom-reg-field-first-name';
                            var lastname = 'input#ws-plugin--s2member-custom-reg-field-last-name';
                           
                            /* Hide stuff we don't want to show on the registration form */
                            $('p.message').hide();
                            $('div.ws-plugin--s2member-custom-reg-field-divider-section').hide();
                            $('#reg_passmail').hide();
                            $('#nav').hide();
                            /* $(login).closest ('p').hide(); */
                            $('#wp-submit').val('Subscribe'); /* Change 'Register' button to 'Subscribe' */
                           
                            /* Fill hidden username field with first part of email address
                                and append randomNum to hopefully make it unique. */
                            $ (email).keyup (function ()
                                {
                                    $(login).val ($.trim ($ (email).val ().split (/@/)[0].replace (/[^\w]/gi, '')) + randomNum.toString());
                                });
                        });
                }) (jQuery);
        </script>
<?php
    }
?>

Statistics: Posted by mcmcmc — January 4th, 2012, 8:32 pm


]]>
2012-01-04T18:13:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59681#p59681 <![CDATA[Re: Edit Username Field]]>

Statistics: Posted by Raam Dev — January 4th, 2012, 6:13 pm


]]>
2012-01-04T18:11:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59679#p59679 <![CDATA[Re: Edit Username Field]]>
Thanks! :)

Statistics: Posted by mcmcmc — January 4th, 2012, 6:11 pm


]]>
2012-01-04T18:07:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59678#p59678 <![CDATA[Re: Edit Username Field]]>

Statistics: Posted by Raam Dev — January 4th, 2012, 6:07 pm


]]>
2012-01-04T15:03:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59653#p59653 <![CDATA[Re: Edit Username Field]]>
That is excellent - been searching for too long trying to find a solution. This seems to be it.

Thank you so much!

Statistics: Posted by mcmcmc — January 4th, 2012, 3:03 pm


]]>
2012-01-02T17:47:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59454#p59454 <![CDATA[Re: Edit Username Field]]>
I recently configured s2Member to hide the username field on the registration form. However, the username field is still there (as WordPress requires a username), it's just hidden.

When the user types in their email address, JavaScript automatically updates the contents of the hidden username field with the first part of the user's email address (everything before the @ symbol).

It also appends some random numbers to the end of the username to ensure that it's unique. (You can read all about how to get this working here: viewtopic.php?f=4&t=15672&p=48910#p49082)

I then have the WP Email Login plugin installed, which allows my users to login with their email address (so they never need to know their username).

Do you think that would work for you?

Statistics: Posted by Raam Dev — January 2nd, 2012, 5:47 pm


]]>
2011-12-30T21:05:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16622&p=59288#p59288 <![CDATA[Edit Username Field]]>
I don't want users to have aliases or usernames as such, I want their username to be their full name. Is there a way of either changing the 'Username' to 'Full Name' or removing the username field and having Full Name as a required field that is processed as the username?

Thanks!

Statistics: Posted by mcmcmc — December 30th, 2011, 9:05 pm


]]>