1
Sintez
Adding fields in registration form
  • 2004/1/9 22:31

  • Sintez

  • Just popping in

  • Posts: 37

  • Since: 2002/9/20


Dear xoopsters!!!!
please help me!!
I need to insert 1 field (with list menu) in registration form (register.php) that to my users can select items from list.
And after that its selected item will showen in user profile menu.

How to do it!! please help me!!!


2
Mithrandir
Re: Adding fields in registration form

Quote:
I need to....

What you need is to search for similar posts. This is a very common occurring request. Please read previous posts for some guidelines - or wait until next big release of the XOOPS core.

3
Xtracted
Re: Adding fields in registration form
  • 2004/1/13 16:48

  • Xtracted

  • Not too shy to talk

  • Posts: 138

  • Since: 2004/1/7 2


its probably just me, but I cant find any posts on this subject when searching the forums.. ?

I am looking to add a "real name" field in the registration form..

4
DaBoyz
Re: Adding fields in registration form
  • 2004/1/13 17:01

  • DaBoyz

  • Just popping in

  • Posts: 79

  • Since: 2002/8/8 1




Did you ever click on Edit Account to look at the Real Name ???

5
robekras
Re: Adding fields in registration form
  • 2004/1/13 17:02

  • robekras

  • Documentation Writer

  • Posts: 187

  • Since: 2002/12/10



6
Xtracted
Re: Adding fields in registration form
  • 2004/1/13 17:08

  • Xtracted

  • Not too shy to talk

  • Posts: 138

  • Since: 2004/1/7 2


Ehm... read my post again.. the "add on the _registration form_" part at least? =)

I want people to add their real name when they register as users on the page.. So you get not only a username sent to you as webmaster, but a real name as well..

7
robekras
Re: Adding fields in registration form
  • 2004/1/13 21:02

  • robekras

  • Documentation Writer

  • Posts: 187

  • Since: 2002/12/10


Seems to be I was a little confused

So here the correct answer:

Insert this line to xoops/html/include/registerform.php in line 77:

$reg_form->addElement(new XoopsFormText(_US_REALNAME"name"2625$name), true);


the code in this area should look like this then:

$reg_form = new XoopsThemeForm(_US_USERREG"userinfo""register.php");
$reg_form->addElement(new XoopsFormText(_US_NICKNAME"uname"2625$uname), true);
$reg_form->addElement(new XoopsFormText(_US_REALNAME"name"2625$name), true);
$reg_form->addElement($email_tray);
....


You also have to insert this line into xoops/html/register.php on line 151:

<input type='hidden' name='name' value='".$myts->makeTboxData4PreviewInForm($name)."' />


So the code looks like this then:

....
    <
input type='hidden' name='uname' value='".$myts->makeTboxData4PreviewInForm($uname)."' />
    <
input type='hidden' name='name' value='".$myts->makeTboxData4PreviewInForm($name)."' />
        <
input type='hidden' name='email' value='".$myts->makeTboxData4PreviewInForm($email)."' />";
....


I don't know for which reasons the Real Name was left out from registration form, but I tried it on my local site and it worked.

Maybe there is someone who can explain?


8
Xtracted
Re: Adding fields in registration form
  • 2004/1/14 10:29

  • Xtracted

  • Not too shy to talk

  • Posts: 138

  • Since: 2004/1/7 2


That worked.. thanks =)

I have the option that webmasters get an email when someone registers on the page and that a webmaster must activate the account before someone is allowed to log in.. Is there a way to add the real name to the email webmasters recieve when someone registers?


9
robekras
Re: Adding fields in registration form
  • 2004/1/14 18:03

  • robekras

  • Documentation Writer

  • Posts: 187

  • Since: 2002/12/10


Didn't try that, but here we go.

Insert the following line in xoops/html/register.php in line 246:

$xoopsMailer->assign('USERREALNAME'$myts->oopsStripSlashesGPC($name));

so it looks like the following:

....
    
$xoopsMailer->assign('USERNAME'$myts->oopsStripSlashesGPC($uname));
    
$xoopsMailer->assign('USERREALNAME'$myts->oopsStripSlashesGPC($name));
    
$xoopsMailer->assign('USEREMAIL'$myts->oopsStripSlashesGPC($email));
....

Then you could change your mail template file xoops/html/language/yourLanguage/mail_template/adminactivate.tpl to for example:

Hello {X_UNAME},

new user {USERNAME} ({USEREMAIL}) with name {USERREALNAMEhas just registered an account at {SITENAME}.
Clicking on the link below will activate the account of this user:

{
USERACTLINK}

-----------
{
SITENAME} ({SITEURL}) 
webmaster
{ADMINMAIL}

Hope this works...., and let us know again

10
Xtracted
Re: Adding fields in registration form
  • 2004/1/14 23:20

  • Xtracted

  • Not too shy to talk

  • Posts: 138

  • Since: 2004/1/7 2


Works just fine... thanks a lot.. =)

Login

Who's Online

338 user(s) are online (205 user(s) are browsing Support Forums)


Members: 0


Guests: 338


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