Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » mailto

#1 2006-07-25 18:44:48

warmbeat
Member
Registered: 2005-11-03
Posts: 33
Website

mailto

Hi there,

I’m having problems with a particular installation of textpattern. For some reason Myres Castle won’t let me use mailto in a textile link.

For example:
<pre>This is my link;
Gives me http://www.myrescastle.com/mailto:email@email.com rather then just mailto:email@email.com

Strange thing is, if I put:
<pre>link;
It picks up that its a mailto, but obviously includes the two // with the email address.

Can anybody shed any light on this?

—-

Thought I’d post my .htaccess file just encase its something todo with URL handling:

<pre>
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) /index.php </IfModule>

#php_value register_globals 0
</pre>

Offline

#2 2006-07-25 19:12:15

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: mailto

Most people don’t just post email addresses (especially if they’re using textile…)
I’m pretty certain textile doesn’t work on this ever.

Try this function:

<code>
function safeAddress($emailAddress, $theText, $theTitle, $xhtml, $isItSafe=”“)
{ $ent = “”; $userName = “”; $domainName = “”; for ($i = 0; $i < strlen($emailAddress); $i++) { $c = substr($emailAddress, $i, 1); if ($c "@") { $userName = $ent; $ent = ""; } else { $ent .= "&#" . ord($c) . ";"; } } $domainName = $ent; if ($xhtml 1) { $endResult = “<script type=\“text/javascript\”>
<!—
document.write(‘<a href=\“mailto:$userName@$domainName\” title=\”$theTitle\”>$userName@$domainName<\/a>’);
// —>
</script>”; } else { $endResult = “<script language=\“JavaScript\” type=\“text/javascript\”>
<!—
document.write(‘<a href=\“mailto:$userName@$domainName\” title=\”$theTitle\”>$userName@$domainName<\/a>’);
// —>
</script>”; } if ($isItSafe) { return(htmlentities($endResult)); } else { return($endResult); }
}
</code>

or go to Automatic Labs for the Enkoder.

Last edited by Walker (2006-07-25 19:12:47)

Offline

#3 2006-07-25 23:48:35

warmbeat
Member
Registered: 2005-11-03
Posts: 33
Website

Re: mailto

Hi Walker,

Thanks for your post.

I’m really confused now. My splash page at www.jonleverrier.com uses a textile mailto and it works fine, just not on Myres Castle.

This function looks interesting – what do i do with it?

Cheers,

Warmbeat

Offline

#4 2006-07-26 05:03:38

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: mailto

You might also consider the use of txp:email.

Offline

#5 2006-07-26 07:57:34

warmbeat
Member
Registered: 2005-11-03
Posts: 33
Website

Re: mailto

Thanks for the info wet.

In addition to my previous post – could any body tell me why one method would work on one textpattern installation to another?

Offline

#6 2006-07-28 08:57:44

warmbeat
Member
Registered: 2005-11-03
Posts: 33
Website

Re: mailto

Hi Walker – any further feedback?

Anybody else got any help or suggestions?

Rgds,

Warmbeat

Offline

  1. Index
  2. » Archives
  3. » mailto

Board footer

Powered by FluxBB