1
nayeem
how to add more fields in the user table?
  • 2004/6/17 16:15

  • nayeem

  • Just popping in

  • Posts: 44

  • Since: 2004/1/3 1


how would i add more fields to the user table? Mainly my module might have new fields specific to each user. is there a built in way to add more fields to the user table and access them through the member class, or would i need to create my own table for it, then extend the member class and use the derived version of the member class...
but even then the internal functions such as logging in and setting cookies will not use the new extended member class will it?

nsm

2
nayeem
Re: how to add more fields in the user table?
  • 2004/6/19 13:33

  • nayeem

  • Just popping in

  • Posts: 44

  • Since: 2004/1/3 1


anyone?

3
marcan
Re: how to add more fields in the user table?
  • 2004/6/19 13:42

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


This requires a bit of PHP, objects, and XOOPS knowledge. If you feel confident, here are the general steps :

For each new field you want to add, you need to create a new field in the database using phpMyAdmin. Then you need to modifiy the class User in kernel/user.php.

Then, you need to modify edituser.php to display a control for you new field.

This is hacking the core. You need to be very carefull when doing that.

The best way to learn it is to take a field, for example timezone_offset and do a search in edituser.php and kernel/user.php to see how this field is done. Then you do the same thing for yours !

Hope this can help I know it is not an extended answer but this would need to be in a tutorial as it is a complex operation.

Cheers !

4
nayeem
Re: how to add more fields in the user table?
  • 2004/6/19 16:31

  • nayeem

  • Just popping in

  • Posts: 44

  • Since: 2004/1/3 1


thanks for the note.

yes this way is of course possible. but i was looking for something less 'hack' eg a seperate table containing all the extra user fields and their information.

would it be useful for users of XOOPS if i create a user-extension hack which would allow people to simply add one more field to a certain table and that would load up the fields in the user form. i would still need to hack the UserHandler here to load the fields from the extra table, also the edituser like you mentioned but at least it gives the freedom to have whatever fields you need. if XOOPS would include the hack in their next version then there wouldnt be any need for the hack in future.

nsm

5
woosterisp
Re: how to add more fields in the user table?
  • 2004/7/8 15:48

  • woosterisp

  • Just popping in

  • Posts: 4

  • Since: 2004/5/20


Don't forget to modify the template file as well - system_userinfo.html. That's where the information is reserved to be posted on the user page. Of course you also need to edit several other files as well to make it fully functional throughout, even in the admin area. I belive there are 10 files altogether that must be edited.

Check out http://www.avpropmart.com and look at one of the members profiles to see the changes I made. Still trying to get the "Groups" and "Ads" functions to work though...anybody have ideas on that?

Login

Who's Online

755 user(s) are online (78 user(s) are browsing Support Forums)


Members: 0


Guests: 755


more...

Donat-O-Meter

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

Latest GitHub Commits