MyBB Community Forums

Full Version: set default profile options
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
ok, i see what's going on. Let me look closer.
sure Smile
Ok, so I checked a bunch of things out.
First, I have an instance of MyBB 1.8.10 running strictly for test purposes.
If I break it, I can wipe and start fresh.

1. You do not need to do a core edit, so you can revert member.php.
2. In the member registration template, you need to have the controls, so revert back to the default member_register template before you make edits described below.
3. The template is where you can set default values and make them stick, shown in the code snippet below from template member_register.
4. For each checkbox, change input type from checkbox to "hidden". Set the value to 1 if checked or 0 if not checked.
5. When the Submit button is clicked, the controls and values have to be there.
6. I checked this out with the modified member.php file and also the original file.
7. The attached screenshots show the registration page and the User CP.

<legend><strong>{$lang->account_prefs}</strong><br />Default values are already set. These may be changed later in the User CP.</legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%">
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="allownotices" id="allownotices" value="1" {$allownoticescheck} /></td>
<td valign="top"><span class="smalltext"><label for="allownotices">{$lang->allow_notices}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="hideemail" id="hideemail" value="0" {$hideemailcheck} /></td>
<td valign="top"><span class="smalltext"><label for="hideemail">{$lang->hide_email}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="receivepms" id="receivepms" value="1" {$receivepmscheck} /></td>
<td valign="top"><span class="smalltext"><label for="receivepms">{$lang->receive_pms}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="pmnotice" id="pmnotice" value="1"{$pmnoticecheck} /></td>
<td valign="top"><span class="smalltext"><label for="pmnotice">{$lang->pm_notice}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="pmnotify" id="pmnotify" value="1" {$pmnotifycheck} /></td>
<td valign="top"><span class="smalltext"><label for="pmnotify">{$lang->email_notify_newpm}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="invisible" id="invisible" value="0" {$invisiblecheck} /></td>
<td valign="top"><span class="smalltext"><label for="invisible">{$lang->invisible_mode}</label></span></td>
</tr>

Interestingly, there's a variable set in member.php for $emailnotify, but it's never used anywhere. I think it's an orphaned remnant from an earlier version change.
thank you and you have been most resourceful for resolving this issue i had. am happy to tell that i have achieved what i was targeting. its most because of your guidance. here i attached what i achieved a simple registration form.
(2017-02-16, 10:54 PM)HLFadmin Wrote: [ -> ]Ok, so I checked a bunch of things out.
First, I have an instance of MyBB 1.8.10 running strictly for test purposes.
If I break it, I can wipe and start fresh.

1. You do not need to do a core edit, so you can revert member.php.
2. In the member registration template, you need to have the controls, so revert back to the default member_register template before you make edits described below.
3. The template is where you can set default values and make them stick, shown in the code snippet below from template member_register.
4. For each checkbox, change input type from checkbox to "hidden". Set the value to 1 if checked or 0 if not checked.
5. When the Submit button is clicked, the controls and values have to be there.
6. I checked this out with the modified member.php file and also the original file.
7. The attached screenshots show the registration page and the User CP.

<legend><strong>{$lang->account_prefs}</strong><br />Default values are already set. These may be changed later in the User CP.</legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%">
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="allownotices" id="allownotices" value="1" {$allownoticescheck} /></td>
<td valign="top"><span class="smalltext"><label for="allownotices">{$lang->allow_notices}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="hideemail" id="hideemail" value="0" {$hideemailcheck} /></td>
<td valign="top"><span class="smalltext"><label for="hideemail">{$lang->hide_email}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="receivepms" id="receivepms" value="1" {$receivepmscheck} /></td>
<td valign="top"><span class="smalltext"><label for="receivepms">{$lang->receive_pms}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="pmnotice" id="pmnotice" value="1"{$pmnoticecheck} /></td>
<td valign="top"><span class="smalltext"><label for="pmnotice">{$lang->pm_notice}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="pmnotify" id="pmnotify" value="1" {$pmnotifycheck} /></td>
<td valign="top"><span class="smalltext"><label for="pmnotify">{$lang->email_notify_newpm}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="hidden" class="checkbox" name="invisible" id="invisible" value="0" {$invisiblecheck} /></td>
<td valign="top"><span class="smalltext"><label for="invisible">{$lang->invisible_mode}</label></span></td>
</tr>

Interestingly, there's a variable set in member.php for $emailnotify, but it's never used anywhere. I think it's an orphaned remnant from an earlier version change.

Can you please create a new bug report for orphaned variable? Thank you
Pages: 1 2