1
rickh
[Registerform] make 'allow others to view e-mail' default YES
  • 2004/10/13 23:13

  • rickh

  • Just popping in

  • Posts: 94

  • Since: 2004/4/9 6


Hello,

I'm customizing the registerform of my XOOPS site. Now I want the option 'allow others to view e-mail' in the registerform made YES (checked) bij default.

Anyone knows how to do this?

2
rickh
Re:[Registerform] make 'allow others to view e-mail' default YES
  • 2004/10/18 9:24

  • rickh

  • Just popping in

  • Posts: 94

  • Since: 2004/4/9 6


* kick *

3
rickh
Re:[Registerform] make 'allow others to view e-mail' default YES
  • 2004/10/22 21:34

  • rickh

  • Just popping in

  • Posts: 94

  • Since: 2004/4/9 6


and another *kick*

I've tried a lot of thing, but i think my knowledge of php is insufficient to solve it myself When I open /include/registerform.php there are a few lines:

le="color: #000000"><?php $email_tray = new XoopsFormElementTray(_US_EMAIL, "<br />"); $email_text = new XoopsFormText("", "email", 25, 60, $email); $email_option = new XoopsFormCheckBox("", "user_viewemail", $user_viewemail); $email_option->addOption(1, _US_ALLOWVIEWEMAIL); $email_tray->addElement($email_text); $email_tray->addElement($email_option);


But I dont know what to edit. Just commenting some thing out and adding a XoopsFormHidden with user_viewemail and the right value results in a blank page.
Somewhere I have to place 'checked', but where....

4
ackbarr
Re:[Registerform] make 'allow others to view e-mail' default YES

After looking at the code for XoopsFormCheckbox, I think this will work:
le="color: #000000"><?php $email_tray = new XoopsFormElementTray(_US_EMAIL, "<br />"); $email_text = new XoopsFormText("", "email", 25, 60, $email); $email_option = new XoopsFormCheckBox("", "user_viewemail", $user_viewemail); $email_option->addOption(1, _US_ALLOWVIEWEMAIL); [b][color=0080FF]$email_option->setValue(1);[/color][/b] $email_tray->addElement($email_text); $email_tray->addElement($email_option);

5
rickh
Re:[Registerform] make 'allow others to view e-mail' default YES
  • 2004/10/22 21:59

  • rickh

  • Just popping in

  • Posts: 94

  • Since: 2004/4/9 6


well, I just found a sollution 5 minutes ago I changed:

$email_option = new XoopsFormCheckBox("", "user_viewemail", $user_viewemail);

to:

$email_option = new XoopsFormCheckBox("", "user_viewemail", 1);

and it works!! Sometimes things are so simple Maybe will your sollution also work, but i've not tried it yet. Going to try it now

Login

Donat-O-Meter

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

Latest GitHub Commits