1
Serap
A mandatory field in registration
  • 2008/5/29 15:48

  • Serap

  • Just popping in

  • Posts: 28

  • Since: 2007/9/4 2


Hi,

I created a field in the registration form for my website and I would like this field to be shown on the "view account" page and the problem is I don't know how to do that.


This is the field; $reg_form->addElement(new XoopsFormTextarea(_Üye_olma_nedeni, "user_whyreg","Lütfen üye olma nedeninizi yazýn ve sitede de kendinizi tanýtýn", 5, 50, $myts->htmlSpecialChars($user_whyreg)), true);


I use XOOPS 2.0.17

Can someone tell me how do I make this field appear on the view account screen?

2
Anonymous
Re: A mandatory field in registration
  • 2008/5/29 16:19

  • Anonymous

  • Posts: 0

  • Since:



3
Serap
Re: A mandatory field in registration
  • 2008/5/29 17:05

  • Serap

  • Just popping in

  • Posts: 28

  • Since: 2007/9/4 2


Hi,

thank you for your answer. I did what you say on the link. It's for the name field and it's hidden, I tried to change the name but it did not quite work. What I need is a field where people can write the reason to become a member of my website (like the extra information field) and I don't want it to be hidden, I want other members to be able to see it.

4
Anonymous
Re: A mandatory field in registration
  • 2008/5/29 20:43

  • Anonymous

  • Posts: 0

  • Since:


Let us try to convert Extra info field to Why reg field.

edit /register.php file and add:
$bio = isset($_POST['bio']) ? trim($myts->stripSlashesGPC($_POST['bio'])) : '';

before:
$url = isset($_POST['url']) ? trim($myts->stripSlashesGPC($_POST['url'])) : '';


and add:
<input type='hidden' name='bio' value='".$myts->htmlSpecialChars($bio)."' />

before:
<input type='hidden' name='url' value='".$myts->htmlSpecialChars($url)."' />


and add:
$newuser->setVar('bio'$biotrue);

after:
$newuser->setVar('email'$emailtrue);


Now edit /include/registerform.php file and add:
$reg_form->addElement(new XoopsFormTextarea(_US_EXTRAINFO"bio"$myts->htmlSpecialChars($bio)), true);

before:
$reg_form->addElement(new XoopsFormText(_US_WEBSITE"url"25255$myts->htmlSpecialChars($url)));


Demo:
Resized Image


Edit /language/english/user.php file and replace:
define('_US_EXTRAINFO','Extra Info');

with:
define('_US_EXTRAINFO','Why Reg ?');

5
Serap
Re: A mandatory field in registration
  • 2008/5/29 21:33

  • Serap

  • Just popping in

  • Posts: 28

  • Since: 2007/9/4 2


it worked, thank you so much...

Login

Who's Online

367 user(s) are online (212 user(s) are browsing Support Forums)


Members: 0


Guests: 367


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