xoops forums

pontifex

Just popping in
Posted on: 2004/1/16 10:04
pontifex
pontifex (Show more)
Just popping in
Posts: 2
Since: 2002/12/30
#11

Re: Adding fields in registration form

Argh...

I tried this my self a month ago: adding al field to the registration form and now I see I just forgot something...

Thank you robekras!

tommyZ

Friend of XOOPS
Posted on: 2005/2/14 20:19
tommyZ
tommyZ (Show more)
Friend of XOOPS
Posts: 89
Since: 2005/1/4 1
#12

Re: Adding fields in registration form

Hi! Thanks to everyone who contributed to this thread, it contains some very helpful information already.

I am trying to do the same thing but rather than having the Admin activation email contain the added field, I would like the email that notifies a selected group of users when a new user registers to the site to contain the field I’ve added to the register page (Real Name).

The function which sends this email is in register.php file and I have managed to slightly modify it to send the added field (Real Name in my case as well), but could not manage to have the email contain more than one variable in the e-mail’s body. This might be a limitation of the setBody(sprintf(,))?

Unmodified Register.php line 270 to 276
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf_US_NEWUSERREGAT,$xoopsConfig['sitename']));
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG,$myts>oopsStripSlashesGPC($uname)));
$xoopsMailer->send();


Attempt one of modifying Line 275
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG,$myts->oopsStripSlashesGPC($uname)), sprintf(_US_HASJUSTREG,$myts->oopsStripSlashesGPC($name)));

well that didn’t work,

Attempt two of momodifying Line 275
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG,$myts->oopsStripSlashesGPC($uname), $myts->oopsStripSlashesGPC($name)));


well that didn’t work either,


the variable I would like to add to the body of the email is $name and it is declared with the correct value, the problem is adding it to the e-mail’s body on-top of the Username.

if you figure it out, let me know

if I need to clarify myself farther, let me know as well

TommyZ

robekras

Documentation Writer
Posted on: 2005/2/16 6:53
robekras
robekras (Show more)
Documentation Writer
Posts: 187
Since: 2002/12/10
#13

Re: Adding fields in registration form

Hi TommyZ,

It's right, setBody only takes one parameter, and also the _US_HASJUSTREG needs only one parameter: See in language/english/user.php
define('_US_HASJUSTREG','%s has just registered!');


You could do either:


- change the _US_HASJUSTREG to something like:
define('_US_HASJUSTREG','%s, %s has just registered!');
and change
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG,$myts->oopsStripSlashesGPC($uname),$myts->oopsStripSlashesGPC($name)));



or change only in register.php:


$xoopsMailer->setBody(sprintf(_US_HASJUSTREG$myts->oopsStripSlashesGPC($uname).", ".$myts->oopsStripSlashesGPC($name)));


The second version concatenates the $uname and $name to one string, so it works with the actual version of _US_HASJUSTREG.

Hope I did understand you correctly ,
and also hope this works, as I didn't try it.

Robert

tommyZ

Friend of XOOPS
Posted on: 2005/2/16 18:57
tommyZ
tommyZ (Show more)
Friend of XOOPS
Posts: 89
Since: 2005/1/4 1
#14

Re: Adding fields in registration form

Thank you Robert!!!

Yes you understood me correctly, and this works just fine.

This is a great lesson I learned about the way php variables are declared and passed on to functions!



take care,

TommyZ

codyf

Just popping in
Posted on: 2005/5/19 6:47
codyf
codyf (Show more)
Just popping in
Posts: 24
Since: 2005/5/6 4
#15

Re: Adding fields in registration form

I was wondering if someone could update this code for the lattest version of xoops. I can add the name field in the registration but it won't store it. It keeps the field blank when you view the user. The example code of how it should look is slightly differant so I'm guessing this was written for an earlier version of xoops.

spankee

Just popping in
Posted on: 2006/3/9 8:49
spankee
spankee (Show more)
Just popping in
Posts: 89
Since: 2005/11/13
#16

Re: Adding fields in registration form

Has anybody got this to work on 2.0.13 yet?
Thanks

PTlooker

Just can't stay away
Posted on: 2006/3/9 9:23
PTlooker
PTlooker (Show more)
Just can't stay away
Posts: 447
Since: 2003/6/15
#17

Re: Adding fields in registration form

I would like to have it too on 2.0.13.2

m0nty

XOOPS is my life!
Posted on: 2006/3/9 13:44
m0nty
m0nty (Show more)
XOOPS is my life!
Posts: 3337
Since: 2003/10/24
#18

Re: Adding fields in registration form

u could try my photo + profiles hack V2 for 2.0.13.2 details in the news (hacks section).

HERE

or forum discussion HERE

it adds many features to the profile and registration, such as date of birth, gender, top 5 playlist (music) top 5 movies. i like, i dislike and so on.

oh and a personal photo upload on your profile ;)

it should be easy to modify if you want to change the fields, all the edits are clearly commented in the files.

if you require it, then let me know and i'll email it to you if u give me your mail address..

my site as exceeded bandwidth for this month so unfortunately you won't be able to download it directly.

PTlooker

Just can't stay away
Posted on: 2006/3/9 17:22
PTlooker
PTlooker (Show more)
Just can't stay away
Posts: 447
Since: 2003/6/15
#19

Re: Adding fields in registration form

When I try to download for 2.0.13.2 on this link:

http://72.29.75.243/~wwcncom/test2010 ... wnloads/viewcat.php?cid=6

I got:

Bandwidth Limit Exceeded
The server is temporarily unable to service your request due to the site owner reaching his/her bandwidth limit. Please try again later.

Can you please give me an working link?

And if possible please check this post:

https://xoops.org/modules/newbb/viewto ... id=209508#forumpost209508

Thanks a lot

spankee

Just popping in
Posted on: 2006/3/10 3:08
spankee
spankee (Show more)
Just popping in
Posts: 89
Since: 2005/11/13
#20

Re: Adding fields in registration form

Could you please send me the hack, it is exactly what I need in order to make XOOPS gallery 2 work.
My email is viewable to the public.
Thanks