PDA

View Full Version : Registration Form


Nintendo-Daily
04-08-2009, 02:11 PM
How can I prevent (gray out) members from disabling the "Receive Email from Administrators" field?

Nintendo-Daily
04-09-2009, 06:44 PM
Bump...

Anyone know how to do this? It should be pretty easy but I'm not exactly sure.

EnIgMa1234
04-09-2009, 07:45 PM
Not tested but try this.

FIND in register template:

<tr>
<td>
$vbphrase[administrators_may_send_email]
</td>
</tr>
<tr>
<td><label for="cb_adminemail"><input type="checkbox" name="options[adminemail]" value="1" id="cb_adminemail" $checkedoff[adminemail] />$vbphrase[receive_email_from_bulletin_board_staff]</label></td>
</tr>

REPLACE with:


<label for="cb_adminemail"><input type="hidden" name="options[adminemail]" value="1" id="cb_adminemail" $checkedoff[adminemail] /></label>


This should hide the field from your registration form so that it is always checked.

ragtek
04-09-2009, 07:51 PM
that wouldn't be enought;)
you code cheat it, so you'll have to create a plugin and to check it on the php side also!

EnIgMa1234
04-09-2009, 08:00 PM
If you want the checkbox to stay there but not be checkable you can just use
<tr>
<td>
$vbphrase[administrators_may_send_email]
</td>
</tr>
<tr>
<td><label for="cb_adminemail"><input type="checkbox" name="options[adminemail]" value="1" id="cb_adminemail" $checkedoff[adminemail] CHECKED disabled onFocus="this.blur() />$vbphrase[receive_email_from_bulletin_board_staff]</label></td>
</tr>
in place of the above REPLACE codebox.

Again this is untested. I also may be completely wrong about what your trying to do :p If thats the case then I apologise :)

Nintendo-Daily
04-10-2009, 11:43 AM
If you want the checkbox to stay there but not be checkable you can just use
<tr>
<td>
$vbphrase[administrators_may_send_email]
</td>
</tr>
<tr>
<td><label for="cb_adminemail"><input type="checkbox" name="options[adminemail]" value="1" id="cb_adminemail" $checkedoff[adminemail] CHECKED disabled onFocus="this.blur() />$vbphrase[receive_email_from_bulletin_board_staff]</label></td>
</tr>
in place of the above REPLACE codebox.

Again this is untested. I also may be completely wrong about what your trying to do :p If thats the case then I apologise :)

OK, I have tried this and it produced the following:

https://vborg.vbsupport.ru/external/2009/04/110.jpg

It looks like this might work but the words "Receive Email from Administrators" are not next to the grayed-out field any more.

Any other ideas? Seems like we are almost there but not quite. I just thought of something...can't this be overrideen somehow anyway? For example, if the registering member were to uncheck "Receive Email from Administrators" can't this be overridden by me somehow anyway?

EnIgMa1234
04-10-2009, 11:44 AM
OK, I have tried this and it produced the following:

https://vborg.vbsupport.ru/external/2009/04/110.jpg
Told you it was untested :P

Let me test it on my board.

Nintendo-Daily
04-10-2009, 11:53 AM
LOL...wow...that was a quick response. A one minute difference.

EnIgMa1234
04-10-2009, 01:16 PM
Fix for the above:

<tr>
<td>
$vbphrase[administrators_may_send_email]
</td>
</tr>
<tr>
<td><label for="cb_adminemail"><input type="checkbox" name="options[adminemail]" value="1" id="cb_adminemail" $checkedoff[adminemail] CHECKED disabled onFocus="this.blur()" />$vbphrase[receive_email_from_bulletin_board_staff]</label></td>
</tr>

Was missing a " which is what caused the error.

Nintendo-Daily
04-10-2009, 01:18 PM
WOW!! This is exactly what I wanted EnIgMa1234 :) Thanks so much for working on this. I have tested this myself anyway to see if it works and it does. So, if anyone else is interested in using this I can tell you right now that it works :)

Thanks SO MUCH again EnIgMa1234.

ragtek
04-10-2009, 01:33 PM
Check the newest user ragtek and check his value;)

If you didn't create a plugin, user can change it on registration;)
Also i could change it in the usercp!
http://www.nintendo-daily.com/profile.php?do=editoptions

Nintendo-Daily
04-10-2009, 02:02 PM
Thanks for joining by the way :)

Also, EnIgMa1234 and his infinite wisdom created another code to disable this. Both parts should be good to go now.

Thanks again EnIgMa1234! You are the best :)