The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Auto Username - Request
I've a request. I've been combing the hacks db, and haven't found it yet, so here we go. Many thanks to my husband who inspired me to think of this (if it's not been thought of before, of course)
Anyway...I want my members to use their first and last name for their username (it's a private, member's only board). However, for whatever reason, some of these people aren't grasping that concept and they are coming up with off-the-wall usernames which makes it really hard for other members to use the member list to effectively find them. Basically what I want is this - upon registration instead of having a "username" field, I want two fields - "First Name" and "Last Name". Upon registration, these two fields would be kept separately for sorting (details below), but it would generate a username for the member - obviously displaying the username so they know how to log back in. If I were to register with my first and last name like so - "Rose" and "Schmuckatelli", it'd generate a username for me like "Rose Schmuckatelli" (Space in between is preferred). Now, the reason I want the first & last name fields to be kept separate is so that members can easily search the memberlist either by "First" or "Last" name sort orders. So, this might be two hacks, it might be one big(ish) hack. But is anyone intersted? |
#2
|
||||
|
||||
well, you have to add two required profilefields and then just combine them when inserting the username into the DB.
really not a hard problem, but what should happen when two people have the same name? (that could happen not so rarely, Hans Meier is a very popular name in germany for example....) |
#3
|
||||
|
||||
Quote:
I believe NTLDR is going to help with this hack - I'm completely inexperienced when it comes to writing php. But anyway...you present a very good problem - dupe usernames. Since the site is limited to basically members of our Club, this shouldn't be too big of a problem. Those father/son's who do have the same names will need to enter a suffix like "Jr." or something. however, there is always a chance for error so a nice little error message would be good. Something stating "The Name(s) you entered are already registered. Have you registered before and forgot your password? If so, click here. If you haven't registered here before, please contact Rose in the Club office to complete registration" and maybe the account would go into a modded group or something... |
#4
|
||||
|
||||
* You can create 2 profile fields one for name and the other for sirname. Make sure the profile fields are hidden to user (non editable, admins view only) and note their ids.
* You can edit relevant template and remove username field, instead add 2 form textbox fields for name and sirname (note their name). * In register.php, find: PHP Code:
PHP Code:
* Create a template named "error_fillnamesirnamefields" and in it ask user to field to name and sirname fields. * edit template "error_alreadyregistered" ask user to reenter name and sirname fields. * find: PHP Code:
PHP Code:
If I didnt miss anything to edit, this should work.. Don't forget to edit relevant templates to remind user that his username = "name sirname".. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|