Hello!
I added some custom options to usercp after I read this great tutorial
https://vborg.vbsupport.ru/showthread.php?t=116155
Instead of manually editing a template like in this tutorial I wanted to use a template_hook in order to make a product that is easy install for others.
At first I inserted this code directly into the modifyoptions template (as suggested in the tutorial):
Code:
<fieldset class="fieldset">
<legend><label for="cb_allowsioc">Export SHA1</label></legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
<tr>
<td>
Export encrypted version of my e-mail address
</td>
</tr>
<tr>
<td><label for="cb_allowsioc"><input type="checkbox" name="siocbitoptions[allowsioc]" value="1" id="cb_allowsioc" $checked[allowsioc] />Export SHA1</label><input type="hidden" name="set_options[allowsioc]" value="1" /></td>
</tr>
</table>
</fieldset>
And everything worked fine.
But when I add the code to the hook global_start using
Code:
$template_hook[usercp_options_privacy] .= ' [same as above] ';
there is a problem:
When I look at the usercp, the checkbox is never checked - it remains empty even tough in the userinfo I can see a 1 where it should be.
Can anyone see where the problem is?