News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Hiding Everyone's email address

Started by dcabbar, May 05, 2007, 07:10:54 PM

Previous topic - Next topic

dcabbar

Hi,

With SMF, admins can give the users option of hiding their e-mail addresses from other users after sign-up. But, is there a way of making this the default behavior? What I want is:

1. User signs-up with an e-mail addresses
2. By default (without needing user to do so), no-one else can/should see his/her email address.

Thanks

metallica48423

I think if you change your template to have it checked by default on registration.

In Register.template.php, find:

<label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" /> ', $txt[721], '</label>

Try making it:
<label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" checked="checked" /> ', $txt[721], '</label>

To change existing members to all have hideEmail set: First, back up your database, then in phpmyadmin ( What is phpMyAdmin? ) run the following query on your database by selecting the database in the left pane, then clicking 'sql'

UPDATE `smf_members` SET `hideEmail` = '1'

Keep in mind that smf_ is the default, and it will be different if you changed it.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

krackerjax

This little piece of code works great.  Based upon this, I have made my own modificaitons  I'm really big on privacy and i would rather not give my users the option of exposing their email address as such.  If they want to give it out via PM, that's fine, but I'd prefer them not have it openly available for search engines and spambots.

I made the following modifications:

Register.template.php around line 94
Original code:
<label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" /> ', $txt[721], '</label>';
<p>

Replace with:

<input type="hidden" name="hideEmail" id="hideEmail" value="1" />';

Then, I modified the Profile.template.php file.  Starting around line 1236 is the following:

// If the user is allowed to hide their email address from the public give them the option to here.
if ($context['allow_hide_email'])
{
echo '
<tr>
<td width="40%"><b>', $txt[721], '</b></td>
<td><input type="hidden" name="hideEmail" value="0" /><input type="checkbox" name="hideEmail"', $context['member']['hide_email'] ? ' checked="checked"' : '', ' value="1" class="check" /></td>
</tr>';
}


I deleted all of that.  The first modification did not give the user a choice of hiding their email address when signing up, but it set the hideEmail value to 1, as it should be.  Then, by deleting the whole section in Profile.template.php, when the user goes in to their profile, they will not have the option of allowing their email address to be hidden.  This second modificaiton deletes that checkbox and text from the user's profile.

Nitroware

If its email harvesters you are concerned about, use this mod: http://custom.simplemachines.org/mods/index.php?mod=371.  It has an email form, instead of an email address.  That way there are no problems like that.

krackerjax

Wow!   Thanks for the info about the mod.  I really like that alternative.  One idea popped in my head.  Maybe in a future version, if a user has "Hide email address" checked, then it would not allow a person to receive any message via that form.

I believe VB has the feature built in of allowing people to send message via a form rather than seeing the person's email address.  Also, I believe there is the ability for each individual user to reject the receipt of email messages.

Dipper1234

Where is register.template.php located?  Is it the same as register.php.  I couldn't find that code in that file.

Gary

Register.template.php would be located in Themes/default.
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Advertisement: