Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

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

Information about updates, news, Code Library
admin
Site Admin
Posts: 2813
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

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

Unread post 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;



You do not have the required permissions to view the files attached to this post.
Post Reply