xoops forums

Sintez

Just popping in
Posted on: 2004/1/9 22:31
Sintez
Sintez (Show more)
Just popping in
Posts: 37
Since: 2002/9/20
#1

Adding fields in registration form

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!!!

Mithrandir

XOOPS is my life!
Posted on: 2004/1/9 22:36
Mithrandir
Mithrandir (Show more)
XOOPS is my life!
Posts: 6320
Since: 2003/6/21
#2

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.

Xtracted

Not too shy to talk
Posted on: 2004/1/13 16:48
Xtracted
Xtracted (Show more)
Not too shy to talk
Posts: 138
Since: 2004/1/7 2
#3

Re: Adding fields in registration form

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..

DaBoyz

Just popping in
Posted on: 2004/1/13 17:01
DaBoyz
DaBoyz (Show more)
Just popping in
Posts: 79
Since: 2002/8/8 1
#4

Re: Adding fields in registration form



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

robekras

Documentation Writer
Posted on: 2004/1/13 17:02
robekras
robekras (Show more)
Documentation Writer
Posts: 187
Since: 2002/12/10
#5

Re: Adding fields in registration form

From a previous post from me:

Please take a look at here for (maybe) a workaround
https://xoops.org/modules/newbb/viewto ... 56&forum=4#forumpost39571

and for more info about this topic:
https://xoops.org/modules/newbb/viewto ... 15&forum=7#forumpost60966
https://xoops.org/modules/newbb/viewto ... at&topic_id=9122&forum=10

Xtracted

Not too shy to talk
Posted on: 2004/1/13 17:08
Xtracted
Xtracted (Show more)
Not too shy to talk
Posts: 138
Since: 2004/1/7 2
#6

Re: Adding fields in registration form

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..

robekras

Documentation Writer
Posted on: 2004/1/13 21:02
robekras
robekras (Show more)
Documentation Writer
Posts: 187
Since: 2002/12/10
#7

Re: Adding fields in registration form

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?

Xtracted

Not too shy to talk
Posted on: 2004/1/14 10:29
Xtracted
Xtracted (Show more)
Not too shy to talk
Posts: 138
Since: 2004/1/7 2
#8

Re: Adding fields in registration form

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?

robekras

Documentation Writer
Posted on: 2004/1/14 18:03
robekras
robekras (Show more)
Documentation Writer
Posts: 187
Since: 2002/12/10
#9

Re: Adding fields in registration form

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

Xtracted

Not too shy to talk
Posted on: 2004/1/14 23:20
Xtracted
Xtracted (Show more)
Not too shy to talk
Posts: 138
Since: 2004/1/7 2
#10

Re: Adding fields in registration form

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