The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm trying to make it so that Private Messages are always enabled for every user. (The user can't be allowed to disable them).
I can't comment out the checkbox because then it thinks the user has PM's disabled. I also still want the user to be able to enable/disable email notifications of PM's and pop-up notifications while browsing. Any ideas? The code for the display of the options, can be found in the "modifyoptions" template and looks like this: Code:
<if condition="$show['pmoptions']"> <fieldset class="fieldset"> <legend><label for="cb_receivepm">$vbphrase[private_messaging]</label></legend> <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%"> <tr> <td> <phrase 1="private.php?$session[sessionurl]">$vbphrase[features_private_messaging_system]</phrase> </td> </tr> <tr> <td><label for="cb_receivepm"><input type="checkbox" name="options[receivepm]" value="1" id="cb_receivepm" onclick="toggle_disabled(this.checked, 'pmoptions')" $checked[receivepm] />$vbphrase[enable_private_messaging]</label></td> </tr> <tbody id="pmoptions"<if condition="!$bbuserinfo[receivepm]"> disabled="disabled"</if>> <tr> <td><br />$vbphrase[can_email_when_sends_you_pm]</td> </tr> <tr> <td><label for="cb_emailonpm"><input type="checkbox" name="options[emailonpm]" value="1" id="cb_emailonpm" $checked[emailonpm] />$vbphrase[receive_email_notification_pm]</label></td> </tr> <tr> <td><br /><br />$vbphrase[browsing_when_receive_pm_popup]</td> </tr> <tr> <td><label for="cb_pmpopup"><input type="checkbox" name="pmpopup" value="1" id="cb_pmpopup" $checked[pmpopup] />$vbphrase[show_pm_popup]</label></td> </tr> </tbody> </table> </fieldset> <else /> <input type="hidden" name="options[receivepm]" value="$bbuserinfo[receivepm]" /> <input type="hidden" name="options[emailonpm]" value="$bbuserinfo[emailonpm]" /> <input type="hidden" name="pmpopup" value="$bbuserinfo[pmpopup]" /> </if> |
#2
|
|||
|
|||
![]()
Does anyone have any suggestions?
![]() |
#3
|
|||
|
|||
![]()
I don't think this is doable through a template change.
|
#4
|
|||
|
|||
![]()
Not at all?
![]() Could it work to replace the checkbox with a hidden input field that passes along the "enabled" status? |
#5
|
|||
|
|||
![]() Quote:
|
#6
|
|||
|
|||
![]()
I'll give it a shot, I might need some help, but i'll see what I can do first and
i'll get back to you I think I got it working, just wanted to confirm if I did it right in your opinion.. Old Code (Checkbox): Code:
<input type="checkbox" name="options[receivepm]" value="1" id="cb_receivepm" onclick="toggle_disabled(this.checked, 'pmoptions')" $checked[receivepm] /> New Code (Hidden Input): Code:
<input type="hidden" name="options[receivepm]" value="1" id="cb_receivepm" /> |
#7
|
|||
|
|||
![]()
It looks fine to me.
![]() |
#8
|
||||
|
||||
![]()
Using a hidden field will not stop Users from disabling PM.
But this should: PHP Code:
|
#9
|
|||
|
|||
![]()
Oh, interesting.. thank you for that information, i'll make that change right away..
If its not too much trouble though, could you briefly explain why the hidden field won't and what the code you gave does differently to prevent it? Thanks very much. |
#10
|
||||
|
||||
![]()
Well, a Hidden field sets the Form-Value to 1. So when the Users submits the Form it will be one.
But as this is being done at the Client Side, you can never be sure that the User will be submitting this Form - he could just use his own one where the Value is 0. My Code sets the Value to 1 at server side, so the User has no chance to cheat. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|