Re: Email Login + Random Member URLs
It works excellent! And no function was needed to be created.
In the header I just put in the javascript:
<script type = "text/javascript">
function copyinput(){
var tmp = document.getElementById('signup_email').value;
tmp = tmp.toLowerCase().replace(/^s+|s+$/g, "").replace(/[_|s]+/g, "");
tmp = tmp.replace(/[^a-z0-9-]+/g, "").replace(/[-]+/g, "-").replace(/^-+|-+$/g, "");
document.getElementById('signup_username').value = tmp;
}
</script>
And then within the register.php file I put:
onkeyup=”copyinput()” within:
<input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" onkeyup="copyinput()" />
However, obviously with the code I have currently all it’s doing is stealing the email and plugging it into the username slot without the “@” symbol and the “.”
So how can I randomize it so that it’s not necisarily the email, but just some random number? (but I’d have to ensure that there would be no duplicates, otherwise it wouldn’t work)
Thanks