1 (edited by AG 2007-01-22 01:06)

Topic: How the profile is changed(solved)

Hi all. My question is how is a user profile changed? More specifically, where is the code that submits the user info to the database? I looked in the profile.php file, but it is a large file to go through. The reson I need to edit it is because I am displaying the forum in a page that already declared the header, so I need to make some small adjustments.

Also, I have another related question. Lets say that I wanted to move some of the settings to a different 'section' of the user's profile for the user to edit. I know that the form is different, and that setting would not be changed unless some of the post code is changed. How/where would I do this?

Thanks for any help!

EDIT1:
Okay. I got the setting moved and it works, but only partcially. I copied the code for the email setting, but it only seems to work one way. When I set it to display the email address, it changes it fine, but when I set it to not display it, it doesn't change. neutral Here is the code I copied into the essentials part of the switch statement:

$form['email_setting'] = intval($form['email_setting']);
if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;

Any ideas?

Re: How the profile is changed(solved)

First question: the actual update statement is on line 855 of an unmodded profile.php
Second question: Take a look at the switch statement that starts at line 671 in an unmodded PunBB.

3 (edited by AG 2007-01-21 19:53)

Re: How the profile is changed(solved)

ok, thanks! smile

EDIT: I updated the first post with another problem.

Re: How the profile is changed(solved)

Did you add email_setting to the extract_elements call in the right case?

5

Re: How the profile is changed(solved)

I don't think so. Where do I do that? Sorry for asking you more questions...

Re: How the profile is changed(solved)

Not a problem smile

Lets say you were adding it to the essentials section. You would find the extract elements call it uses, which is

$form = extract_elements(array('timezone', 'language'));

And add the new field to it

$form = extract_elements(array('timezone', 'language', 'email_setting'));

Make sure to remove it from where it currently is as well! smile

7 (edited by AG 2007-01-22 00:41)

Re: How the profile is changed(solved)

Thanks!