Page 1 of 1

[Added] nuBuilder 4.6 – New Fields in User Form – First Name & Last Name

Posted: Sat Mar 22, 2025 11:01 am
by admin
As of nuBuilder 4.6, two new optional fields have been added to the user form:
  • First Name
  • Last Name

How It Works:

- These fields are optional and can be left blank.
- If the Full Name field is entered, the system will automatically populate the First Name and Last Name fields based on it.
- The First Name and Last Name fields can also be used as Hash Cookies:
- #USER_FIRST_NAME#
- #USER_LAST_NAME#
- Or be retrieved with the JS functions nuUserFirstName(), nuUserLastName()

Updating Existing Users

For existing users, you can run the following SQL query to populate the First Name and Last Name fields:

Code: Select all

UPDATE `zzzzsys_user`
SET 
    `sus_first_name` = SUBSTRING_INDEX(`sus_name`, ' ', 1),
    `sus_last_name` = CASE 
                          WHEN LOCATE(' ', `sus_name`) > 0 
                          THEN TRIM(SUBSTR(`sus_name`, LOCATE(' ', `sus_name`) + 1))
                          ELSE NULL
                      END
WHERE 
    `sus_first_name` IS NULL 
    AND `sus_last_name` IS NULL;