News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Members emails

Started by MH-MINI, January 04, 2010, 04:35:02 AM

Previous topic - Next topic

MH-MINI

Hello,

I've recently upgraded to SMF 2.0 RC2 and I've noticed that members' emails are no longer displayed and the only way to send members emails is to use the form that the forum provides.

I recall something that [Unknown] posted (reproduced below) a while ago and quite frankly I agree with him. So I'm wondering if there's any way to disable this and to display the members' actual email addresses like that was possible in 1.1.11.

I've searched and didn't find anything useful.

Thanks

Quote from: [Unknown] on September 23, 2005, 12:19:22 AM
You can easily configure SMF not to show emails to guests.  Each member can choose not to show their email at all, and use personal messages instead.

I'm using Mozilla Thunderbird now.  Whether I use Hotmail, Mozilla Thunderbird, Opera, Outlook, Eudora, or any other client really doesn't matter.  The fact is that I use a specific client, and accessibility dictates that I should not be forced to use another client just for some dumb website.  My client was designed for my usage of email.  If I'm blind, I may have a client specifically designed for the blind.  If my client is not good enough, and the form-based email would be better, that only means I should get a new client, not that the forum should provide one.

Furthermore, due to spam regulations on the internet, it would be impossible to send email using the sender's actual address.  Instead, the forum's address would have to be used.  Now, imagine if someone were harrassing you... you can block them, but they can just harrass you from forum email relays.  Spammers can also use such forms.  This is precisely what everyone else on the internet concerned with email is trying to PREVENT.  An email should only be sent by the email's actual sender or some identifiable address, not by some proxying service (e.g. a forum, a CMS, etc.)

I'm sorry, but I really can't imagine adding form-based email to SMF being an improvement.  It hurts accessibility, it hurts spam and other blocking, and it's not even necessary because personal messages are already available and widely used.  They can even send notifications to your email address.

However, there are some who feel a form based email feature would be useful.  As current, it doesn't seem like a large number want this, but perhaps the number is high enough to motivate someone to create a third-party modification so people can have the feature if they really want.

-[Unknown]

MH-MINI

Hi, Can anyone help me with this?

Also, I think it's worth mentioning that enabling "Allow viewable email addresses" in admin doesn't do anything.

SoLoGHoST

"Allow viewable email addresses" does work.  If you read the help info for that setting it says that it does NOT override the users setting for hiding their email address from users.  Basically, it gives the user the choice on whether to allow this or not if you place a checkmark in Allow viewable email addresses.  Upon registering this checkbox is unchecked (which is probably why most people don't bother placing a checkmark in it).  And is why it seems like it isn't working.  But if you place a checkmark in this field upon registering, than you will see it works fine.

If you want all users email addresses publicly viewed and not allow them to be able to hide it, than this will have to be made into a MOD, as SMF did this for security reasons ofcourse.

MH-MINI

Quote from: SoLoGHoST on January 06, 2010, 05:52:38 AM
If you want all users email addresses publicly viewed and not allow them to be able to hide it, than this will have to be made into a MOD, as SMF did this for security reasons ofcourse.

No, this is not what I want.

Basically I want to have the ability to disable the form mail and simply create a "mailto:" link for users that choose to display their emails, like that in the previous SMF version...

SoLoGHoST

Well than this is a piece of cake bro.  Look in the relevant template Profile.template.php and where the e-mail addy gets displayed, use the bbc code email to add the link instead of it linking to:  action=emailuser;sa=email;uid=(userid)

where (userid) = the users id value.  So just grab the email addy and place it in between the [ email ] [ /email ] Bcc tags without any spaces and that should do it.

I'll return with some code in a few for you, k?

Cheers :)

MH-MINI

Could someone at SMF please tell me if what I want to do is possible?

MH-MINI


SoLoGHoST

#7
OMG, sorry, forgot about this topic.  You can just actually use the mailto: within the href.

Open up Profile.template.php...

FIND:
// Only show the email address fully if it's not hidden - and we reveal the email.
if ($context['member']['show_email'] == 'yes')
echo '
<dt>', $txt['email'], ': </dt>
<dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';


REPLACE WITH:
// Only show the email address fully if it's not hidden - and we reveal the email.
if ($context['member']['show_email'] == 'yes')
echo '
<dt>', $txt['email'], ': </dt>
<dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>';


FIND:
// ... Or if the one looking at the profile is an admin they can see it anyway.
elseif ($context['member']['show_email'] == 'yes_permission_override')
echo '
<dt>', $txt['email'], ': </dt>
<dd><em><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></em></dd>';


REPLACE WITH:
// ... Or if the one looking at the profile is an admin they can see it anyway.
elseif ($context['member']['show_email'] == 'yes_permission_override')
echo '
<dt>', $txt['email'], ': </dt>
<dd><em><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></em></dd>';


FIND:
// What about if we allow email only via the forum??
if ($context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'no_through_forum' || $context['member']['show_email'] == 'yes_permission_override')
echo '
<li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '" title="', $context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override' ? $context['member']['email'] : '', '" rel="nofollow"><img src="', $settings['images_url'], '/email_sm.gif" alt="', $txt['email'], '" /></a></li>';


REPLACE WITH:
// What about if we allow email only via the forum??
if ($context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'no_through_forum' || $context['member']['show_email'] == 'yes_permission_override')
echo '
<li><a href="', ($context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override' ? 'mailto:' . $context['member']['email'] : $scripturl . '?action=emailuser;sa=email;uid=' . $context['member']['id']), '" title="', $context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override' ? $context['member']['email'] : '', '" rel="nofollow"><img src="', $settings['images_url'], '/email_sm.gif" alt="', $txt['email'], '" /></a></li>';


There, that should do it when viewing users profile.  Users will need to have a checkmark in Allow users to email me within Profile -> Account Settings, as well as in the Admin, you'll have to have Allow viewable email addresses checked within Admin -> Configuration -> Security and Moderation.

If members of your forum have Allow users to email me unchecked, than it just doesn't show anything as it does already ofcourse, otherwise, it makes the e-mail image and e-mail text href point to mailto:emailaddress.  Where emailaddress = the users e-mail.

Cheers :)

P.S. -> Please Mark Topic Solved if you have no further questions.

MH-MINI

Hi,

Where is Profile.template.php I can't find it :-\ :-\

SoLoGHoST

It's in your ./Themes/default directory.

greyknight17

MH-MINI, is this issue resolved now?

Advertisement: