1
xgarb
edituser.php - alter form - new content to database
  • 2003/10/16 18:55

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


Hi all,

I'm hacking about with edituser.php. I want to add some additional form elements and have inputted information go into the database.

I've worked out the way the forms are generated, but can't seem to get the data from the new elements to go into the DB.

Any pointers to how the database insertion actually is achieved in XOOPS?

Code is below.. my stuff in italics
_______________________________

$edituser->setVar('timezone_offset', $timezone_offset);
$edituser->setVar('country', $country);
$edituser->setVar('uorder', $uorder);

$timezone_select = new XoopsFormSelectTimezone(_US_TIMEZONE, 'timezone_offset', $xoopsUser->getVar('timezone_offset'));
$country_select = new XoopsFormSelectCountry(_US_COUNTRY, 'country', $xoopsUser->getVar('country'));
$icq_text = new XoopsFormText(_US_ICQ, 'user_icq', 15, 15, $xoopsUser->getVar('user_icq', 'E'));

$form->addElement($timezone_select);
$form->addElement($country_select);
$form->addElement($icq_text);

2
xgarb
ANSWERED: edituser.php - alter form - new content to database
  • 2003/10/17 15:09

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


OK found the code I was looking for...

in kernel/users.php

Add the extra fields in the form to the function at line 70+. To get them inserted into the DB add them at line 518.


Note: I recommend having the PHP debug mode (preferences) on if you have a problem - it's a great help.

3
builderb
Re: ANSWERED: edituser.php - alter form - new content to database
  • 2003/10/17 15:23

  • builderb

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/8/4 2


I'd be interested in seeing what you have when you're finished.

Will you make it available to download?

4
PureLuXus
Re: ANSWERED: edituser.php - alter form - new content to database
  • 2003/10/17 15:35

  • PureLuXus

  • Not too shy to talk

  • Posts: 116

  • Since: 2002/1/3 2


i allready do this too...
2 times..
now i wait for ackbarr he will make it editable from admin panel

i hope he finished this hack soon cause i dont want to hack all the stuff again

5
ackbarr
Re: ANSWERED: edituser.php - alter form - new content to database

This is not going to be a hack, it will be a feature added to XOOPS 2.1

6
PureLuXus
Re: ANSWERED: edituser.php - alter form - new content to database
  • 2003/10/17 18:02

  • PureLuXus

  • Not too shy to talk

  • Posts: 116

  • Since: 2002/1/3 2


what did u allready done?
when we can expect the code in the cvs?

7
kknewer
Re: edituser.php - alter form - new content to database
  • 2004/4/9 7:03

  • kknewer

  • Just popping in

  • Posts: 4

  • Since: 2004/3/27


hi xgarb
I got same problems but the different is in registerform. Is it works in registerform according to your way?

can you show me how it's works in your case , especially the code!!

thanks

Login

Who's Online

358 user(s) are online (277 user(s) are browsing Support Forums)


Members: 0


Guests: 358


more...

Donat-O-Meter

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

Latest GitHub Commits