Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2003, 05:41 PM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 02-08-2003, 06:21 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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....)
Reply With Quote
  #3  
Old 02-08-2003, 06:38 PM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xenon
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....)

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...
Reply With Quote
  #4  
Old 02-18-2003, 09:54 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

* 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:
$username trim($username); 
Replace it as:

PHP Code:
if (!trim($name) OR !trim($sirname)) { eval("standarderror(\"".gettemplate("error_fillnamesirnamefields")."\");");}
$username trim($name).' '.trim($sirname); 
(form field names are assumed to be "name" and "sirname"!)

* 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:
$DB_site->query("INSERT INTO userfield $userfieldsnames VALUES ($userid$userfields)"); 
after that add:

PHP Code:
$DB_site->query("INSERT INTO userfield (fieldX, fieldY) VALUES ('.addslashes(htmlspecialchars($name)).','.addslashes(htmlspecialchars($sirname)).' )"); 
(Replace X and Y with the profile id of your name and sirname fields in vb.)

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"..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05964 seconds
  • Memory Usage 2,196KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete