1
antifmradio
Manditory fields for user registration?

Wanted to know if there is a way to make some of the fields MANDITORY for user registrations.

2
Anonymous
Re: Manditory fields for user registration?
  • 2008/5/29 0:10

  • Anonymous

  • Posts: 0

  • Since:


use smartprofile module or you need to hack register.php file.

For example: How to make Name field as required ?

Edit register.php then add:
$name = isset($_POST['name']) ? $myts->stripSlashesGPC($_POST['name']) : '';

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

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

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

and add:
$newuser->setVar('name'$nametrue);

before:
$newuser->setVar('uname'$unametrue);


Now edit include/registerform.php then add:
$reg_form->addElement(new XoopsFormText(_US_REALNAME'name'3060$myts->htmlSpecialChars($name)), true);

before:
$uname_size $xoopsConfigUser['maxuname'] < 25 $xoopsConfigUser['maxuname'] : 25;


That's it!

This hack based on autologin hack and working on 2.0.18.1 or older.

Login

Who's Online

291 user(s) are online (55 user(s) are browsing Support Forums)


Members: 0


Guests: 291


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits