11
pontifex
Re: Adding fields in registration form
  • 2004/1/16 10:04

  • pontifex

  • Just popping in

  • Posts: 2

  • Since: 2002/12/30


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!

12
tommyZ
Re: Adding fields in registration form
  • 2005/2/14 20:19

  • tommyZ

  • Friend of XOOPS

  • Posts: 89

  • Since: 2005/1/4 1


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

13
robekras
Re: Adding fields in registration form
  • 2005/2/16 6:53

  • robekras

  • Documentation Writer

  • Posts: 187

  • Since: 2002/12/10


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

14
tommyZ
Re: Adding fields in registration form
  • 2005/2/16 18:57

  • tommyZ

  • Friend of XOOPS

  • Posts: 89

  • Since: 2005/1/4 1


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

15
codyf
Re: Adding fields in registration form
  • 2005/5/19 6:47

  • codyf

  • Just popping in

  • Posts: 24

  • Since: 2005/5/6 4


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.

16
spankee
Re: Adding fields in registration form
  • 2006/3/9 8:49

  • spankee

  • Just popping in

  • Posts: 89

  • Since: 2005/11/13


Has anybody got this to work on 2.0.13 yet?
Thanks

17
PTlooker
Re: Adding fields in registration form
  • 2006/3/9 9:23

  • PTlooker

  • Just can't stay away

  • Posts: 447

  • Since: 2003/6/15


I would like to have it too on 2.0.13.2

18
m0nty
Re: Adding fields in registration form
  • 2006/3/9 13:44

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


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.

19
PTlooker
Re: Adding fields in registration form
  • 2006/3/9 17:22

  • PTlooker

  • Just can't stay away

  • Posts: 447

  • Since: 2003/6/15


When I try to download for 2.0.13.2 on this link:

http://72.29.75.243/~wwcncom/test2010/modules/wfdownloads/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/viewtopic.php?topic_id=47679&forum=28&post_id=209508#forumpost209508

Thanks a lot

20
spankee
Re: Adding fields in registration form
  • 2006/3/10 3:08

  • spankee

  • Just popping in

  • Posts: 89

  • Since: 2005/11/13


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

Login

Who's Online

312 user(s) are online (240 user(s) are browsing Support Forums)


Members: 0


Guests: 312


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