1
Pedja
Idea about customizing user profile data
  • 2003/11/7 15:53

  • Pedja

  • Just popping in

  • Posts: 2

  • Since: 2003/11/7


I am delighted that XOOPS core covers almost all I imagined as good core for pim. I actually planned to work on myu own and then found out that there is xoops. Quite nice package.

Here is one idea I coveri part of XOOPS which seeams like weak point: customizing user data.

There are three basic kind of user data:

1 - system requred field, those necessary for XOOPS to work
2 - user description fileds, used to say more about user
3 - fileds needed by modules to allow users to personalize their behaviour

Well XOOPS covers 1) and partly 2). There is no way to easily add new descriptive fields usualy needed for web site. Yes I know it may be added by hand and that is ok with me except it leads to problems: one should change core code which is not welcome.

There is a way to solve it in a spirit of modules. Let's say thet it could be added an option that module may provide template for editing user data. If that is possible than each module which needs to add some filed to users table may provide template which provide means to edit that fields.

Templates of different modules could be shown as "Tabs" in user profile editor thus allowing user to access all paramters in his profile editor. So, he would find tabs like: System, News, Forum, Third party module etc...

There also should be support for admin edited field in single user data which are not available for user to edit.

I beleive this would be very powerfull improvement. Not that it would just provide way to personalize modeules but also it would allow simle addition of fileds even if there is no actual module which needs it. One who needs some custom fields would provide "module" which would actualy just crete needed fields and provide templates to allow editing them. He will never need to alter source of the xooops source or templates but add his own.

Pedja

2
Hober
Re: Idea about customizing user profile data
  • 2003/11/7 16:35

  • Hober

  • Just popping in

  • Posts: 40

  • Since: 2003/6/13


I've created a class for the creation of forms and the validation of submitted data. Maybe that could help.

What it does is let you define a form item from an array where you say what kind of input, what responses can be allowed (for text). It also lets you do multiple choice responses of various types (checkboxs, listbox, radio buttons, the works). I think it might be useful here because it automagically sorts form values into an array and
people could add about 6 lines of code to their module for each field they want to add.

I have a weak demo of an old version here and the equally out of date source code is here

3
ackbarr
Re: Idea about customizing user profile data

These ideas form the basic premise of the dynamic user profile - a feature that will be realized in XOOPS 2.1 that allows a site administrator (or module developer) to define new user profile fields. I haven't been able to work on it for a little while now - but will set aside some time to finish it up soon.

Hober - I would be interested in seeing the data validation code, as this is one feature I wanted to finish before submitting the code to CVS.

4
Hober
Re: Idea about customizing user profile data
  • 2003/11/7 22:38

  • Hober

  • Just popping in

  • Posts: 40

  • Since: 2003/6/13


Basically what it does is pass along the field names of the form in a compressed hidden field (for some reason IE won't pass that along except as POST, but maybe somebody else could figure that out), then it will do one of several things, and load the result into a class variable called found_results. All of this comes after calling $gt_form->get_results().

on a field that allows multiple select, it will check for the names of the checkboxes or listbox entries and load all the ones that are found into an array. i.e. if you have a field of checkboxes called "expressions" with the fields "smile" "frown" and "grimace", and select "smile" and "grimace", the recieving page will look for POST['expressions_smile'] = on, POST['expressions_frown'] = on and POST['expressions_grimace'] = on, and find that you have selected smile and frown, and add $this->found_data['expressions'][] = 'smile' and $this->found_data['expressions'][] = 'grimace'. If it finds post input that doesn't fit into the fields defined it will either ignore it, or if it were, for instance, a radio button value that isn't listed, return false.

It can also pull the options multiple selection fields from a seperate file, which currently uses my gt_data flat file data storage/retrieval class, but I think that could be changed pretty easily.

Another feature it has, that might not be so useful, is a function to sort the results into a multidimensional array. By calling for instance:
$settings['named']['uinfo'] = 'uname, password, home';
$settings['misc'] = 'otherinfo';
$sorted_results gt_form::sort_results($settings);


Would make an array $sorted_results containing two keys 'uinfo' and 'otherinfo', 'uinfo' holding 'uname' 'password' and 'home', and 'otherinfo' holding any other submitted fields.

Right now I'm still fixing it up a little, like making it at least assign a placeholder to empty fields, instead of just not setting them.

I'll put the code of some of my other classes online sometime in the next few days, I have a whole section of my website devoted to them . here

5
Hober
Re: Idea about customizing user profile data
  • 2003/11/7 22:39

  • Hober

  • Just popping in

  • Posts: 40

  • Since: 2003/6/13


Just another quick thought, it relies on gzip compression, which could be a problem, does anyone know of any other broadly supported/used compression systems?

Login

Who's Online

243 user(s) are online (169 user(s) are browsing Support Forums)


Members: 0


Guests: 243


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits