1
Kellymac
Remove elements of user registration
  • 2006/10/18 16:24

  • Kellymac

  • Just popping in

  • Posts: 41

  • Since: 2006/2/1 1


I'm trying to be able to remove the radio button field of the user registration and would like that the user will default to agree to recive mail.

I'm pretty sure something needs to be changed in two places. But, not sure how.

in include/registerform.php :

, $user_mailok));
if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') {
$disc_tray = new XoopsFormElementTray(_US_DISCLAIMER, '
');
$disc_text = new XoopsFormTextarea('', 'disclaimer', $xoopsConfigUser['reg_disclaimer'], 8);
$disc_text->setExtra('readonly="readonly"');
$disc_tray->addElement($disc_text);
$agree_chk = new XoopsFormCheckBox('', 'agree_disc', $agree_disc);
$agree_chk->addOption(1, _US_IAGREE);
$disc_tray->addElement($agree_chk);
$reg_form->addElement($disc_tray);
}



In register.php :




".$GLOBALS['xoopsSecurity']->getTokenHTML()."";
} else {
echo "$stop";
include 'include/registerform.php';
$reg_form->display();
}

2
m0nty
Re: Remove elements of user registration
  • 2006/10/18 18:05

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


change (in register.php)

$user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 1;


to

$user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 0;


that will make it default to yes on the form.

if you want to make it permanently select yes and remove the field. then change (in register.php)

$newuser->setVar('user_mailok',$user_mailoktrue);


to

$newuser->setVar('user_mailok'1true);


you don't have to remove the field then. but if you want to remove the field anyway then change (in include/registerform.php)

$reg_form->addElement(new XoopsFormRadioYN(_US_MAILOK'user_mailok'$user_mailok));


to

// $reg_form->addElement(new XoopsFormRadioYN(_US_MAILOK, 'user_mailok', $user_mailok));

3
Kellymac
Re: Remove elements of user registration
  • 2006/10/19 16:52

  • Kellymac

  • Just popping in

  • Posts: 41

  • Since: 2006/2/1 1


That did it! You rock!

Login

Who's Online

417 user(s) are online (46 user(s) are browsing Support Forums)


Members: 0


Guests: 417


more...

Donat-O-Meter

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

Latest GitHub Commits