Topic: Can I remove the email link?

I want to make it impossible for my visitors to email each other. How can I remove the email links from the poster info areas of messages?

2 (edited by Zeke 2005-04-30 21:36)

Re: Can I remove the email link?

Quick and dirty would be to open up viewtopic.php, find the line "// Now let's deal with the contact links (E-mail and URL)" (around line 250), and then remove the code following it:

            if (($cur_post['email_setting'] == '0' && !$pun_user['is_guest']) || $pun_user['g_id'] < PUN_GUEST)
                $user_contacts[] = '<a href="mailto:'.$cur_post['email'].'">'.$lang_common['E-mail'].'</a>';
            else if ($cur_post['email_setting'] == '1' && !$pun_user['is_guest'])
                $user_contacts[] = '<a href="misc.php?email='.$cur_post['poster_id'].'">'.$lang_common['E-mail'].'</a>';

If you didn't want them to be able to e-mail each other at all, it would require additional hacking around in the user profiles..

black robe and swill
I believe Anita Hill
judge will rot in hell
it's the song I hate, it's the song I hate

3 (edited by snoogly 2005-05-01 02:55)

Re: Can I remove the email link?

Thanks for that.

I do want to find a way to prevent them from emailing each other, as the users will be university students and I am obliged to respect their privacy. I intend to let them exchange email addresses via private messages, but I don't want it possible for anyone's email address be revealed by users emailing each other within the punBB interface.

They are unlikely to bother to tweak their profiles, so I do need a down-and-dirty way to stop emailing, and removing the link is as dirty as it gets!

4 (edited by Zeke 2005-04-30 21:59)

Re: Can I remove the email link?

snoogly wrote:

but I do want it possible for anyone's email address be revealed by users emailing each other within the punBB interface.

Do or don't? wink

If don't, then in profile.php, try taking out the following code (around line 959):

                            <dt><?php echo $lang_common['E-mail'] ?>: </dt>
                            <dd><?php echo $email_field ?></dd>

And then, I think you'd be pretty much set. This bit of code in the profile doesn't show e-mail addresses initially. But when person A sends an e-mail, then the reciever sees A's e-mail address.. So it's not particularly visible or public. But yeah, whatever works best.

black robe and swill
I believe Anita Hill
judge will rot in hell
it's the song I hate, it's the song I hate

Re: Can I remove the email link?

Many thanks Zeke - the mods to viewtopic.php and profile.php have removed all the email links.