MyBB Community Forums

Full Version: How to stop users from unmarking these options in user cp?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to prevent users from unmarking these options in USER CP shown in the pic below? 2 or 3 of my members did this i guess resulting ---> even the admins can't send them a private message.

[Image: d3ae2fa57c3438ffeec6d10f99b21f3f.jpg]
You can remove the code from the usercp_options and member_register template, and run an SQL query to set them to the setting you want. If you need more details and the code to remove/add/run, I'll add it here.
Pls add the details . Thanks.
Ok, what do you want them to be set to?? As in which ones do you want on and which ones off??
I want that Users can't turn off the following options :
(1)Hide me from the Who's Online list. (i won't turn this option off but i still want to know)
(2)Receive emails from the Administrators.
(3)Receive private messages from other users.
(4)Alert me with a notice when I receive a Private Message.
(5)Notify me by email when I receive a new Private Message.
No I meant what do you want them to be set to... like it is in the screenshot??
No actually, 2 or 3 users did it, i.e, unmarked them. I edited their profile from admin cp & now they can receive email & private messages.
But i want that the users don't get to turn off these options in their User cp.. They will have to forcefully receive the private messages, specially from administrators.

So i want to completely disable the Unmarking of options like :
Receive emails from admins
Alert me with a notice when I receive a Private Message.
Notify me by email when I receive a new Private Message.
Right, doesn't quite answer my questions for all of the options so I'll just assume this is what you'll want to do...

From member_register, find:

<tr>
<td valign="top" width="1"><input type="checkbox" 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="checkbox" class="checkbox" name="hideemail" id="hideemail" value="1" {$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="checkbox" 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="checkbox" 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="checkbox" class="checkbox" name="emailpmnotify" id="emailpmnotify" value="1" {$emailpmnotifycheck} /></td>
<td valign="top"><span class="smalltext"><label for="emailpmnotify">{$lang->email_notify_newpm}</label></span></td>
</tr>

From usercp_options, find:

<tr>
<td valign="top" width="1"><input type="checkbox" class="checkbox" name="allownotices" id="allownotices" value="1" {$allownoticescheck} /></td>
<td><span class="smalltext"><label for="allownotices">{$lang->allow_notices}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="checkbox" class="checkbox" name="hideemail" id="hideemail" value="1" {$hideemailcheck} /></td>
<td><span class="smalltext"><label for="hideemail">{$lang->allow_emails}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="checkbox" class="checkbox" name="receivepms" id="receivepms" value="1" {$receivepmscheck} /></td>
<td><span class="smalltext"><label for="receivepms">{$lang->receive_pms}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="checkbox" class="checkbox" name="pmnotice" id="pmnotice" value="1"{$pmnoticecheck} /></td>
<td><span class="smalltext"><label for="pmnotice">{$lang->pm_notice}</label></span></td>
</tr>
<tr>
<td valign="top" width="1"><input type="checkbox" class="checkbox" name="pmnotify" id="pmnotify" value="1" {$pmnotifycheck} /></td>
<td><span class="smalltext"><label for="pmnotify">{$lang->pm_notify}</label></span></td>
</tr>

Replace both of these chunks of code with this:

<input type="hidden" name="allownotices" id="allownotices" value="1">
<input type="hidden" name="hideemail" id="hideemail" value="0">
<input type="hidden" name="receivepms" id="receivepms" value="1">
<input type="hidden" name="pmnotice" id="pmnotice" value="1">
<input type="hidden" name="pmnotify" id="pmnotify" value="1">

Then run these in phpMyAdmin:

UPDATE `mybb_users` SET `allownotices` = '1'
UPDATE `mybb_users` SET `hideemail ` = '0'
UPDATE `mybb_users` SET `receivepms ` = '1'
UPDATE `mybb_users` SET `pmnotice ` = '1'
UPDATE `mybb_users` SET `pmnotify ` = '1'

Check your table prefix first.
Thanks Matt, i will do this. Its all i want.
Mybb has really such a wonderful support.