I guess this would be the correct forum (although if it's not I'm sure a mod will move it

). Basically I'm trying to code a hack that will enable users to decide if they want that "signature tickbox" ticked or not from their profile... However I've got a problem with it...
code:
In ubb_new_reply.cgi
Replace:
# show signature?
if (($vars_display{AllowSignature} eq 'YES') && ($username ne '')) {
$show_sig = qq(
<input type="checkbox" name="Signature" id="Signature" value="yes" checked="checked" /> $vars_wordlets{show_signature});
}
With:
# show signature?
if (($vars_display{AllowSignature} eq 'YES') && ($username ne '') && ($user_profile[42] eq 'NO')) {
$show_sig = qq(
<input type="checkbox" name="Signature" id="Signature" value="yes" /> $vars_wordlets{show_signature});
} else { if (($vars_display{AllowSignature} eq 'YES') && ($username ne '')) {
$show_sig = qq(
<input type="checkbox" name="Signature" id="Signature" value="yes" checked="checked" /> $vars_wordlets{show_signature});
}
}
Now the problem is that everytime I go to reply to a post the tickbox is always ticked, even when "
$user_profile[42]" does equal "
NO". However if I reverse the code that is to use the following (note the difference

):
code:
[qb] # show signature?
if (($vars_display{AllowSignature} eq 'YES') && ($username ne '') && ($user_profile[42] eq 'YES')) {
$show_sig = qq(
<input type="checkbox" name="Signature" id="Signature" value="yes" checked="checked" /> $vars_wordlets{show_signature});
} else { if (($vars_display{AllowSignature} eq 'YES') && ($username ne '')) {
$show_sig = qq(
<input type="checkbox" name="Signature" id="Signature" value="yes" /> $vars_wordlets{show_signature});
}
}
[/qb]
Now the tickbox is now never checked. This leads me to think that there's something wrong with the way I've coded it because it's not finding the variable "
$user_profile[42]." However when looking through the file I've found other examples where the "
$user_profile[number]" variable is used so now I'm out of ideas.
