at first you have to edit init.php
there you will find this codeblock:
PHP Code:
// Defined constants used for user field.
$_USEROPTIONS = array(
'showsignatures' => 1,
'showavatars' => 2,
'showimages' => 4,
'coppauser' => 8,
'adminemail' => 16,
'showvcard' => 32,
'dstauto' => 64,
'dstonoff' => 128,
'showemail' => 256,
'invisible' => 512,
'showreputation' => 1024,
'receivepm' => 2048,
'emailonpm' => 4096,
'hasaccessmask' => 8192,
//'emailnotification' => 16384, // this value is now handled by the user.autosubscribe field
'postorder' => 32768,
);
you can add more options there, you just have to make sure, that your values, are 2 ^x and bigger than the currently existing ones, so in your special case here, i suggest something like:
PHP Code:
// Defined constants used for user field.
$_USEROPTIONS = array(
'showsignatures' => 1,
'showavatars' => 2,
'showimages' => 4,
'coppauser' => 8,
'adminemail' => 16,
'showvcard' => 32,
'dstauto' => 64,
'dstonoff' => 128,
'showemail' => 256,
'invisible' => 512,
'showreputation' => 1024,
'receivepm' => 2048,
'emailonpm' => 4096,
'hasaccessmask' => 8192,
//'emailnotification' => 16384, // this value is now handled by the user.autosubscribe field
'postorder' => 32768,
'tosagree' => 1048576,
);
and then instead of:
PHP Code:
$DB_site->query("update user set tos = 'y' where userid='$user[userid]'");
you have to use:
PHP Code:
$DB_site->query("UPDATE user SET options = options | $_USEROPTIONS[tosagree] WHERE userid = $user[userid]");
There is a thread at the mod hints and tips iirc explaining how to work with bitarrays