MyBB Community Forums

Full Version: Found a way to set the default user preferences checkboxes in registration template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Community,
 
been searching for a way to select which ckeckboxes are to be checked by default in the registration page.
 
Found that most threads in the community had no effective answer. 
 
Some of them talk about a plugin called Registration Checkboxes  Which is supposed to work but there's not a stable release, so i didnt try it.
 
As MyBB 2.0 has been seen now in the horizon i guess there will be no more development of that plugin.
 
So i found my way to set the default status i want for the checkboxes of my registration page. 
 
It basically forces the value of the checkbox in the template itself of the registration page (there was one solution for this issue exposed in 1.6 support boards which don't work -at least- for 1.8, however the way i fixed this is very similar)
 
The process would be:
 
  1. Locate the template
    ACP → Styles & Templates → Templates → [your_template] → Member Templates → member_register
  2. Locate the table that shows the checkboxes, wich comes after 
    <strong>{$lang->account_prefs}</strong>
  3. After that code you will find several
    <input type="checkbox" class="checkbox" name="allownotices" id="allownotices" value="1" {$allownoticescheck} /> Note the bolded text will be different for each of the checkboxes
  4.  Then you have to remove the text between brackets and put in its place the attribute "checked" in case you want the checkbox checked or just leave it blank for not checked.
  5.  Then would look like this:
    A) Checked example<input type="checkbox" class="checkbox" name="hideemail" id="hideemail" value="1" checked />B) Unckecked example<input type="checkbox" class="checkbox" name="hideemail" id="hideemail" value="1"/>
  6. Done!
Hope it helps someone!

Cheers
Moved to Tutorials
Good tutorial!  Worked in 1.8...thanks!