Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Remove usernames

edited November 2005 in Vanilla 1.0 Help
I've been talking with the moderators over at my forum, and were all agreed that instead of having usernames, we would like people to be known as forename.surname on the board. I could always just ask users to have this as there username, but a much more effective method would be to remove the option of choosing a username, and creating it automagically from what they enter as their name. No idea how to do this, or if it's even possible. Thoughts?

Comments

  • Options
    It's most certainly possible and shouldnt be too hard. You just need to find the class which interprets the data from the sign up form (dont ask me which one that is, mind) and remove the username input and create it from the first and last name vars when it's being inserted into the db. You would have the slight issue that some people dont like using their real names so i think you'd end up with some ben.dovers and suchlike...but thats an entirely different kettle of fish. I guess it depends on the community itself.
  • Options
    This might not be the best way to do it (i suspect it can be made as an extension somehow), but if you find the controls/apply.php and look for this line: <dt>".$this->Context->GetDefinition("Username")."</dt> <dd><input type=\"text\" name=\"Name\" value=\"".$this->Applicant->Name."\" class=\"Input\" maxlength=\"20\" /></dd> You could try replacing it with: <input type=\"hidden\" name=\"Name\" value=\"".$this->Applicant->FirstName.$this->Applicant->LastName."\" class=\"Input\" maxlength=\"80\" /> You'll also need to go into your database and change the maximum field length of the Name field in the lum_user table to something like 80 because the first and last names are allowed to be upto 40chars long (or you could just change that) Make a backup of your files before you do this incase it goes wrong - i havent tested it but i dont really see why it wouldnt work.
  • Options
    Sweet. If someone can now come along and make that into an extension, I will be eternally grateful. The other question I guess is whether this will work going forward with 1.0
  • Options
    Did it work? If so i'll try and hack it into an extension. I'm not sure how applications will work with 1.0. I suspect they will still exist so it will still work somehow - but hopefully you'll have a lot more control over the form anyway. I guess only mark can really answer that.
  • Options
    I haven't tried it yet, will do it now.
  • Options
    no joy, got an error: "A problem was encountered. You must enter a value for the username input." here: http://www.36-degrees.co.uk/vanilla/apply.php
  • Options
    On no, hold on, it did work, still chucked out the error message though.
  • Options
    hmm. I cant work out the validation sequence from a quick glance and i'm heading out to work. If you havent got any further by the time i get back i'll take a proper look.
This discussion has been closed.