1
prophecy100
Allow users to change nickname

Hello

I was hoping someone could give me advice on how I can allow my users to change their own nicknames.

I thought the best way of doing this was by editing edituser.php.

I tried changing the following (lines 150 and 151)-

$uname_label = new XoopsFormLabel(_US_NICKNAME, $xoopsUser->getVar('uname'));
$form->addElement($uname_label);

to-

$uname_text = new XoopsFormText(_US_NICKNAME, 'uname', 30, 60, $xoopsUser->getVar('uname','E'));
$form->addElement($uname_text);

That did change the label to a text box and pre fill it with the existing nickname, but if I change it and click submit it does not save the changes. I am sure it is something simple I am missing and I was wondering if anyone could help shed any light on this.

Thanks

Jonathan

2
prophecy100
Re: Allow users to change nickname

Never mind, fixed it myself, added the following below line 100 in edituser.php

$edituser->setVar('uname', $_POST['uname']);

Just thought I would post this in case it was useful to someone else.

Jonathan

Login

Who's Online

167 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 167


more...

Donat-O-Meter

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

Latest GitHub Commits