User account setting defaults - uncheck the 'users may email me' box

Started by marjorie, April 23, 2014, 02:43:05 PM

Previous topic - Next topic

marjorie

When a new user registers (AFAICS) by default the 'members may email me' setting is set. How can I set it to 'unset' by default?

kat

As things are, I don't believe that you can, without recoding loads of things.

Silly, that, innit? With Spamtards being the pain that they are, you'd think that that would be the standard setting. :(

I've had a look and it's not as easy to find, as I'd expected. Not only that, but what I'm about to post could be absolute rubbish, I'm afraid. So, keep a copy of the original file, in case I've got this WAAAAY wrong, OK?

In Load.php, which is in the "Sources" directory, there's this line:

'show_email' => showEmailAddress(!empty($profile['hide_email']), $profile['id_member']),

Now, my warped logic tells me that if you swap "show_email" and "hide_email" around, we MIGHT have what we want.

'hide_email' => showEmailAddress(!empty($profile['show_email']), $profile['id_member']),

'course, we might not. ;)

Illori

Quote from: marjorie on April 23, 2014, 02:43:05 PM
When a new user registers (AFAICS) by default the 'members may email me' setting is set. How can I set it to 'unset' by default?

on my test forum it is unchecked by default.

marjorie

Definiately getting new accounts with 'members may email me' set

But I should have said that I define the member accounts manually, i.e., from admin/registration

or from a home grown mod as below (not written by me, I hasten to add):

function createUser($memno,$password){
   global $db_name, $db_prefix, $sourcedir, $boarddir;

   // Set the options needed for registration.
   $member = array(
         'interface' => 'guest',
         'username' => $memno,
         'email' => $memno.'@xxx.net', 
         'password' => $password, 
         'password_check' => $password, 
         'check_reserved_name' => true, 
         'check_password_strength' => false,
         'check_email_ban' => false, 
         'send_welcome_email' => false,
         'require' => 'nothing',
         'extra_register_vars' => array(),
         'theme_vars' => array(),
   );

   $memberID = registerMember($member);  //call the function.  $memberID should return a value.
}

marjorie

K@... tried your mod, no joy except... (numpty question alert). Ive amended load.php. I notice there is also a load.php¬ (should be a squiggle). WHats that?

margarett

The tilde is a backup file, ignore it.

I have to test, but either you can add your options to that array, or you change the table structure to have that field with other default value...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Dragooon

Isn't this the "Allow members to mail me" checkbox while registering?

Quote from: marjorie on April 23, 2014, 07:37:57 PM
Definiately getting new accounts with 'members may email me' set

But I should have said that I define the member accounts manually, i.e., from admin/registration

or from a home grown mod as below (not written by me, I hasten to add):

function createUser($memno,$password){
   global $db_name, $db_prefix, $sourcedir, $boarddir;

   // Set the options needed for registration.
   $member = array(
         'interface' => 'guest',
         'username' => $memno,
         'email' => $memno.'@xxx.net', 
         'password' => $password, 
         'password_check' => $password, 
         'check_reserved_name' => true, 
         'check_password_strength' => false,
         'check_email_ban' => false, 
         'send_welcome_email' => false,
         'require' => 'nothing',
         'extra_register_vars' => array(),
         'theme_vars' => array(),
   );

   $memberID = registerMember($member);  //call the function.  $memberID should return a value.
}

For this add 'hide_email' => 1 in the register options

marjorie

Quote from: Dragooon on April 24, 2014, 05:54:54 AM
Isn't this the "Allow members to mail me" checkbox while registering?

Quote from: marjorie on April 23, 2014, 07:37:57 PM
Definiately getting new accounts with 'members may email me' set

But I should have said that I define the member accounts manually, i.e., from admin/registration

or from a home grown mod as below (not written by me, I hasten to add):

function createUser($memno,$password){
   global $db_name, $db_prefix, $sourcedir, $boarddir;

   // Set the options needed for registration.
   $member = array(
         'interface' => 'guest',
         'username' => $memno,
         'email' => $memno.'@xxx.net', 
         'password' => $password, 
         'password_check' => $password, 
         'check_reserved_name' => true, 
         'check_password_strength' => false,
         'check_email_ban' => false, 
         'send_welcome_email' => false,
         'require' => 'nothing',
         'extra_register_vars' => array(),
         'theme_vars' => array(),
   );

   $memberID = registerMember($member);  //call the function.  $memberID should return a value.
}

For this add 'hide_email' => 1 in the register options

Tried making the code change (by editing the xxx.php file in the Source folder) but it had no effect. 


Setting the DB default 'hide email' => 1 works


It would be nice to have this in code though? Did I need to do anything else to have the system pickup the php file update?


Advertisement: