Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 11:38 am EDT

Geeklog Forums

New approach for custum user forms


Status: offline

DeamonLizard

Forum User
Newbie
Registered: 10/30/04
Posts: 1
Hi

I took over a project in development for a client of mine. Overall the system is put together very well. I had a look at how to implement custum user registation, and would like to make a new suggestion.

Instead of having to rewrite ALL the user functions, the core should have a lookup table of fields that the programmer wants.

You can use the same scructure you use for groups, ie, add to the table whether it is a core function or not. For example:
Text Formatted Code

(Well not really code - just the table layout)

curf_id    fieldname,    table,       core_field,    display_on_first_reg
1            firstname      gl_users     1                 0
2            surname       gl_users     1                 0
3            username     gl_users     1                 1
4            email            gl_users     1                 1
5            user_pref      gl_user_custom  0         0


 

Mostly programmers just want to add a few fields to the user registriation, they don't want "full custom user registrations". It just seems overkill to recode the entire usermanagement section in lib-custom.php when I just want to add a field or 2.

The core should automatically adapt to the fields that the user want - without doing any further programming.

Coding this shouldn't be to diffucult. Instead of hardcoding template->set_var you can do a db_array_fecth and then set the entire array in once shot with set_var. Whatever variables are in the database will be set in the template (remember set_var takes an array as an agument, so multiple template vars can be set directly from the full db array)

Your feedback and comments on this idea would be appreciated.

Thank you

DeamonLizard
 Quote

tokyoahead

Anonymous
I like this approach.
I think that there should be a free range of fields for every installation that you can setup. The whole system should be setup so that there 99% of all customizations can be done by entering them into tables, so that there is a minimum effort in upgrades etc. Even the lib-custom functions should reside in tables IMHO.
 Quote

All times are EDT. The time is now 11:38 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content