Quote from: pixelchutes at Aug 22, 2007, 06:12 AM
Sounds good to me. Options are always nice!!!
As for the "extended" table thoughts, wouldn’t it be cool if you could define/map your extra reg fields to a given table name, and if not defined it would assume default attributes table?
I could see how the SQL if/else logic could get a bit clouded, but being able to choose one way or the other would be nice.
One plus of having a separate table (joined on internalKey) is the ability to "Opt Out" when performing a Backup. This way, you can optionally backup the default/dependent tables, and have a choice to backup the "extended" or not...plus, this way you know it shouldn’t interfere w/ core code/3rd party add-ons.
I discussed this with Jason (OpenGeek) earlier tonight, and he suggested using an alternate table joined on internalKey (as you suggested... kudos!).
This is how I am planning to have it work out.
A user can put ®CustomFields in their WebLoginPE call with a comma separated list of custom table columns they want inserted into "web_user_attributes_extended". If WebLoginPE sees that ®CustomFields is specified, it will check for the "web_user_attributes_extended" and create it if it is not there, then it will explode the comma separated list into an array, foreach over it to see if those columns exist in the "web_user_attributes_extended" table and create them only if they are not already there. Then it will do the normal registration stuff, putting the data into the standard tables and the extra stuff into the "web_user_attributes_extended" table. This table will also be queried on login. I am refactoring the placeholder function in WebLoginPE to take account for the custom fields, so if you have a custom field called "website", the placeholder [+user.website+] will automatically be set.
*** edit ***
If you notice in the WebLoginPE registration and profile forms, the name attributes on the form fields are exactly the column names in the database. for custom fields, the name attribute on your custom forms should match exactly the column name you specified in ®CustomFields.
-sD-
Dr. Scotty Delicious, Scientist DFPA.