Textpattern: Emails and URLs in Comments.
I’d like to thank Daniel and Nathan for helping me out on a Textpattern issue. By default, when a visitor posts a comment and fills in all the comment fields (name, email, URL, and message), their name becomes a hyperlink to the submutted URL value when the comment is finally published. But if the visitor leaves out the URL value, their name becomes a mailto:
email link, and that can be cause for concern. While the emails addresses my be encoded, you may not want your readers to have access to others’ email addresses (especially if you are touting email addresses as required for commenting, but confidential and secure).
The answer to getting rid of the email hyperlink is simple. Go to textpattern/lib/admin_config.php, line and change 'never_display_email' => 0
to 'never_display_email' => 1
. Now, when the URL field is left blank, the commentor’s name will not become a hyperlink.
Another solution is to edit the textpattern/publish/comment.php file. Open it up and go to about line 101, where you should see this:
if ($email && !$web && !$txpac['never_display_email'])
$name = '<a href="'.eE('mailto:'.$email).'">'.$name.'</a>';
Changing the value of $name
to a static URL will override the use of an email address as the hyperlink:
if ($email && !$web && $txpac['never_display_email'])
$name = '<a href="http://">'.$name.'</a>';
You could replace the http://
with any URL of your choosing, even your own (juicing up your Google ranking? Hmmm?).
Comments
Nathan Logan » 21 December 2004 #
Easy Forex » 19 April 2005 #